| Summary: | [Image loading] ImageLoader and Image from stream fail with certain animated gifs | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Thomas Schindl <tom.schindl> | ||||
| Component: | SWT | Assignee: | Carolyn MacLeod <carolynmacleod4> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Silenio Quarti <Silenio_Quarti> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | skovatch | ||||
| Version: | 3.6 | ||||||
| Target Milestone: | 4.3 M1 | ||||||
| Hardware: | PC | ||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Thomas Schindl
Created attachment 176543 [details]
Example project
Carolyn owns image loader bugs. I verified this fails on Cocoa in HEAD. Exception is: Loading image with stream failed. org.eclipse.swt.SWTException: Invalid image at org.eclipse.swt.SWT.error(SWT.java:4083) at org.eclipse.swt.SWT.error(SWT.java:3998) at org.eclipse.swt.SWT.error(SWT.java:3969) at org.eclipse.swt.internal.image.GIFFileFormat.getExtensions(GIFFileFormat.java:156) at org.eclipse.swt.internal.image.GIFFileFormat.loadFromByteStream(GIFFileFormat.java:124) at org.eclipse.swt.internal.image.FileFormat.loadFromStream(FileFormat.java:48) at org.eclipse.swt.internal.image.FileFormat.load(FileFormat.java:84) at org.eclipse.swt.graphics.ImageLoader.load(ImageLoader.java:130) at org.eclipse.swt.graphics.ImageDataLoader.load(ImageDataLoader.java:22) at org.eclipse.swt.graphics.ImageData.<init>(ImageData.java:331) at org.eclipse.swt.graphics.Image.<init>(Image.java:502) at ImageLoaderTest.main(ImageLoaderTest.java:19) Cool GIF. 74 images. I can comment out one line (the one that throws the error), and get it to (mostly) work. There seems to be an unknown extension in the final image that has an id of "254". I am out of time to look at this today, so I will get back to it on Friday. Fixed > 20120625 for 4.3 M1 Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=ff9c15961deba7f09d9b58b96d5ee00c19a9ff6f (Re: comment 3): OK, "Friday" was a while ago... sorry about that. It turns out that the attached gif does not conform to the GIF spec, and even Firefox and Windows Picture Viewer fail to read the entire file. However, since they both salvage the gif by reading in as much as they can, and they can still animate the images up to the point where it is broken (image #74 of the animation), I decided to do the same thing. So this patch makes our gif loading code a little more lenient, and your gif will (mostly) load. |