Bug 569551 - ImageLoader class is ignoring the compression attribute
Summary: ImageLoader class is ignoring the compression attribute
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.17   Edit
Hardware: All Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-08 10:19 EST by Celso Suzuki CLA
Modified: 2022-02-12 01:43 EST (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 Celso Suzuki CLA 2020-12-08 10:19:50 EST
The ImageLoader class is using the GDK.gdk_pixbuf_save_to_bufferv method to save images, but is passing null for the option_keys and option_values attributes, so the compression attribute is ignored.

Accoding to the GDK documentation, for JPEG images it should pass the string "quality" in option_keys and a value in the range [0,100] in option_values. For PNG images it should pass the string "compression" in option_keys and an integer in the range of [0,9] in option_values.
Comment 1 Andrey Loskutov CLA 2020-12-12 02:22:06 EST
Do you want to provide a Gerrit patch?
Comment 2 Eclipse Genie CLA 2022-01-19 09:36:36 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189782
Comment 4 Alexander Kurtakov CLA 2022-02-12 01:15:20 EST
This one caused crashes in tests like:
1) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.eclipse.swt.internal.gtk.GDK.gdk_pixbuf_save_to_bufferv(J[J[J[B[J[J[J)Z+0
J 7274% c1 org.eclipse.swt.graphics.ImageLoader.save(Ljava/io/OutputStream;I)V (1014 bytes) @ 0x00007f248c5e9034 [0x00007f248c5e6e60+0x00000000000021d4]
j  org.eclipse.swt.graphics.ImageLoader.save(Ljava/lang/String;I)V+34
j  org.eclipse.jface.tests.internal.databinding.swt.Screenshots.takeScreenshot(Ljava/lang/Class;Ljava/lang/String;Ljava/io/PrintStream;)Ljava/lang/String;+469
j  org.eclipse.jface.tests.internal.databinding.swt.ControlObservableValueTest.testObserveFocus()V+421

2) Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.eclipse.swt.internal.gtk.GDK.gdk_pixbuf_save_to_bufferv(J[J[J[B[J[J[J)Z+0
j  org.eclipse.swt.graphics.ImageLoader.save(Ljava/io/OutputStream;I)V+930
j  org.eclipse.swt.graphics.ImageLoader.save(Ljava/lang/String;I)V+34
j  org.eclipse.jdt.internal.ui.viewsupport.ImagesOnFileSystemRegistry.getImageURL(Lorg/eclipse/jface/resource/ImageDescriptor;)Ljava/net/URL;+75
j  org.eclipse.jdt.internal.ui.viewsupport.ImagesOnFileSystemRegistry.getImageURL(Lorg/eclipse/jdt/core/IJavaElement;)Ljava/net/URL;+18
j  org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getImageURL(Lorg/eclipse/jdt/core/IJavaElement;)Ljava/lang/String;+9
j  org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getImageAndLabel(Lorg/eclipse/jdt/core/IJavaElement;ZLjava/lang/String;)Ljava/lang/String;+36
j  org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getInfoText(Lorg/eclipse/jdt/core/IJavaElement;Lorg/eclipse/jdt/core/ITypeRoot;Lorg/eclipse/jface/text/IRegion;Z)Ljava/lang/String;+192
j  org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo([Lorg/eclipse/jdt/core/IJavaElement;Lorg/eclipse/jdt/core/ITypeRoot;Lorg/eclipse/jface/text/IRegion;Lorg/eclipse/jdt/internal/ui/text/java/hover/JavadocBrowserInformationControlInput;)Lorg/eclipse/jdt/internal/ui/text/java/hover/JavadocBrowserInformationControlInput;+198
j  org.eclipse.jdt.ui.tests.hover.PackageJavadocTests.testGetDocFromPackageHtml_src()V+108
Comment 5 Eclipse Genie CLA 2022-02-12 01:16:12 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/190413
Comment 7 Alexander Kurtakov CLA 2022-02-12 01:43:40 EST
It's not only tests, it crashes workbench too.