Support » Fixing WordPress » add_image_size – hard crop doesn't work

  • Resolved WorldWideWebb


    I know others have posted about this, but the hard crop in add_image_size still doesn’t appear to work. It appears that the image is being resized before it’s cropped (which doesn’t say “hard-crop” to me). I have confirmed that GD is installed on the server, that thumbnails have been enabled for my theme (and under the appropriate hook), plus the fact that I’m uploading images and all of the thumbnail sizes are being generated.

    Does anyone have a workaround for this (especially one that doesn’t involve modifying the core)?


Viewing 1 replies (of 1 total)
  • Found a solution!

    I did some more searching and came across this great snippet:

    Image Crop Position in WordPress

    I then modified the bt_image_resize_dimensions function so that it will either always use WordPress’s version of “hard-crop” (meaning it will resize the image down first, then crop the remaining), or it will actually hard-crop the image (meaning it will crop down, to the specified dimensions, using the full-size image). The new function in its entirety can be found here:

Viewing 1 replies (of 1 total)
  • The topic ‘add_image_size – hard crop doesn't work’ is closed to new replies.