Bug 576609

Summary: [win32] Use GDI+ to load images
Product: [Eclipse Project] Platform Reporter: Alexandr Miloslavskiy <alexandr.miloslavskiy>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, alexandr.miloslavskiy
Version: 4.22   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=576334
Whiteboard:

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.