Image Format WebP

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Moritz
Advanced
Posts: 153
Joined: 07 Nov 2018, 14:05

Image Format WebP

Post by Moritz » 08 Dec 2022, 12:45

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 12007 times
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Image Format WebP

Post by aimeos » 09 Dec 2022, 07:58

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Moritz
Advanced
Posts: 153
Joined: 07 Nov 2018, 14:05

Re: Image Format WebP

Post by Moritz » 09 Dec 2022, 08:46

What does each of the 4 blocks stand for?
The first one is for the catalog list view I think?
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Image Format WebP

Post by aimeos » 12 Dec 2022, 08:38

Each of the blocks define a product image size for catalog list and detail view that is generated when uploading a new image.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Moritz
Advanced
Posts: 153
Joined: 07 Nov 2018, 14:05

Re: Image Format WebP

Post by Moritz » 16 Jan 2023, 13:50

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 11876 times
new_webp.png
new_webp.png (20.55 KiB) Viewed 11876 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,
				]],
			],
		],
	],
];
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Image Format WebP

Post by aimeos » 18 Jan 2023, 10:20

Can you check in the resize() method if there's something wrong?
https://github.com/aimeos/aimeos-core/b ... #L229-L249
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Moritz
Advanced
Posts: 153
Joined: 07 Nov 2018, 14:05

Re: Image Format WebP

Post by Moritz » 18 Jan 2023, 11:28

The function is not executed in my case.
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Image Format WebP

Post by aimeos » 19 Jan 2023, 13:56

Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Moritz
Advanced
Posts: 153
Joined: 07 Nov 2018, 14:05

Re: Image Format WebP

Post by Moritz » 20 Jan 2023, 09:48

Yes, the method is executed twice.

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

resize_2.png
resize_2.png (185.58 KiB) Viewed 11806 times
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Image Format WebP

Post by aimeos » 20 Jan 2023, 16:26

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply