This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > PainShop Pro 9 > June 2007 > Resize batch process





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Resize batch process
Mike Scholl

2007-06-16, 6:17 am


I have put a load of picture on my website using small images and links to
the larger versions. The PSP script & batch process works OK and makes this
very quick and simple. However - I had cropped some of the pics beforehand
so they are now all different sizes. I would like to make a script that
resizes them to a fixed width but maintains the aspect ratio. I changed the
script as shown below but it produces a distorted image. Can I not do this?

Mike

# Resize
App.Do( Environment, 'Resize', {
'CurrentDimensionUnits': App.Constants.UnitsOfMeasure.Pixels,
'CurrentResolutionUnits':
App.Constants.ResolutionUnits.PixelsPerIn,
'MaintainAspectRatio': True,
'Resample': True,
'ResampleType': App.Constants.ResampleType.PixelResize,
'ResizeAllLayers': True,
'Resolution': 72,
'Width': 150,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})



Trev

2007-06-16, 6:21 pm



"Mike Scholl" <MikeScholl@btinternet.com> wrote in message
news:46723cf3$1_2@cnews...
>
> I have put a load of picture on my website using small images and links to
> the larger versions. The PSP script & batch process works OK and makes
> this very quick and simple. However - I had cropped some of the pics
> beforehand so they are now all different sizes. I would like to make a
> script that resizes them to a fixed width but maintains the aspect ratio.
> I changed the script as shown below but it produces a distorted image. Can
> I not do this?
>
> Mike
>
> # Resize
> App.Do( Environment, 'Resize', {
> 'CurrentDimensionUnits': App.Constants.UnitsOfMeasure.Pixels,
> 'CurrentResolutionUnits':
> App.Constants.ResolutionUnits.PixelsPerIn,
> 'MaintainAspectRatio': True,
> 'Resample': True,
> 'ResampleType': App.Constants.ResampleType.PixelResize,
> 'ResizeAllLayers': True,
> 'Resolution': 72,
> 'Width': 150,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
>


Look at the scripts that came with PSP 9. Do you see one called Thumbnail
100 Open it with notepad and read how to modify to your needs.



SuzShook

2007-06-16, 6:21 pm


Try this code, Mike - the key is using None for the variable dimension:
# Resize
App.Do( Environment, 'Resize', {
'CurrentDimensionUnits': App.Constants.UnitsOfMeasure.Pixels,
'CurrentResolutionUnits':
App.Constants.ResolutionUnits.PixelsPerIn,
'Height': None,
'MaintainAspectRatio': True,
'Resample': True,
'ResampleType': App.Constants.ResampleType.SmartSize,
'ResizeAllLayers': True,
'Resolution': 72,
'Width': 150,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})
Hope this helps, Mike. Suz

Mike Scholl wrote:
> I have put a load of picture on my website using small images and
> links to the larger versions. The PSP script & batch process works OK
> and makes this very quick and simple. However - I had cropped some of
> the pics beforehand so they are now all different sizes. I would like
> to make a script that resizes them to a fixed width but maintains the
> aspect ratio. I changed the script as shown below but it produces a
> distorted image. Can I not do this?
> Mike
>
> # Resize
> App.Do( Environment, 'Resize', {
> 'CurrentDimensionUnits':
> App.Constants.UnitsOfMeasure.Pixels,
> 'CurrentResolutionUnits': App.Constants.ResolutionUnits.PixelsPerIn,
> 'MaintainAspectRatio': True,
> 'Resample': True,
> 'ResampleType': App.Constants.ResampleType.PixelResize,
> 'ResizeAllLayers': True,
> 'Resolution': 72,
> 'Width': 150,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })




Spandex Rutabaga

2007-06-16, 6:21 pm


Mike Scholl wrote:
>
> I have put a load of picture on my website using small images and links to
> the larger versions. The PSP script & batch process works OK and makes this
> very quick and simple. However - I had cropped some of the pics beforehand
> so they are now all different sizes. I would like to make a script that
> resizes them to a fixed width but maintains the aspect ratio. I changed the
> script as shown below but it produces a distorted image. Can I not do this?


Sure you can but you need to specify the Height as None. Also
I would stay away from Pixel Resize as the resampling method.
Normally, Smart Size gives a higher quality image. (If you are
making images smaller a little sharpening before you save the
small version may improve it.) You may find it simpler to just
use this script for the resizing:
http://pixelnook.home.comcast.net/ResizeToLimit.htm
The script will allow you to set a maximum dimension that is
not exceeded by either the width or height so the orientation
(portrait vs landscape) of the image or the aspect ratio doesn't
affect your results.

Mike Scholl

2007-06-16, 6:21 pm


Thanks guys - I knew someone had the answer

Mike



JoeB

2007-06-16, 10:17 pm


"Mike Scholl" <MikeScholl@btinternet.com> wrote in news:4673088f$1_3@cnews:

>
> Thanks guys - I knew someone had the answer
>
> Mike


I actually didn't see an answer from someone, but am curious which of the
answers from others that I did see solved your problem :-)

Regards,

JoeB

SuzShook

2007-06-17, 6:18 pm


The key to making this work, JoeB, is using None for the dimension that is
not being set. If you want a fixed width, as in Mike's case, you have to
set the Height to None to get it to work:

# Resize
App.Do( Environment, 'Resize', {
'CurrentDimensionUnits': App.Constants.UnitsOfMeasure.Pixels,
'CurrentResolutionUnits':
App.Constants.ResolutionUnits.PixelsPerIn,
'Height': None,
'MaintainAspectRatio': True,
'Resample': True,
'ResampleType': App.Constants.ResampleType.SmartSize,
'ResizeAllLayers': True,
'Resolution': 72,
'Width': 150,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})

Suz

JoeB wrote:
> "Mike Scholl" <MikeScholl@btinternet.com> wrote in
> news:4673088f$1_3@cnews:
>
>
> I actually didn't see an answer from someone, but am curious which of
> the answers from others that I did see solved your problem :-)
>
> Regards,
>
> JoeB




Mike Scholl

2007-06-20, 3:17 am


Joe

They all did.

As Suz said the key is to set Height or Width to None. (i'd tried setting
just height and just width) That is what she did in her script and it is
what is in the ResizeToLimit script. The Thumbnail150 script suggested by
Trev is a little different as it works out the new height and width based on
the maximum and the original height/width aspect ratio.

If you try it you may need to discover that the scripting language is case
sensitive - so it doesn't recognise none only None

Mike



JoeB

2007-06-21, 6:33 pm


"Mike Scholl" <MikeScholl@btinternet.com> wrote in
news:467777be$1_3@cnews:

>
> Joe
>
> They all did.
>
> As Suz said the key is to set Height or Width to None. (i'd tried
> setting just height and just width) That is what she did in her script
> and it is what is in the ResizeToLimit script. The Thumbnail150 script
> suggested by Trev is a little different as it works out the new height
> and width based on the maximum and the original height/width aspect
> ratio.
>
> If you try it you may need to discover that the scripting language is
> case sensitive - so it doesn't recognise none only None
>
> Mike


Actually, I was being somewhat facetious, but my sense of humor has often
been considered kind of warped :-)

I think, in the ResizeToLimit script, you can set the height or width to 0
(zero) to prevent limiting that dimension, although None might work as well
in that script - I haven't tried it.

Regards,

JoeB

Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews