2 releases
Uses new Rust 2024
| 0.1.1 | Oct 12, 2025 |
|---|---|
| 0.1.0 | Oct 12, 2025 |
#80 in Images
360 downloads per month
42KB
982 lines
pngcheck
A Rust reimplementation of the classic pngcheck utility for verifying PNG file integrity and displaying chunk information.
Features
- PNG signature validation
- CRC-32 validation for all chunks
- Chunk structure verification
- IHDR, PLTE, IDAT, IEND critical chunks
- Common ancillary chunks (tRNS, cHRM, gAMA, iCCP, sBIT, sRGB, tEXt, zTXt, iTXt, bKGD, hIST, pHYs, sPLT, tIME, eXIf)
- Animated PNG chunks (acTL, fcTL, fdAT)
- PNG Third Edition chunks (cICP, mDCV, cLLI)
- Verbose output modes
- Color output for terminals
Usage
# Check a single PNG file
pngcheck image.png
# Check multiple files
pngcheck file1.png file2.png file3.png
# Verbose output
pngcheck -v image.png
# Very verbose output
pngcheck -vv image.png
# Colorized output
pngcheck -c image.png
# Print text chunks
pngcheck -t image.png
# Print palette contents
pngcheck -p image.png
# Quiet mode (errors only)
pngcheck -q image.png
# Read from stdin
cat image.png | pngcheck
Command-line Options
-7- print contents of tEXt chunks, escape chars >=128 (for 7-bit terminals)-c- colorize output (for ANSI terminals)-p- print contents of PLTE, tRNS, hIST, sPLT (can be used with -q)-q- test quietly (output only errors)-t- print contents of tEXt chunks (can be used with -q)-v- test verbosely (print most chunk data)-h- show help
Differences from original version
- Simplified output format for chunk information
- Does not include MNG/JNG support (PNG-only)
- Does not include
-s(search) or-x(extract) features - Does not decompress/validate zlib streams in IDAT chunks
Original Credits
Based on pngcheck 4.0.0 by:
- Alexander Lehmann
- Andreas Dilger
- Greg Roelofs
- Chris Lilley
- Glenn Randers-Pehrson
- John Bowler
- Tom Lane
Dependencies
~32–270KB