• I’ve just installed and it’s throwing thousands errors to the logs:

    Warning: Trying to access array offset on value of type null in?/wp-content/plugins/thumbnails/plugin.php on line 177

    The plugin seems to have a problem with sizes of type 768×0 because it tries to crop the image instead of resizing to 768 width and AUTO height for that width.

    Can this problem be solved in next release?

    Thanks and kind regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter fidoboy

    (@fidoboy)

    If one of the two dimensions is zero, then the plugin needs to calculate the missing one automatically. Right now it fails to generate the right image.

    Sizes like this 1024×0 in some WordPress themes wants to mean “auto height”. So the width is given but the height is calculated without cropping the image.

    Thread Starter fidoboy

    (@fidoboy)

    This is fixed with following code:

    // if width or height is zero then it's auto calculated, so crop should be false
    if ($width == 0) $width = null;
    if ($height == 0) $height = null;
    if (is_null($width) || is_null($height)) $crop = false;

    into the resize function.

    There is also another big problem that this plugin should solve: responsive images when creating the srcset attributes for images. If the thumbnail is being created on the fly, then also the WordPress function for adding srcset attribute should be shortcircuited to keep it working as expected.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Warnings on logs’ is closed to new replies.