Resize canvas by longest side to be square?

Older bugs which are supposed to be fixed in 0.84. *** Please try to reproduce your bug and confirm the bug fix. ***

Moderator: Dreamer

Post Reply
hexaae
Posts: 9
Joined: Tue Jun 16, 2020 3:12 pm

Resize canvas by longest side to be square?

Post by hexaae »

Is there a way to create a batch process under Actions where the canvas will be set to "square" based on the longest side (height or width) of the pic?
For example you have 2 pics: A (250x450), B (1600x450), and you want them to be "square" (A = 450x450, B = 1600x1600) resizing canvas by the longest side. Unfortunately 'Canvas resize' image option has no option to specify "width == height by the longest side" to generate square images with different size...

Or maybe there's another solution I didn't think of yet?
hexaae
Posts: 9
Joined: Tue Jun 16, 2020 3:12 pm

Re: Resize canvas by longest side to be square?

Post by hexaae »

That option would be extremely useful for www sites requiring many thumbnails of the same size, or with different square in size thumbs.
crazydaz
Posts: 11
Joined: Wed Nov 20, 2019 2:09 pm

Re: Resize canvas by longest side to be square?

Post by crazydaz »

You have to resize it first and then change the canvas size.

Resize Action has the feature to resize by the longest edge.

Image
hexaae
Posts: 9
Joined: Tue Jun 16, 2020 3:12 pm

Re: Resize canvas by longest side to be square?

Post by hexaae »

Thanks but this won't help: canvas resize MUST not be fixed, that's the problem. For a 250x450 picture for example I need a final result of 450x450, and for a picture 350x800 I need a final result of 800x800 and this should be done AUTOMATICALLY on a batch of thousands pictures with different size.
Canvas resize to the longest side would be extremely useful for product catalogs, since it won't crop the picture but just extend the shorter side to make it square, keeping the picture subject centered.
crazydaz
Posts: 11
Joined: Wed Nov 20, 2019 2:09 pm

Re: Resize canvas by longest side to be square?

Post by crazydaz »

Do you know any other app which can do that? You would need a script for that. Is it only 2 sizes you are after?

Netherveless, in this case, the quickest way would be to separate all images into 2 folders:
450px
800px

Then create preset for 450px, and another for 800px.

And then batch process all 250x450 etc.
And then batch process all 350x800 etc.

Done.
hexaae
Posts: 9
Joined: Tue Jun 16, 2020 3:12 pm

Re: Resize canvas by longest side to be square?

Post by hexaae »

Of course no. They may have any size...
crazydaz
Posts: 11
Joined: Wed Nov 20, 2019 2:09 pm

Re: Resize canvas by longest side to be square?

Post by crazydaz »

yeah, in that case, we need a new feature:

"Make it Square" action button would be awesome

Seems like, its been on Pierre's to-do list from 2014 :D So I wouldn't excpect it to come anytime soon either:
Resize to square canvas by longest side
Batch: Canvas resize to longest side

In the meantime, if you use Photoshop you can use this simple script to make any image square. Then just create a Droplet and just Batch it all through:

Code: Select all

app.preferences.rulerUnits = Units.PIXELS;

app.backgroundColor.rgb.hexValue = "FFFFFF"; // will keep expanded background white
app.foregroundColor.rgb.hexValue = "000000";

var doc = activeDocument
doc.resizeCanvas(Math.max(doc.width,doc.height),Math.max(doc.width,doc.height))
hexaae
Posts: 9
Joined: Tue Jun 16, 2020 3:12 pm

Re: Resize canvas by longest side to be square?

Post by hexaae »

Thank you crazydaz.
Hope to see this feature anytime soon since is quite useful for common WEB product catalogs. 'Resize Canvas by longer side' would be a great and unique feature.
User avatar
xnview
Author of XnView
Posts: 33836
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Resize canvas by longest side to be square?

Post by xnview »

See issue for current status and some details.
Pierre.
User avatar
xnview
Author of XnView
Posts: 33836
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Resize canvas by longest side to be square?

Post by xnview »

This problem is supposed to be fixed in XnView MP 0.96.5. Please check and confirm the bug fix here.
Pierre.
hexaae
Posts: 9
Joined: Tue Jun 16, 2020 3:12 pm

Re: Resize canvas by longest side to be square?

Post by hexaae »

Will be available also for XnConvert?
User avatar
xnview
Author of XnView
Posts: 33836
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Resize canvas by longest side to be square?

Post by xnview »

hexaae wrote: Mon Sep 28, 2020 8:40 am Will be available also for XnConvert?
yes i'll update it soon
Pierre.
hexaae
Posts: 9
Joined: Tue Jun 16, 2020 3:12 pm

Re: Resize canvas by longest side to be square?

Post by hexaae »

xnview wrote: Tue Aug 18, 2020 1:36 pm This problem is supposed to be fixed in XnView MP 0.96.5. Please check and confirm the bug fix here.
Exactly what I wanted: standard canvas custom x-y resize, or smart option by Longest/Shortest Side. Works fine in XnView. Waiting for same option in XnConvert now.
A big thank you!
Post Reply