• Resolved ecommonist

    (@ecommonist)


    Hi

    I am having a lot of warning messages:

    PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /vagrant/web/app/plugins/wp-smartcrop/wp-smartcrop.php on line 225

    “PHP message: PHP Warning: imagecreatetruecolor(): Invalid image dimensions in /vagrant/web/wp/wp-includes/media.php on line 2836

    PHP message: PHP Warning: imagecreatetruecolor(): Invalid image dimensions in /vagrant/web/wp/wp-includes/media.php on line 2836
    PHP message: PHP Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /vagrant/web/wp/wp-includes/class-wp-image-editor-gd.php on line 183″
    PHP message: PHP Warning: unlink(/vagrant/web/app/uploads/2018/03/161424620_cec300-696×459.jpg): No such file or directory in /vagrant/web/app/plugins/wp-smartcrop/wp-smartcrop.php on line 392
    PHP message: PHP Warning: imagecreatetruecolor(): Invalid image dimensions in /vagrant/web/wp/wp-includes/media.php on line 2836
    PHP message: PHP Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /vagrant/web/wp/wp-includes/class-wp-image-editor-gd.php on line 183”

    any help?

Viewing 7 replies - 1 through 7 (of 7 total)
  • wpsmartcrop

    (@wpsmartcrop)

    I think most of these can be traced to a typo on line 225 that ends up wrapping an entire conditional in count(), instead of just one term. The issue with unlink(), however, looks like it might be related to the configuration of your install… are you using s3 offload, or a similar plugin to host your image files in a non-standard location?

    I’m looking into that typo now.

    wpsmartcrop

    (@wpsmartcrop)

    I just pushed an update that should fix many of these warnings, however the unlink warning seems to be legitimate.

    Let me know if this helps

    Thread Starter ecommonist

    (@ecommonist)

    I’m using bedrock
    https://roots.io/bedrock/
    which uses app instead of wp-content. Is it possible to make it compatible? what should I notice from these unlink warnings? more or less everything seems to work

    Edit: no testing myself but a colleague is telling me last update not showing warnings anymore ??

    • This reply was modified 7 years ago by ecommonist.
    • This reply was modified 7 years ago by ecommonist.
    wpsmartcrop

    (@wpsmartcrop)

    Bedrock shouldn’t cause a problem. smartcrop can handle changes to the wp-content path.

    That unlink warning happens when smartcrop tries to regenerate one of the sized versions of an image, and the thumbnail it is replacing doesn’t exist. it doesn’t prevent the plugin from working, but it can be indicative that images aren’t being generated in the right spot. It can also just mean that a thumbnail size was added after that image was uploaded.

    In any event, it sounds like everything is working for you now, so I’m gonna mark this as resolved. Let me know if anything else pops up.

    Thread Starter ecommonist

    (@ecommonist)

    Hi!

    keeping receiving some warnings related to image dimensions.

    2018/03/05 10:11:31 [error] 1145#1145: *165 FastCGI sent in stderr: “PHP message: PHP Warning: imagecreatetruecolor(): Invalid image dimensions in /vagrant/web/wp/wp-includes/media.php on line 2836
    PHP message: PHP Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /vagrant/web/wp/wp-includes/class-wp-image-editor-gd.php on line 183” while reading response header from upstream

    wpsmartcrop

    (@wpsmartcrop)

    can you tell me what you are doing when this error is thrown? it sounds like a situation where a nonexistent image is accidentally sent to media.php, but not sure where that would happen in smartcrop.

    Thread Starter ecommonist

    (@ecommonist)

    I activate plugin. Upload a picture, enable smart crop and done. Not even moving focus point.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘php 7.2 compatibility’ is closed to new replies.