diff --git a/Userland/Libraries/LibGfx/ImageFormats/GIFWriter.cpp b/Userland/Libraries/LibGfx/ImageFormats/GIFWriter.cpp index c9a1011cf5e..287d7e08e8b 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/GIFWriter.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/GIFWriter.cpp @@ -21,15 +21,15 @@ ErrorOr write_header(Stream& stream) return {}; } -ErrorOr write_logical_descriptor(BigEndianOutputBitStream& stream, Bitmap const& bitmap) +ErrorOr write_logical_descriptor(BigEndianOutputBitStream& stream, IntSize size) { // 18. Logical Screen Descriptor - if (bitmap.width() > NumericLimits::max() || bitmap.height() > NumericLimits::max()) + if (size.width() > NumericLimits::max() || size.height() > NumericLimits::max()) return Error::from_string_literal("Bitmap size is too big for a GIF"); - TRY(stream.write_value(bitmap.width())); - TRY(stream.write_value(bitmap.height())); + TRY(stream.write_value(size.width())); + TRY(stream.write_value(size.height())); // Global Color Table Flag TRY(stream.write_bits(false, 1)); @@ -135,7 +135,7 @@ ErrorOr GIFWriter::encode(Stream& stream, Bitmap const& bitmap) TRY(write_header(stream)); BigEndianOutputBitStream bit_stream { MaybeOwned { stream } }; - TRY(write_logical_descriptor(bit_stream, bitmap)); + TRY(write_logical_descriptor(bit_stream, bitmap.size())); // Write a Table-Based Image TRY(write_image_descriptor(bit_stream, bitmap));