• Resolved Rob Record

    (@robrecord)


    Hi,

    I’m also experiencing issues with the plugin.

    I disabled all plugins and tested with Twenty Nineteen.

    What I found was that it appears to be failing because the images don’t have a ‘size-‘ class. My images, when they come through in a post, literally only have one class: for example ‘wp-image-7314’.

    I have traced this through to the function ‘get_id_and_size_from_tag’ where the size given is false as a result of not having the required class, and thus the image is not processed by the the_content filter.

    For me, this appears to be happening because of the gutenburg editor which seems to prefer that you resize images manually… and doesn’t give size classes as a result.

    Additionally, post thumbnails aren’t being processed (even though they have the ‘size’ class) and unless there’s something I haven’t yet understood from your code, these images aren’t captured by the the_content filter and so are not being processed at all.

    Hope that gives you something to work from.

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

    (@robrecord)

    Hi to the plugin author – I’ve found your bug reports from more than a year ago on how gutenburg breaks the img tag classes. I can see now that it’s been a frustrating ride.

    I also updated my wordpress to 5.3.2 and found that some images were working correctly.

    I then realised the remaining non-working ones were cropped. I have rectified this by replacing with standard wordpress image sizes and am now able to see the smart cropping working.

    Maybe this can help someone else.

    May I ask, why are we not allowed to use custom image sizes created by the “add_image_size” function?

    Thank you for an excellent plugin.

    • This reply was modified 4 years, 10 months ago by Rob Record.

    I had just added this to a project and my frontend developer indicated it wasn’t working. I think now I see why.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘SmartCrop not working – troubleshooting help’ is closed to new replies.