Title: ithackston's Replies | WordPress.org

---

# ithackston

  [  ](https://wordpress.org/support/users/ithackston/)

 *   [Profile](https://wordpress.org/support/users/ithackston/)
 *   [Topics Started](https://wordpress.org/support/users/ithackston/topics/)
 *   [Replies Created](https://wordpress.org/support/users/ithackston/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/ithackston/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/ithackston/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/ithackston/engagements/)
 *   [Favorites](https://wordpress.org/support/users/ithackston/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Plugin: Image Widget] Image url breaks if size = Full Size (WordPress 3.0 RC1)](https://wordpress.org/support/topic/plugin-image-widget-image-url-breaks-if-size-full-size-wordpress-30-rc1/)
 *  [ithackston](https://wordpress.org/support/users/ithackston/)
 * (@ithackston)
 * [15 years, 12 months ago](https://wordpress.org/support/topic/plugin-image-widget-image-url-breaks-if-size-full-size-wordpress-30-rc1/#post-1526527)
 * Selecting “Full Size” passes in the dimensions of the full size image to image_resize_dimensions(),
   which returns false since we don’t need to resize the image. When image_resize_dimensions()
   returns false, image_resize() returns an error object.
    [http://core.trac.wordpress.org/ticket/12268](http://core.trac.wordpress.org/ticket/12268)
 * So the following if statement does not do what it should:
    `if ($image = image_resize(
   $imgpath, $width, $height ))`
 * To make it work, we test if the original dimensions are the same as the destination
   dimensions before passing them in to image_resize().
 * Change lines 76-80 of image-widget.php from:
 *     ```
       if ($image = image_resize( $imgpath, $width, $height )) {
       	$image = path_join( dirname($attachment_url), basename($image) );
       } else {
       	$image = $attachment_url;
       }
       ```
   
 * To:
 *     ```
       //Get original image size
       $size = @getimagesize( $imgpath );
       list($orig_w, $orig_h, $orig_type) = $size;
       $image = image_resize( $imgpath, $width, $height );
   
       if ( ($orig_w == $width && $orig_h == $height) || !$image) {
       	$image = $attachment_url; //No resizing necessary.
       } else {
       	$image = path_join( dirname($attachment_url), basename($image) );
       }
       ```
   
 * You will need to hit “Save” on each active widget to make the image appear.

Viewing 1 replies (of 1 total)