Ticket #13801 (new Bug)
Opened 2 years ago
plone.app.imaging scaleImage quality parameter not given in some cases
Reported by: | vincentfretin | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 4.x |
Component: | Unknown | Version: | 4.3 |
Keywords: | Cc: |
Description
Plone 4.3.1 gave the possibility to configure the quality of generated scales (default is 88). The parameter is not given in all cases.
ImageField with /@@images/images/preview notation uses plone.app.imaging.scaling.ImageScaleFactory I guess, so the quality parameter is given.
ImageField with /image_preview notation uses plone.app.imaging.scaling.ImageScaleFactory, so uses createScale, it uses field.scale (monkey patched in plone.app.imaging.monkey.scale) which uses getQuality() so no problem for the quality parameter.
BlobImageField with /image_preview notation uses plone.app.blob.scale.BlobImageScaleHandler which inherits from plone.app.imaging.traverse.DefaultImageScaleHandler. In plone.app.imaging.traverse.DefaultImageScaleHandler.createScale, it uses field.scale (monkey patched in plone.app.imaging.monkey.scale) which uses getQuality() so no problem for the quality parameter.
BlobImageField with /@@images/images/preview notation uses plone.app.blob.scale.BlobImageScaleFactory
(not plone.app.imaging.scaling.ImageScaleFactory) and call scaleImage without a quality parameter, so it default to 88, not the site configured one.
-> plone.app.blob.scale.BlobImageScaleFactory should use the quality parameter like it's done plone.app.imaging.scaling.ImageScaleFactory.
plone.namedfile.scaling.ImageScaling.getQuality uses non existing plone.scale.interfaces.IScaledImageQuality so returns None and use the default 88 defined in scaleImage
-> should use plone.app.imaging.utils.getQuality