WordPress.org

Ready to get started?Download WordPress

Forums

Crop-Thumbnails
[resolved] Cropped images are not saved, error mess (6 posts)

  1. keks.editor
    Member
    Posted 1 year ago #

    Hi Volkmar,

    very good idea for a plugin and user friendly interface. However it does not work for me and shows several error messages in the plugin's interface.

    While editing the post, I click 'Crop thumbnails'. On the right side of the thumbnail editor with the previews of thumbnails I have one thumbnail and than the following lines:

    Warning: Division by zero in /home/********/public_html/wp-content/plugins/crop-thumbnails/functions/editor.php on line 399

    Warning: Division by zero in /home/********/public_html/wp-content/plugins/crop-thumbnails/functions/editor.php on line 215

    Warning: Division by zero in /home/********/public_html/wp-content/plugins/crop-thumbnails/functions/editor.php on line 215

    Warning: Division by zero in /home/********/public_html/wp-content/plugins/crop-thumbnails/functions/editor.php on line 227

    Warning: Division by zero in /home/********/public_html/wp-content/plugins/crop-thumbnails/functions/editor.php on line 227

    Warning: Division by zero in /home/********/public_html/wp-content/plugins/crop-thumbnails/functions/editor.php on line 227

    and than I have the previews of the rest of thumbnails.

    Nevertheless I choose the thumbnail to crop, choose the area and hit "crop and save" The preview of the thumbnail in plugin's interface changes. Ok. I close the plugin's interface. Just in case (do not know whether this is required) I click "update post".

    However when I reload the page, thumbnail is not cropped and remains the same as before.

    I do not know whether the error warning and the fact, that the cropped thumbnail is not saved are related, thus I post these issues in one topic. Should you separate them, please advise.

    fyi - I am trying out your plugin at my test site, I am not using any other plugins and I am not using any cashing.

    Looking forward to your answer, as the idea of a plugin is really great.

    Keks

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

  2. keks.editor
    Member
    Posted 1 year ago #

    Sorry, I forgot, that the CloudFlare does a cashing for my site. I switched it off and the cropped images are now shown at the site, everything is fine.

    However the warning message in plugins interface is still there. Although it does not impact functionality.

    Thanks for the great plugin.

  3. Volkmar Kantor
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Keks,
    i will review the code for warnings in the next release. But may take a few days, cause i want to publish next version on WP 3.5

  4. Volkmar Kantor
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Keks,
    even if i turn on notices i dont get the warnings you are posted.
    But i visited the code and get an idea what went wrong. But i need your help!

    Can you copy the size and ratio of each image (each in preview-panel an the original-image)?

    I think, that will help find the bug.

  5. Volkmar Kantor
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, visited the code and, i'm pretty sure that the error is on your side.

    Did you had defined an image_size with a zero width or hight? Dont do that -> lets think about what images you get ;)

    The plugin is not intend to do such work.

  6. zrebie
    Member
    Posted 1 year ago #

    I have a workaround for this, just add in editor.php after
    foreach($all_image_sizes as $img_size_name=>$value) :

    this code, which will set sizes (like thimThumb does if there is 0 size):
    if ($value['width']==0 && $value['height']==0){ $value['width']=$orig_img[2];
    $value['height']=$orig_img[1];
    } else if ($value['width']==0) {
    $value['width'] = floor ($orig_img[1] * ($value['height'] / $orig_img[2]));
    } else if ($value['height']==0) {
    $value['height'] = floor ($orig_img[2] * ($value['width'] / $orig_img[1]));
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic