Jump to content
John Rostron

Resize portrait or landscape image to max side of fixed length

Recommended Posts

The problem is to devise a formula for use in a macro or batch to re-size an image so that the longest side is a fixed length. So if the target size  was (say) 800px, a 300×600 image would become 400×800px and a 2000×500px imge would become 800×200px.

 

Firstly, ensure that you have an unlocked pixel layer. Select the move tool. In the Transform panel, ensure that the width and height are linked.

Set Width as min(800, 800×w/h)

Given that the layers are linked, this will automatically set the height.

Now select Document > Clip Canvas. This removes the tranparent background.

One curious outcome is that for a 3000×4000 portrait image, after a successful transform/clip, The Transform panel gives the dimensions as width: 800:px by height:600px. The Document Resize gives it (correctly) as width:600px by height:800px.


Windows 10, Affinity Photo 1.6.5.123 and Designer 1.6.5.123, (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×