The "quality" parameter seems to be ignored (in templates)
#224 opened by ometiclan
Description
According to the docs (https://www.buzzingpixel.com/software/ansel-ee/documentation/templating#onTheFlyCroppingAndResizing), I should be able to change the quality on the fly.
<img src="{img:url:resize quality='99'}">
<img src="{img:url:resize quality='10'}">
results in 2 different files with the exact same size. It doesn't matter if I also crop
or scale_up
. Width, Height, Crop all seem to work as intended.
The same seems to be true for the quality settings of the field itself. Changing quality from 1 to 100 results in the same filesize when uploading the same image again.
Edit: Tested with a new channel and a new field: Changing the field setting from 1 to 100 does work when an image is uploaded.
But trying to change the quality in the template:
img:url:resize quality="11"
img:url:resize quality="22"
img:url:resize quality="88"
img:url:resize quality="99"
will generate 4 images in _ansel_image_cache, but the quality / filesize does not change, they are all the same.
What am I doing wrong?
Also: It seems changing the quality and resizing is applied to the image that was uploaded and then saved again with the (initial) settings of the field itself. Yet the original image is also kept. Shouldn't resizing and changing quality be applied to the original image rather than the already modified image? Setting quality=100 in a template on an image that was reduced to quality = 50 by the field settings when uploaded seems pointless. If not, why do we keep the original image?
"[x] Keep original image" seems like a good option to prevent keeping files we don't actually need?
Replies
- ometiclan
Replied 3/6/2023 7:39 AM
In addition, the "Force JPEG" option in the field options yields very different results when checked compared to not-checked.
An image with roughly 1MB in size uploaded with field options quality set to "5" WITHOUT "Force JPEG" results in 1 original image (1MB) and 1 image with roughly 800KB size.
If "Force JPEG" is checked, the same upload will result in 1 original image (1MB) and a second image with about 50KB in size.The image already is a JPG.
50KB seems more likely at quality 5 than 800KB ... what am I missing here?