Under Media Settings I edited the Image Sizes to the following:
-
Thumbnail size: 170×80
-
Medium size: 550×170
-
Large size: 550×320
-
(“Crop thumbnails to exact dimensions” is checked)
-
Maximum embed size: Width 1000, Height 1000
My problem is when I upload an image it ignores these dimensions. For example, when I upload a 550×320 image, and then try to add it to a post, it has been cropped to the following sizes (uploads folder shows the same):
-
Thumbnail size: 137×80
-
Medium size: 292×170
-
Large size: (unavailable)
-
Original size: 550×320
How can I get these image sizes working correctly?
The issue is that WordPress always maintains the aspect ratio on your photos. For a lot of uses, this makes sense. However, if you’re trying to line up a bunch of images â some in portrait, others in landscape â it can be a real pain.
If you want to fix this, you can register a new image size in your
functions.php
file in your theme. For example, I just added:The function is defined as follows in /wp-includes/media.php:
You can then ask for the image by using:
inside of your theme… but this only works for the featured image. Sadly, the image size option isn’t added to the selection box when adding media through the backend.
Also, if this does what you’re looking for, you can auto-resize any old images you have to the new size by using this plugin: http://wordpress.org/extend/plugins/regenerate-thumbnails/