FLTK logo

Re: [fltk/fltk] Fl_Image_Reader::read_byte() does not return EOF with file reads (#271)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] Fl_Image_Reader::read_byte() does not return EOF with file reads (#271) Albrecht Schlosser Sep 30, 2021  
 

BTW: I came across a file (it maybe was posted in one the FLTK groups previously), that has this error, but still loads ok then:
black_white.zip

IMHO it doesn't "load ok" in the FLTK viewer (fl_pixmap): it displays an image, but that's not "ok". As you can see in the error messages, the first 24 lines seem to show the contents of what should be a global color table (8 gray values). The last line says "black_white.gif does not have a color table, using default" (which could be considered a "feature"). However, such a broken image could eventually lead to anything, including breaking an otherwise correct FLTK program (if it crashes later for whatever reason). So the only safe solution is IMHO to terminate decoding and ...

All the other "image viewers" I tested (including Firefox and Chrome) don't display an image, some of them issue an error message, others don't.

FTR: the broken image has only one bit wrong: the "Global Color Table Flag" is 0 (must be 1). I fixed it with a hex editor (s/0x22/0xa2/ - see below) et voilà: it works. It's a nicely animated GIF image.

$ xxd -g1 black_white.gif | head -1; xxd -g1 black_white_fixed.gif | head -1
00000000: 47 49 46 38 39 61 58 02 58 02 22 06 00 99 99 99  GIF89aX.X.".....
00000000: 47 49 46 38 39 61 58 02 58 02 a2 06 00 99 99 99  GIF89aX.X.......

Image attached:
black_white_fixed.gif


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.