Support » Plugin: Comment Pub » Don't crop, move upload dialog

  • Resolved bryanbrazil


    Nice plugin, great work!

    Would it be possible to set only the desired image width and then resize the image, not crop it to a width/height? So the image would have a fixed width and variable height.

    Also, is it possible to move where the upload dialog is displayed on the comment form? Rather than have it above the comment textarea, I would like to move it below.


Viewing 3 replies - 1 through 3 (of 3 total)
  • I figured out how to move the dialog by changing the hook to comment_form_before.

    Hey Brian I just worked a simple fix.

    In comment_pub.php
    There are several functions for resizing, because of version changes. I had to change a few.

    First part of fix:
    $file_destination = image_resize( $current_file, $imgw, $imgh, true );
    $file_destination = image_resize( $current_file, $imgw, $imgh, false );
    function reference here:
    But it seems this is the outdated part of the function. Further work necessary.

    there’s another function uner the comment
    //Since WP 3.5 image_resize is deprecated

    find this line:
    $image->resize( $imgw, $imgh, true );
    change to
    $image->resize( $imgw, $imgh, false );

    Now, since the third parameter, crop, is off by default, and because I have no need of cropping height, only width, I rewrote this to:
    $image->resize( $imgw );
    Simple. Keeping the $imgh and setting the max at 2,000 or so ensures no super-tall content, but the resizing conveniently chops off any excess white space.

    Hope this helps!

    Plugin Author nowmediagroup


    Hello bryanbrazil,

    I’m so sorry I didn’t get to answer your question. akirablaid’s solution should work, I decided to leave the image_resize function since 3.5 was still new but I’m going to stop supporting 3.4 when 3.6 is launched.

    Again sorry bryanbrazil I couldn’t get to your post, I didn’t know I needed to subscribe to my plugins feed to get my plugins support emails.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Don't crop, move upload dialog’ is closed to new replies.