Bug 235242 - creating an image with a filename produces a corrupt file
Summary: creating an image with a filename produces a corrupt file
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-02 18:54 EDT by Shawn Minto CLA
Modified: 2019-09-06 16:08 EDT (History)
2 users (show)

See Also:


Attachments
screenshot (1.27 KB, image/png)
2008-06-02 18:55 EDT, Shawn Minto CLA
no flags Details
new Google favicon (1.12 KB, text/plain)
2008-06-03 12:31 EDT, Mik Kersten CLA
no flags Details
snippet (2.19 KB, text/plain)
2008-06-03 12:50 EDT, Shawn Minto CLA
no flags Details
image (1.12 KB, application/octet-stream)
2008-06-03 12:51 EDT, Shawn Minto CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shawn Minto CLA 2008-06-02 18:54:45 EDT
If an image is created using the path to the .ico file, the transparency is lost and the image is corrupted.  If the image is created from the stream, this behavior doesn't occur and the image is created properly.  This is especially evident when using URLImageDescriptor since it tries to shortcut the creation of the image using the filename.
Comment 1 Shawn Minto CLA 2008-06-02 18:55:30 EDT
Created attachment 103229 [details]
screenshot

The image on the left was created using a stream and the image on the right was created using the path to the file.
Comment 2 Silenio Quarti CLA 2008-06-03 10:17:48 EDT
Please could you attach the original image and the code you used to draw the screenshot?
Comment 3 Mik Kersten CLA 2008-06-03 12:30:05 EDT
It's the new Google favicon: http://www.google.com/favicon.ico  If you see the old one just refresh a few times and you should hit the new one.  I'll attach it as well.  If it would help Shawn has a snippet illustrating the problem.
Comment 4 Mik Kersten CLA 2008-06-03 12:31:14 EDT
Created attachment 103360 [details]
new Google favicon
Comment 5 Mik Kersten CLA 2008-06-03 12:35:14 EDT
Btw, we did check the integrity of that .ico file and it looks fine.  We also tried it with a .ico file that we use.  Shawn will post some code.  
Comment 6 Shawn Minto CLA 2008-06-03 12:50:32 EDT
Created attachment 103364 [details]
snippet

Here is the snippet that I used.  I created a button and 2 toolbars.  One toolbar loads the image using a stream and the other just uses the name to create the image.
Comment 7 Shawn Minto CLA 2008-06-03 12:51:26 EDT
Created attachment 103365 [details]
image

Here is the image that I used for testing (This should be the same as the one that Mik posted).
Comment 8 Silenio Quarti CLA 2008-06-03 14:11:09 EDT
Note that IE and Paint on WinXp also draw the icon badly. Somehow GDI+ gets it wrong, but the SWT image loader gets it right.

Comment 9 Mik Kersten CLA 2008-06-03 18:10:52 EDT
We also verified that IE draws the icon badly on Vista (i.e., appears to remove the transparency layer causing semi-transparent gray pixels to appear black).  IE on Vista renders it correctly in it's Address bar.  Firefox on Vista renders correctly in both Address bar and browser page.
Comment 10 Eclipse Webmaster CLA 2019-09-06 16:08:18 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.