Image scaling for product images
Posted: 13 Nov 2017, 11:09
Hi,
as you know, the starting point for the image scaling of product images is the scheduler task "Rescale product images". This task leads to calling the method imagescale within the file typo3conf/ext/aimeos/Resources/Libraries/aimeos/aimeos-core/lib/mwlib/src/MW/Media/Image/Standard.php.
In this context, we have experienced in our system that calling the method imagescale within the method public function scale( $width, $height, $fit = true ) within typo3conf/ext/aimeos/Resources/Libraries/aimeos/aimeos-core/lib/mwlib/src/MW/Media/Image/Standard.php leads to bad quality and a thin black border (to the right and to the bottom). See https://github.com/aimeos/aimeos-core/b ... d.php#L164, please, for the concrete line in the code.
Calling the resample method instead (https://github.com/aimeos/aimeos-core/b ... d.php#L172) leads in our case to much better results.
Therefore, I have the following questions: Do you or some of your customers have experienced similar things concerning the image scaling? Can you imagine some reasons why our results are so bad? Wouldn't it be better to use the resample method resulting in better results? Maybe a configuration option to choose between different image scaling methods could be nice, too.
Besides, I have another question concerning overwriting the core file for the image scaling. I tried to overwrite the core file typo3conf/ext/aimeos/Resources/Libraries/aimeos/aimeos-core/lib/mwlib/src/MW/Media/Image/Standard.php with a file/class within our custom aimeos extension : withtypo3conf\ext\ourextensionkey\Resources\Private\Extensions\ourextensionkey\lib\custom\src\MW\Media\Image\Customized.php. However, no TypoScript configuration worked so far so that the Customized class was taken instead the Standard class. Is it possible to overwrite the Standard class and how would the TypoScript configuration look like?
(plugin.tx_aimeos.settings.mw.media.image.name = Customized or mw.media.image.name = Customized didn't work so far)
Many thanks for your help in advance!
TYPO3 8.7.7. aimeos 17.10.0, PHP: 7.0.25-1~dotdeb+8.1, Operating system: Unix
as you know, the starting point for the image scaling of product images is the scheduler task "Rescale product images". This task leads to calling the method imagescale within the file typo3conf/ext/aimeos/Resources/Libraries/aimeos/aimeos-core/lib/mwlib/src/MW/Media/Image/Standard.php.
In this context, we have experienced in our system that calling the method imagescale within the method public function scale( $width, $height, $fit = true ) within typo3conf/ext/aimeos/Resources/Libraries/aimeos/aimeos-core/lib/mwlib/src/MW/Media/Image/Standard.php leads to bad quality and a thin black border (to the right and to the bottom). See https://github.com/aimeos/aimeos-core/b ... d.php#L164, please, for the concrete line in the code.
Calling the resample method instead (https://github.com/aimeos/aimeos-core/b ... d.php#L172) leads in our case to much better results.
Therefore, I have the following questions: Do you or some of your customers have experienced similar things concerning the image scaling? Can you imagine some reasons why our results are so bad? Wouldn't it be better to use the resample method resulting in better results? Maybe a configuration option to choose between different image scaling methods could be nice, too.
Besides, I have another question concerning overwriting the core file for the image scaling. I tried to overwrite the core file typo3conf/ext/aimeos/Resources/Libraries/aimeos/aimeos-core/lib/mwlib/src/MW/Media/Image/Standard.php with a file/class within our custom aimeos extension : withtypo3conf\ext\ourextensionkey\Resources\Private\Extensions\ourextensionkey\lib\custom\src\MW\Media\Image\Customized.php. However, no TypoScript configuration worked so far so that the Customized class was taken instead the Standard class. Is it possible to overwrite the Standard class and how would the TypoScript configuration look like?
(plugin.tx_aimeos.settings.mw.media.image.name = Customized or mw.media.image.name = Customized didn't work so far)
Many thanks for your help in advance!
TYPO3 8.7.7. aimeos 17.10.0, PHP: 7.0.25-1~dotdeb+8.1, Operating system: Unix