jiayouxjh / grafx2

Automatically exported from code.google.com/p/grafx2
0 stars 0 forks source link

Red flash and incomplete file when loading GIF image #414

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The attached image (saved by Grafx2) provokes a bug in Grafx2 when loading, the 
loading routine detects an error afer reading the last pixel, makes a red 
flash, and stops loading further info from the file. It's harmless if the file 
contained only this image, but when there are layers after this one (as was the 
case when Ilkke was drawing it), other layers are not loaded.

Workaround: If somebody gets this bug again, your image is not lost: Most pixel 
programs and viewers detect multi-layer gifs as animation, so for example with 
XnView, you can browse the layers and save them one by one.

The bug is very old, as even the DOS version of Grafx2 has it.

Original issue reported on code.google.com by yrizoud on 23 Jan 2011 at 4:05

Attachments:

GoogleCodeExporter commented 9 years ago
There's an even simpler way to recover your picture. Simply open it in GIMP and 
save it again. It can save gif "animations" that are compatible with our layer 
format. However, the encoding is different in this case (image reduced to 32 
colors), so it is not suitable for comparing the internal gif data...

Original comment by pulkoma...@gmail.com on 23 Jan 2011 at 4:12

GoogleCodeExporter commented 9 years ago
Ah thanks. Indeed, I can't determine if the error is entirely in the loading 
routine, or if the saving routine already performs something unusual.

Original comment by yrizoud on 23 Jan 2011 at 4:57

GoogleCodeExporter commented 9 years ago
I tried to create a small program to analyze the GIF chunks, but didn't go past 
the header. I can put it on the svn if you want. But I'm too lazy to finish 
it...

Original comment by pulkoma...@gmail.com on 23 Jan 2011 at 4:59

GoogleCodeExporter commented 9 years ago
Don't bother writing from scratch. I guess it would be easier to compare with 
the loading or saving code (or behavior) from other open-source programs, like 
imagemagick or xpaint.

Original comment by yrizoud on 24 Jan 2011 at 9:33

GoogleCodeExporter commented 9 years ago

Original comment by pulkoma...@gmail.com on 15 Feb 2011 at 8:16

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
May be useful : http://www.martinreddy.net/gfx/2d/GIF-comp.txt

Original comment by pulkoma...@gmail.com on 20 Feb 2011 at 2:48

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Most important part is fixed as of r1747: When the situation occurs, loading 
resumes. This successfully loads Ilkke's multi-layer image. About the image 
linked here (single layer), there's still the red flash, It seems the loading 
had "eaten" one extra byte, and thus reached unexpected end-of-file (The pixels 
and palette are there anyway).

Original comment by yrizoud on 5 Mar 2011 at 5:32