Support » Plugin: Media Deduper » Lightweight mode

  • Resolved jiripolacek



    thank you for great plugin.

    But I have problem with big images (7 MB etc.) – maximum execution time of 90 seconds exceeded when your plugin calculate hash (I think that’s the reason).

    Can you please add new feature (optional) – something like lightweight mode which will calculate hash from just first 5000 characters of file (or 10000 characters or something like that).

    I think it will be much faster and lightweight. For lots of users it will be great because we don’t need exact match for image site etc. – size and first 5000 etc. characters will be optimal.


Viewing 2 replies - 1 through 2 (of 2 total)
  • I change for myself media-deduper.php to hash only first 51200 bytes – I think for image archive it is enough.

    return md5_file( $file );


    $f = fopen ($file, 'rb');
    $fcontent = fread ($f, 51200);
    fclose ($f);
    return md5 ($fcontent);

    $upload_hash = md5_file( $file['tmp_name'] );


    $f = fopen ($file['tmp_name'], 'rb');
    $fcontent = fread ($f, 51200);
    fclose ($f);
    $upload_hash = md5 ($fcontent);
    Plugin Author Ben Byrne


    Nice workaround! I suspect most hosts can handle most files, but you’re right that we’re not setting any sort of upper bound and it would be nice to control that. I’ll add to to the “potential new features” list!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Lightweight mode’ is closed to new replies.