Skip to content

Commit

Permalink
ImageDecoder::GetImageInfoで取得されるGIF画像の解像度が正しくないのを修正 (#1172)
Browse files Browse the repository at this point in the history
  • Loading branch information
m4saka authored Dec 27, 2023
1 parent 6c63dfb commit e6c6d66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Siv3D/src/Siv3D/ImageFormat/GIF/GIFDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ namespace s3d

Optional<ImageInfo> GIFDecoder::getImageInfo(IReader& reader, const FilePathView) const
{
uint8 buf[4];
uint8 buf[10];

if (not reader.lookahead(buf))
{
LOG_FAIL(U"❌ GIFDecoder::getImageInfo(): File size is invalid");
return{};
}

const int32 width = ((buf[1] << 8) + (buf[0] << 0));
const int32 height = ((buf[3] << 8) + (buf[2] << 0));
const int32 width = ((buf[7] << 8) + (buf[6] << 0));
const int32 height = ((buf[9] << 8) + (buf[8] << 0));
const Size size{ width, height };

ImagePixelFormat pixelFormat = ImagePixelFormat::R8G8B8A8;
Expand Down

0 comments on commit e6c6d66

Please sign in to comment.