Resizing Photos

Corel Paint Shop Pro

Moderator: Kathy_9

Post Reply
NormanF
Posts: 5
Joined: Fri Feb 13, 2015 11:16 pm
operating_system: Windows 7 Home Premium
System_Drive: C
32bit or 64bit: 64 Bit

Resizing Photos

Post by NormanF »

Hi, I can resize photo using either the image resize or a batch process. The problem I'm having is that I have photos with different aspect ratios. When I batch process they all come out at 800 x 600 even when the script is made to set only the width. I want the width to be 800 but if the photo is not 4 x 3 (which most are) then their ratio is altered. Is there a way round this?
DPainter
Posts: 92
Joined: Mon Dec 10, 2012 2:04 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Gigabyte
processor: Intel i7-7700 3.6GHz Quad core 8
ram: 16GB
Video Card: nVidia GTX 1070
Hard_Drive_Capacity: 2T HDD
Monitor/Display Make & Model: 2 X SAMSUNG/s
Corel programs: Paintshop Pro 2019 Ultimate.

Re: Resizing Photos

Post by DPainter »

What version are you using?
Do you have "Aspect Ratio " unlocked.
This is under the "Advanced Settings" It just looks like a tick box but it adds some settings. (In case you didn't know) I think it's locked by default.

Not sure if this will help. Never done a batch resize.
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: Resizing Photos

Post by LeviFiction »

Inside the script, the aspect ratio is manually set.

So, edit the script and find the "AspectRatio" parameter. Then do some simple math by dividing the image width by the height. The variables for Width and Height are:

App.TargetDocument.Width
App.TargetDocument.Height

Here is an example. I'm multiplying Height by 1.0 because Python auto rounds all division to whole numbers if you don't.

Code: Select all

    # Resize
    App.Do( Environment, 'Resize', {
            'AspectRatio': App.TargetDocument.Width / (App.TargetDocument.Height * 1.0), 
            'CurrentDimensionUnits': App.Constants.UnitsOfMeasure.Percent, 
            'CurrentResolutionUnits': App.Constants.ResolutionUnits.PixelsPerCM, 
            'Width': 800, 
https://levifiction.wordpress.com/
NormanF
Posts: 5
Joined: Fri Feb 13, 2015 11:16 pm
operating_system: Windows 7 Home Premium
System_Drive: C
32bit or 64bit: 64 Bit

Re: Resizing Photos

Post by NormanF »

Not had the chance to try this out yet due to work but will look in to it soon.

Thanks for the help.
Post Reply