WordPress.org

Ready to get started?Download WordPress

Forums

Crop-Thumbnails
[resolved] Dynamic width/height image sizes (2 posts)

  1. sndpl
    Member
    Posted 11 months ago #

    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/

  2. Volkmar Kantor
    Member
    Plugin Author

    Posted 11 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic