Page 1 of 2

Image Format WebP

Posted: 08 Dec 2022, 12:45
by Moritz
All uploaded images are converted to .webp for the preview now.
Can I deactivate it and use the source format instead like in previous versions?

EDIT:
Because the .webp preview image has empty space at the top and the bottom which destroys my layout.

webp.png
webp.png (121.67 KiB) Viewed 11948 times

Re: Image Format WebP

Posted: 09 Dec 2022, 07:58
by aimeos
Check and adapt your configuration for the generated images:
https://github.com/aimeos/aimeos-core/b ... hp#L46-L62

The sizes are enforced ("force-size=1") by default now and padded if the image doesn't exactly fit.

Re: Image Format WebP

Posted: 09 Dec 2022, 08:46
by Moritz
What does each of the 4 blocks stand for?
The first one is for the catalog list view I think?

Re: Image Format WebP

Posted: 12 Dec 2022, 08:38
by aimeos
Each of the blocks define a product image size for catalog list and detail view that is generated when uploading a new image.

Re: Image Format WebP

Posted: 16 Jan 2023, 13:50
by Moritz
I have re-uploaded and saved the image of an old product.
When converting to WebP, a piece of the right edge was cut off.

old_png.png
old_png.png (18.5 KiB) Viewed 11817 times
new_webp.png
new_webp.png (20.55 KiB) Viewed 11817 times

My settings are as follows.

Code: Select all

return [
	'common' => [
		'media' => [
			'product' => [
				'previews' => [[
					'maxwidth' => 600,
					'maxheight' => 320,
					'force-size' => 0,
				], [
					'maxwidth' => 480,
					'maxheight' => 640,
					'force-size' => 0,
				], [
					'maxwidth' => 960,
					'maxheight' => 1280,
					'force-size' => 0,
				], [
					'maxwidth' => 1920,
				]],
			],
		],
	],
];

Re: Image Format WebP

Posted: 18 Jan 2023, 10:20
by aimeos
Can you check in the resize() method if there's something wrong?
https://github.com/aimeos/aimeos-core/b ... #L229-L249

Re: Image Format WebP

Posted: 18 Jan 2023, 11:28
by Moritz
The function is not executed in my case.

Re: Image Format WebP

Posted: 19 Jan 2023, 13:56
by aimeos

Re: Image Format WebP

Posted: 20 Jan 2023, 09:48
by Moritz
Yes, the method is executed twice.

resize_1.png
resize_1.png (185.8 KiB) Viewed 11747 times

resize_2.png
resize_2.png (185.58 KiB) Viewed 11747 times

Re: Image Format WebP

Posted: 20 Jan 2023, 16:26
by aimeos
Didn't know that GD supports WebP now.
You can either install the PHP Imagick extension or check in the resize() method if there's something that removes the border.