I would also love this. It should really come as standard built in, just like purge cache or Resynchronise post counts etc .. maybe with a limit to set how many attachments to rebuild per step to avoid time outs?
I presume you need to write an sql script to grab all the attachments out of the attachment table .. maybe along these lines:
$process_limit = is the value set for how many attachments to grab in each step.
Code: Select all
$sql = 'SELECT attach_id, physical_filename, mimetype
FROM ' . ATTACHMENTS_TABLE . ";
$result = $db->sql_query_limit($sql, $process_limit);
then send each attachment through the fileupload class located in the includes/functions_upload.php file which should check file dimensions and mime types before it creates any thumbnails.
And now update the attachments table for that attachment ID.
Please some one help with this?