pngcheck

Crates.iopngcheck
lib.rspngcheck
version0.1.1
created_at2025-10-12 16:45:35.498521+00
updated_at2025-10-12 16:57:20.433148+00
descriptionVerify PNG file integrity and display chunk information
homepagehttps://github.com/jonaylor89/pngcheck
repositoryhttps://github.com/jonaylor89/pngcheck
max_upload_size
id1879442
size79,649
Johannes Naylor (jonaylor89)

documentation

README

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
Commit count: 0

cargo fmt