craftcms / craftcms/cms

[4.4.15]: Quality setting does not work for transforms of png images

Open
#13,493 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug craft4
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?
Description

Transforms of png images to any format always result in the same file size, irrespective of the quality setting.

The file size is large, so I assume the output quality is always maximum.

This happens both on local (latest DDEV) and on a server provisioned with Ploi with all the latest updates.

ImageMagick version from system report: Imagick 3.7.0 (ImageMagick 6.9.11-60)

Steps to reproduce
  1. Upload a png image file to any asset folder.
  2. Output a transform of this asset in a template, either with a named transform or with a template defined transform, with a quality of 100.
  3. Take note of the file size.
  4. Change the transform quality setting to a lower quality.
  5. Check the new file size.
Expected behavior

The file size should be lower, due to lower quality

Actual behavior

The file size remains exactly the same, no matter how low the quality setting.

Craft CMS version

4.4.15

PHP version

8.2.8

Operating system and version

No response

Database type and version

No response

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the transform with a PNG asset and compare output sizes while changing the quality setting, using the reported Imagick 3.7.0 and ImageMagick 6.9.11-60 versions. Check both named and template-defined transforms; done means lower quality produces a correspondingly smaller output file.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.