Skip to content

Instantly share code, notes, and snippets.

@dimmduh
Last active December 14, 2015 00:49
Show Gist options
  • Save dimmduh/5002191 to your computer and use it in GitHub Desktop.
Save dimmduh/5002191 to your computer and use it in GitHub Desktop.
pass full path to brokenFiles.txt
function delete_broken_files($data_filename){
if (file_exists( $data_filename ) ){
$data = file($data_filename);
foreach( $data as $line ){
$line_parts = explode(', CorruptJPEGChecker.exe', $line);
if (count($line_parts) > 1 && file_exists( $line_parts[0] ) ){
unlink( $line_parts[0] );
echo 'delete ' . $line_parts[0] . "\n";
}
}
}
}
@dimmduh
Copy link
Author

dimmduh commented Nov 5, 2014

CorruptJPEGChecker.exe you can download here
http://dimmduh.com/files/CorruptJPEGChecker.exe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment