Skip to main content

Python3 module to check for corrupted images using "identify" from ImageMagick as underlying mechanism.

Project description

checkcorruptedimages

Python3 module to check for corrupted images using "identify" from ImageMagick as underlying mechanism.

Installation

Install with pip

pip3 install -U checkcorruptedimages

Usage

In [1]: import checkcorruptedimages

In [2]: from pathlib import Path

In [3]: m = checkcorruptedimages.CheckCorruptedImages()

In [4]: m.verbose = True

In [5]: m.get_corrupted_images(
    folder_to_check=Path("/home/user/Pictures"),
    file_extensions_list=["jpg"]
    )

Path: /home/user/Pictures/notcorruptedimage.jpg, corrupted: False
Path: /home/user/Pictures/corruptedimage.jpg, corrupted: True
Out[5]: [PosixPath('/home/user/Pictures/corruptedimage.jpg'),
    PosixPath('/home/user/Pictures/corruptedimage2.jpg'
    ]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

checkcorruptedimages-0.2.tar.gz (2.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page