add_image_size crop feature (4 posts)

  1. rpophessagr
    Posted 6 years ago #

    Hi I'm trying to incorporate the custom thumbnail sizes into my theme but I can't seem to get the crop feature to work.

    Am I doing this wrong?

    add_image_size( 'featured', 200, 225, true );

    I thought that the 'true' at the end is supposed to tell the function to crop the image and it's not.

    Thanks in advance!

  2. Alex Mansfield
    Posted 6 years ago #

    I'm pretty sure the WordPress cropping feature requires the php-gd library to be installed on the server. I had the same problem locally, but after installing the php-gd library the problem disappeared.

    Please note: This will not crop images that were uploaded before php-gd was installed. You will need to either manually upload the images again, or use the Regenerate Thumbnails plugin.

  3. Ventureweb
    Posted 5 years ago #

    What version of WP are you using rpophessagr? I found that anything within 3.0+ doesn't crop using the add_image_size( 'featured', 200, 225, true ); statement. It's almost as if it is being called to late??

    Instead you can head to the Settings>Media area and adjust the thumbnail dimensions within there. Then upload an image to your post and you will see your specified dimension on the 'thumbnail' radio button.

    Good luck. I wish someone had posted this when I was trying to work it out. But now I am attempting to help others. Hope this works for you.

  4. baia
    Posted 5 years ago #

    Even relying only on Settings > Media I can't obtain what I want (images cropped to a fixed dimension). I've been stuck for two days and I'm starting to suspect the existence of a bug.

Topic Closed

This topic has been closed to new replies.

About this Topic