Bug 576609 - [win32] Use GDI+ to load images
Summary: [win32] Use GDI+ to load images
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.22   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-13 10:32 EDT by Alexandr Miloslavskiy CLA
Modified: 2021-10-13 10:51 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Miloslavskiy CLA 2021-10-13 10:32:40 EDT
If I remember correctly, currently Win7 is the minimum supported Windows for SWT. This means that GDI+ must always be present.

GDI+ is capable of loading all sorts of image formats; [1] says:
  You can construct Image objects from a variety of file types including
  BMP, ICON, GIF, JPEG, Exif, PNG, TIFF, WMF, and EMF.

However, SWT on Windows still uses custom code to load images, see 'ImageLoader',
which is documented to support:
 BMP, ICO, JPEG, GIF, PNG, TIFF

SWT's code is not without bugs, see for example Bug 576334.

Therefore, it sounds like a good idea to replace SWT's custom code with GDI+.
SWT seems to already have some GDI+ code, see for example 'Image.initNative()'.

[1] https://docs.microsoft.com/en-us/windows/win32/api/gdiplusheaders/nl-gdiplusheaders-image
Comment 1 Alexandr Miloslavskiy CLA 2021-10-13 10:33:54 EDT
Note that on GTK, SWT already uses GTK's loader instead of custom code.