Jump to content

Scanning for JPEG corruption using PHP?


SilverBlade86

Recommended Posts

I currently have a RegenThumbnails function, which basically scans all directories and subdirectories in a Photo Directory, and creates thumbnails for each and every photo in there, using ImageCreateTrueColor, ImageCopyResized, etc.

 

However, sometimes the photos I have are corrupted, and it outputs error messages as well as a black thumbnail.

 

Now, how can I implement a function which would scan the JPEG files for any signs of corruption, and stop it from being processed? That way I can create another function which would delete all corrupted JPEG files if encountered, as well as still generating thumbnails for the ones that still do work.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/90299-scanning-for-jpeg-corruption-using-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.