Incorrect manual path with pngquant creates 0 byte files

Created on 9 July 2021, over 3 years ago
Updated 23 June 2023, over 1 year ago

Problem/Motivation

When configuring a manual path to pngquant you will get PNG files of 0 bytes generated. I believe also with other binaries the tools attempt to be run and in some cases failures are ignored.

When no manual path is specific, it is working, but if pngquant fails it will create 0 byte file too due to no failure detection.

Steps to reproduce

1. Add pngquant as binary
2. Set path manually to non-existing path
3. Upload new PNG and check the styles generated

Proposed resolution

Implement additional checks for return value and also properly detect that the binary can be executed

User interface changes

Implement better messaging saying that the binary is not found and if you do not specify a manual path show the current PATH environment (some hosting environments have empty PATH so the automatic finding will never work)

API changes

None

Data model changes

None

🐛 Bug report
Status

Needs review

Component

Code

Created by

🇬🇧United Kingdom Driskell

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024