Title: Dynamic width/height image sizes
Last modified: August 21, 2016

---

# Dynamic width/height image sizes

 *  Resolved [sndpl](https://wordpress.org/support/users/sndpl/)
 * (@sndpl)
 * [13 years ago](https://wordpress.org/support/topic/dynamic-widthheight/)
 * Hi,
 * the theme i use for my site uses 9999 for images that have a dynamic height and
   this plugin expects 0 for a dynamic height. So I made some small changes in the
   php code that it also supports 9999 (for width and height).
 * **save.php:**
    Changed line 84 to:
 *     ```
       if(!$_imageSize->crop || $_imageSize->width==0 || $_imageSize->height==0 || $_imageSize->width==9999 || $_imageSize->height==9999) {
       ```
   
 * **editor.php:**
    Added the next lines below the foreach on line 226:
 *     ```
       if ($value['height'] == 9999) {
                                       $value['height'] = 0;
                                   }
                                   if ($value['width'] == 9999) {
                                       $value['width'] = 0;
                                   }
       ```
   
 * I saw in the function reference of add_image_size that 9999 is also used as an
   example for unlimited height. So it would be nice if the next version of this
   plugin also supports it 🙂
 * Regards,
 * Sandy
 * [http://wordpress.org/extend/plugins/crop-thumbnails/](http://wordpress.org/extend/plugins/crop-thumbnails/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Volkmar Kantor](https://wordpress.org/support/users/volkmar-kantor/)
 * (@volkmar-kantor)
 * [13 years ago](https://wordpress.org/support/topic/dynamic-widthheight/#post-3768231)
 * Hi sndpl,
    thanks for that info – i had some problems supporting dynamic size
   images in the past, cause it is a feature i normaly not used when i develop a
   new site.
 * I will integrate that into the next version.

Viewing 1 replies (of 1 total)

The topic ‘Dynamic width/height image sizes’ is closed to new replies.

 * ![](https://ps.w.org/crop-thumbnails/assets/icon.svg?rev=1228698)
 * [Crop-Thumbnails](https://wordpress.org/plugins/crop-thumbnails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/crop-thumbnails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/crop-thumbnails/)
 * [Active Topics](https://wordpress.org/support/plugin/crop-thumbnails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/crop-thumbnails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/crop-thumbnails/reviews/)

## Tags

 * [height](https://wordpress.org/support/topic-tag/height/)
 * [image](https://wordpress.org/support/topic-tag/image/)
 * [width](https://wordpress.org/support/topic-tag/width/)

 * 1 reply
 * 2 participants
 * Last reply from: [Volkmar Kantor](https://wordpress.org/support/users/volkmar-kantor/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/dynamic-widthheight/#post-3768231)
 * Status: resolved