Reply
Resize batch script
Old 05-02-2005, 02:42 PM Resize batch script
Junior Talker

Posts: 1
PSP9 on WinXP

I am having trouble with a simple resize script. I want to batch process using a script that resizes files to a specific width, leaving the height to be calc'd via the aspect ratio. When I run the script via the Batch Process, the first file seems to process correctly, but then each subsequent file gets the same dimensions as the first file, distorting them.

When I run the batch in interactive mode (or switch the resize action to interactive) it works perfectly, but then I have to click "ok" for each file. This gets cumbersome when there's dozens of files to process per batch.

Here's the resize portion of the script. Can anyone tell me how to modify it to properly resize a file given just one dimension?

App.Do( Environment, 'Resize', {
'Width': 614,
'CurrentDimensionUnits': App.Constants.UnitsOfMeasure.Pixels,
'CurrentResolutionUnits': App.Constants.ResolutionUnits.PixelsPerCM,
'MaintainAspectRatio': True,
'Resample': True,
'ResampleType': App.Constants.ResampleType.PixelResize,
'ResizeAllLayers': True,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Interactive,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,0),1)
}
})

Thanks in advance
Jacob
jbehounek is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-04-2006, 11:04 AM Re: Resize batch script
Junior Talker

Posts: 1
Well I had to look around for this as there seems to be a few people with this problem but they dont post the solution, so here it is.

If you want to have a fixed width say 250px and you want the height and aspect ratio calculated automatically here is how you do it.

Code:
# Resize
    App.Do( Environment, 'Resize', {
            'AspectRatio': None, 
            'CurrentDimensionUnits': App.Constants.UnitsOfMeasure.Pixels, 
            'CurrentResolutionUnits': App.Constants.ResolutionUnits.PixelsPerIn, 
            'Height': None, 
            'MaintainAspectRatio': True, 
            'Resample': True, 
            'ResampleType': App.Constants.ResampleType.SmartSize, 
            'ResizeAllLayers': True, 
            'Resolution': 300, 
            'Width': 250, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match, 
                'Version': ((9,0,0),1)
                }
            })
There you go a very simple solution, the magic word is None. Hope it helps someone so they dont have to spend 2 hours crawling through trash to find the answer.

Last edited by DeadParrot : 05-04-2006 at 11:05 AM.
DeadParrot is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Resize batch script
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11605 seconds with 13 queries