Skip to content

Commit af848c4

Browse files
MadProggerpkjuak
authored andcommitted
GIF frames are of ImageType GIF
this way the following code acts as expected: assertEquals(ImageType.GIF, ImageDataFactory.create(GIF_FILE_AS_BYTE_ARRAY).getOriginalType()); Codepath: 1. com.itextpdf.io.image.ImageDataFactory.createImageInstance(byte[], boolean) uses GifImageHelper.processImage(image, 0); to read first GIF Frame 2. first Frame is returned via image.getFrames().get(0)
1 parent c568b10 commit af848c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io/src/main/java/com/itextpdf/io/image/GifImageHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ private static void readFrame(GifParameters gif) throws java.io.IOException {
303303
colorspace[3] = PdfEncodings.convertToString(gif.m_curr_table, null);
304304
Map<String, Object> ad = new HashMap<>();
305305
ad.put("ColorSpace", colorspace);
306-
RawImageData img = new RawImageData(gif.m_out, ImageType.NONE);
306+
RawImageData img = new RawImageData(gif.m_out, ImageType.GIF);
307307
RawImageHelper.updateRawImageParameters(img, gif.iw, gif.ih, 1, gif.m_bpc, gif.m_out);
308308
RawImageHelper.updateImageAttributes(img, ad);
309309
gif.image.addFrame(img);

0 commit comments

Comments
 (0)