image-actions icon indicating copy to clipboard operation
image-actions copied to clipboard

[Bug] Infinite image optimization commits degrading .png quality

Open bryangottschalk opened this issue 2 months ago • 4 comments

Describe the bug

Yesterday we started experiencing "infinite image optimization", where certain images never reach the stage where the bot stops committing and comments "x images did not require optimisation". Our build action does not get triggered from the bot commit, so this blocks our required merge check action using this library.

No matter what, our action implementing image-actions continues downgrading the quality for certain .png files, even when just rebasing or pushing up a trivial readme change, reaching the point eventually where the images become blurry.

Curious if others are experiencing this and if recent changes may have caused it.

How To Reproduce

One example image attached that continuously produces a bot commit from this library degrading the quality.

Image

Here is example output from the calibreapp/image-actions bot commit, degrading the same image 3 times in inconsistent percentages. This is when adding 6 .pngs. 4 are getting infinitely optimized and 2 are not.

1.1 KB 483 B 57.1%
483 B 433 B 10.4%
433 B 364 B 15.9%

Screenshots

Image

Relevant Log Output


Code of Conduct

  • [x] I agree to follow this project’s Code of Conduct

bryangottschalk avatar Oct 02 '25 16:10 bryangottschalk

Thanks for reporting @bryangottschalk, could you confirm that you are using the latest version (1.4.1)?

This issue was reported in #349 following an update to sharp. I spent a few hours debugging and made some progress via changing compression settings, but it looks like it's still an issue (for PNG images in particular).

I think the next course of action might be to introduce a minimum required byte change (say 5kb?). Idea being that small compression increments like you've posted above wouldn't be accepted, committed or posted.

benschwarz avatar Oct 08 '25 23:10 benschwarz

I can confirm the issue. I noticed the same behavior as @bryangottschalk with 1.4.1.

See for instance the 3 successive optimization pass required for the action to stabilize:

  • https://github.com/kdeldycke/click-extra/pull/1342
  • https://github.com/kdeldycke/click-extra/pull/1344
  • https://github.com/kdeldycke/click-extra/pull/1346

kdeldycke avatar Oct 11 '25 15:10 kdeldycke

Just commenting to let you know that we also add the issues on multiple repositories at http://github.com/GDevelopApp - we had to revert some commits because of images having artifacts. See an example here: https://github.com/GDevelopApp/GDevelop-documentation/pull/364

4ian avatar Oct 12 '25 20:10 4ian

we are also facing the same, even when using main version

...
uses: calibreapp/image-actions@main
...

lfgcampos avatar Oct 13 '25 13:10 lfgcampos