#91855Image with crop set is JPEG compressed twice
Description
Image with crop set is JPEG compressed twice so it loses quality 2 times based on jpg_quality setting.
1st compress when crop is executed: https://github.com/TYPO3/TYPO3.CMS/blob/5275e76e4ae7e00a0bce59b8d458e547e427b92b/typo3/sysext/core/Classes/Resource/Processing/LocalCropScaleMaskHelper.php#L87
2nd compress when scaling is executed:
https://github.com/TYPO3/TYPO3.CMS/blob/5275e76e4ae7e00a0bce59b8d458e547e427b92b/typo3/sysext/core/Classes/Resource/Processing/LocalCropScaleMaskHelper.php#L118
A solution could be to use a $jpegQuality=100 the first time it’s compressed if it will be compressed a second time (using the configured jpg_quality).
Reviews 6
- main 89968[WIP][BUGFIX] Allow ImageProcessingInstructions to set maxWidth/Height
- main 67234[BUGFIX] Process cropped images only once
- main 83299[TASK] Avoid duplicate image crop (crop-crop-scale to crop-scale)
- main 65187[BUGFIX] Process cropped images only once
- 10.4 66672[BUGFIX] Process cropped images only once
- main 65088[BUGFIX] Apply quality constraint to processed images only once
Related issues 7
- Bug #81796LocalCropScaleMaskHelper does not respect quality setting
- Bug #93085Image Select and Image Cropping incorrect after TYPO3 update to v10.4.11
- Bug #93086Distorted images in FE and BE after the update to 10.4.11
- Bug #93090Image Cropping broken since TYPO3 10.4.11 release
- Bug #93092Weird visualization of thumbnails in CE after upgrading to 10.4.11
- Bug #105463Preview images in filelist are always in square format
- Bug #93139Revert image processing