Support » Fixing WordPress » Uploaded image ratios

  • Hi all,

    Does anyone know a way that I can fix the image width or height regardless of whether the image is portrait or landscape?

    As I understand it, is an image size is set to 200×200 and I upload an image that’s 1000×600 it will be resized to 200×120 but a 600×1000 image would be resized to 120×200. I’d like both of these images to have a width of 200 – there’s also another project where I’d want the heights to match.

    Looking in the code, the ratio is determined as the image is uploaded, I can’t see an easy way to override it. Any help would be much appreciated.



Viewing 4 replies - 1 through 4 (of 4 total)
  • Probably a fancier way than I do – but I calculate the original ratio for the picture then set the width, in your case 200 then multiply or divide (depending on what I did when I calculated the ratio (long time since engineering school so I sometimes reverse the numbers)) by the ratio to get the height – then I set the height in the advanced section of working with an image – yes it is real clunky but I only do a few pictures so it is not too bad for me.

    There is probably a plug-in of some sort to do the work for you, but I have never looked for one. One of the Photo people might have some better advice.

    Good luck

    Thread Starter Paul Bunkham



    Thanks for getting back to me. I suppose I’m looking for an automatic version of your solution, although does that generate a resampled image or does it just change the properties in the image tag that’s output?

    The problem is that I can’t see where I can control the image resizing, as I can’t see any hooks in the code when the image size is being calculated. Writing some code to change the dimensions in the advanced settings could work. I’ll do some investigating.

    Thanks again.

    Seems to just change the display of the image, no change to the image other than scale or ratio as displayed.

    Thread Starter Paul Bunkham


    That’s a shame, I was hoping to control the ratio of the images generated as they’re uploaded. I’m sure I must be missing something…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Uploaded image ratios’ is closed to new replies.