PNG support for product_image module

Hello,

Is there any reason as to why png format is “not supported” for the images at product_image module?

I see that the RGBA images are being converted into RGB, which makes the transparency mask convert into black when saving the image.

I tested a change making the hardcoded format into a png when the image mode is RGBA and it looks/works good at a first glance.

If it’s related to the image/database size, I think that should be up to the user. Tryton already lets you store PNG files as attachments or at independent (non-module) Binary fields, so if we were to use a image module, supporting png should be standard IMHO.

For me it is supported but we serve only JPEG because the goal is to serve them for web site so this format is a good compromise.

We need to convert to RGB otherwise it is not possible to convert to JPEG.
The best is to no use transparency if you do not want to have it converted to black.

PNG format is not recommended for the use case of the module, see Shopify Help Center | Uploading images

I would strongly suggest to use webp, which usually substantially lighter than JPEG and supports transparency.

WebP is not supported by default by gdk-pixbuf. It requires an extra library gdk-pixbuf-loader-webp which is not part of Gtk project (and not distributed by MSYS2).
We already had a lot of trouble by using earlier SVG in Gtk.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.