Archived topic
Featured Images: Crop to fixed height?
15 replies · Started by Paul on February 21, 2016
Hey Tom.
I have the latest theme and addons plugin, but I am struggling to have the featured image on my posts "cropped" to a fixed height with auto width.
i.e. I have an image that's 1600x1200, but I want to "crop" all featured images to 1200 x 300 (middle aligned)
I assumed I could set the featured image, and then use the header image settings to fix either the height (400px) and set the "hard crop".
But any combination of these values does not give the desired result.
What am I doing wrong, Tom?
I think (not 100% sure) this is something I have worked on with Tom.
If you put one of the measurements into the 'Image Height'and 9999 or 0 into Image Width and enable hard crop it will size it and the the width will be proportional to the height.
It fails if you put a measurement in width and 0 in height.
I'm sure Tom knows about this.
Thanks Tony.
I've tried various combinations of 0, auto and 9999, and nothing has the desired effect. It's either the case that I am not quite getting the combinations right, or it is not possible to do what I am wanting to.
For example, I just tried:
Hard Crop
Image Width: 1200px
Image Height: 300px
... and all that happens is the image height is 300px and the width sized proportionately to 400px. i.e. the image is not "cropped" to 300px height (middle align vertical) at 1200px wide.
Ah - I see, you are not wanting to crop it proportionally so it won't do what you want using my method.
Over to Tom.
In order to use the sizing options in the Page Header metabox you need to upload your image through it as well - the sizing won't work if you uploaded the image through the "Featured Image" metabox.
Let me know if that works or not :)
Hey Tom.
I am on 1.2.79 of the GP Premium add-on.
I removed the featured image and added it through the Page Header metabox.
I set the hard crop to "enabled".
I set the height to 300px.
I set width to 1200px, 9999px etc.
Bottom line, when I set the height to 300px, the width is always proportionately fixed to 400px.
E.g. http://visceralshift.com/index.php/2016/01/18/so-much-going-on-right-now/
Can you shoot me an email to support@generatepress.com so I can send you the latest beta version?
I can Tom.
Am I at least expecting the right outcome with what I was trying? :)
Yea that should work perfectly (just did it myself) :)
So what am I doing wrong?? Should be a clean install on that domain... am I missing something?
I made some changes to the cropping in this beta version so lets see if it's that first.
If not, I'm going to guess there's a plugin interfering.
Ok, my friend. Will try this later today!
Hi Paul,
This was the Photon module in the Jetpack plugin.
I deactivated it and it's all working as it should now.
Well I'll be damned; the joys of multi-function plugins.
Thanks for the help, Tom ... appreciate it!
