• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

thumbor / thumbor-plugins / 40602141291
99%

Build:
DEFAULT BRANCH: master
Ran 27 Oct 2026 11:26PM UTC
Jobs 3
Files 6
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Oct 2026 11:26PM UTC coverage: 100.0% (+1.0%) from 98.995%
40602141291

push

github

web-flow
fix(pngquant): run pngquant without a shell and survive failures (#122)

The optimizer built a "cat input | pngquant ... > output" string and ran
it through subprocess.call(shell=True), ignoring the exit status. Nothing
from the request reaches that string today (thumbor supplies the temp file
names and the other values come from thumbor.conf), but the shell was
unnecessary and any failure left output_file empty. thumbor serves whatever
is in that file, so an empty file turned into a 500 (no Content-Type can be
derived from zero bytes) instead of the unoptimized PNG. The process also
had no timeout, and with thumbor's default ENGINE_THREADPOOL_SIZE of 0 a
slow run blocks the whole event loop.

pngquant now runs as an argument list with stdin and stdout bound to the
temp files, under a new PNGQUANT_TIMEOUT (default 30 seconds, 0 disables).
A non-zero exit, an empty output or a timeout logs a warning and copies the
input over the output so thumbor serves the original image; exit status 99
(quality floor not met) is logged at debug level. PNGQUANT_QUALITY (max,
min-max, -max or min- within 0-100), PNGQUANT_SPEED (1 to 11, passed
without the leading zeros pngquant rejects) and PNGQUANT_TIMEOUT (finite,
0 or more) are checked when the optimizer is built, since they arrive as
strings from thumbor.conf or --use-environment, and an invalid value
disables it with an error instead of reaching pngquant. Unit tests use a
real temp directory and a fake subprocess.run instead of patching
os.path.isfile and os.access, whose tearDown stopped the os.access mock
rather than its patcher, so that patch was never undone.

47 of 47 new or added lines in 2 files covered. (100.0%)

148 of 148 relevant lines covered (100.0%)

1.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-optimizers/gifv - 40602141291.1 27 Oct 2026 11:27PM UTC 2
100.0
GitHub Action Run
2 run-optimizers/mozjpeg - 40602141291.2 27 Oct 2026 11:27PM UTC 2
100.0
GitHub Action Run
3 run-optimizers/pngquant - 40602141291.3 27 Oct 2026 11:26PM UTC 2
100.0
GitHub Action Run
Source Files on build 40602141291
  • Tree
  • List 6
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #40602141291
  • 1041b084 on github
  • Prev Build on master (#40602096162)
  • Next Build on master (#40602191909)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc