WordPress.org

Ready to get started?Download WordPress

Forums

Regenerate Thumbnails
CONTRIBUTION: Code to fix "error" and REALLY regenerete th (4 posts)

  1. Pedro Elsner
    Member
    Posted 1 year ago #

    Hello Viper,
    Firstly, great job!
    Secondly, sorry for my english poor (I'm Brazilian =)

    Currently I use your plugin Regenerate Thumbnail. When we change the definitions of image_size, adding, removing or changing the order of statements, some thumbs were crazy rrsrs

    If we run the plugin to regenerete thumbnails, nothing happens (only we edit format: width and height). Looking for a solution, i found that when we delete the old thumbnail file created by wordpress, the plugin works and create the thumbnail again, ONLY IF THE THUMBNAIL FILE DOES NOT EXIST!

    I edited the plugin for him to delete all image thumbnails before you regenerate. More specifically altered function ajax_process_image(), then the line @ set_time_limit(900).

    Here is the full function with my modifications: https://gist.github.com/3336770

    See the specific code below:

    // ############
    // DELETE ALL THUMBNAIL, TO REALLY REGENERETE =D
    // By: Pedro Elsner
    // ############
    global $_wp_additional_image_sizes;
    $imagePath = substr($fullsizepath, 0, strlen($fullsizepath) - 4);
    $imageFormat = substr($fullsizepath, -4);
    foreach($_wp_additional_image_sizes as $key => $value) {
         $thumb = $imagePath . '-' . $value['width'] . 'x' . $value['height'] . $imageFormat;
         unlink($thumb);
    }
    // ############

    Now yes, we REALLY can regenerate thumbnail.

    Thanks my friend!

    http://wordpress.org/extend/plugins/regenerate-thumbnails/

  2. amberm
    Member
    Posted 1 year ago #

    Hi Pedro,
    Where do we insert this code?

    I'm using this plug-in and it's not working for me either and am hoping your addition will solve my problem.

    Thank you!

  3. amberm
    Member
    Posted 1 year ago #

    Nevermind...this plug-in does not do what I thought it did. I'm looking for a way to update my thumbnails on a page. I posted the images, then went back and edited the thumbnails but the page never updated with the new thumbnails. I thought that's what this plug-in did :/

    If anyone knows of a way to do that, send me the info :) Thanks!

  4. Pedro Elsner
    Member
    Posted 1 year ago #

    Hi Amberm,
    Viper don't update the plugin...

    I create (copy for this rs) a plugin to DELETE to after REALLY regenerate thumbnails. See: Force Regenerate Thumbnails

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.