The pngcheck is a tool for checking the integrity of PNG, JNG and MNG images for corruption via command line. It also can be used to display the information about an image such as size (width x height), bit depth, compression info, etc.
This tutorial demonstrates how to install pngcheck on Ubuntu 20.04.
Install pngcheck
Use the following command to update the package lists:
sudo apt update
Install pngcheck:
sudo apt install -y pngcheck
Once installation is completed, run the pngcheck
command to check which version has been installed and available command options:
pngcheck
Testing pngcheck
Download image for testing:
wget -O test.png https://raw.githubusercontent.com/opencv/opencv/master/samples/data/sudoku.png
Next, run the pngcheck
command and provide the path of a file as argument to check if a PNG image is valid:
pngcheck test.png
If no errors were found, command outputs OK
, otherwise ERROR
.
OK: test.png (558x563, 24-bit RGB, non-interlaced, 73.4%).
Uninstall pngcheck
If you wish to completely remove pngcheck, run the following command:
sudo apt purge --autoremove -y pngcheck
Leave a Comment
Cancel reply