Re: Scaling large images w/ Akua Sweets
Re: Scaling large images w/ Akua Sweets
- Subject: Re: Scaling large images w/ Akua Sweets
- From: Michelle Steiner <email@hidden>
- Date: Tue, 23 Oct 2001 08:35:06 -0700
On 10/22/01 10:55 PM, Chris Adams <email@hidden> wrote:
>
Here is a technique that uses Quicktime and applescript to scale (in pixels)
>
and save images.
Here's a script that scales horizontal pictures to 640 wide, and vertical
pictures to 480 tall (exept if the photo is smaller than 640 by 480),
using GraphicConvertor; it processes a folder full of pictures at a time.
Almost all digital cameras use a 4 to 3 ratio for image dimensions.
set the folderToProcess to choose folder
tell application "Finder"
set the photoList to (the files of the folderToProcess)
end tell
repeat with photo in the photoList
tell application "GraphicConverter"
open the photo as alias
set the imageDims to the image dimension of window 1
set scaleFactor to my setScaleFactor(imageDims)
scale window 1 horizontal scaleFactor vertical scaleFactor
save window 1 as JPEG with wwwready without makeCopy
close window 1
end tell
end repeat
on setScaleFactor(imageDims)
set the scaleFactor to 1
set the horiz to item 1 of the imageDims
set the vert to item 2 of the imageDims
if the horiz is greater than the vert then
if the horiz is greater than 640 then set the scaleFactor to 640 / horiz
else
if the vert is greater than 480 then set the scaleFactor to 480 / vert
end if
return the scaleFactor
end setScaleFactor
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------