Support » Plugin: Crop-Thumbnails » Cropped images are not saved, error mess

  • Resolved keks.editor

    (@kekseditor)


    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/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter keks.editor

    (@kekseditor)

    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.

    Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    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

    Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    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.

    Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    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.

    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]));
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Cropped images are not saved, error mess’ is closed to new replies.