Re: (no subject)
Re: (no subject)
- Subject: Re: (no subject)
- From: Travis N <email@hidden>
- Date: Thu, 23 Jan 2003 02:13:14 -0600
Hi Joe,
The problem you are having is that the scale function of Image capture
expects you to scale to a given width, not height. So what your code
is doing to the portrait image is making their width equal to 1024,
which will cause the image to be too tall for the screen (in most
cases). All you need to do is add in these lines:
rotate current_image to angle 90
scale the current_image to size target_height
rotate current_image to 0
The angle measurements are in absolute degrees. Rotating the image so
its height is temporarily its width and then setting that to 1024 and
then re-rotating it is the only way I see to go with the events for
Image Capture.
-Travis N
On Sunday, January 19, 2003, at 09:00 PM, Joe Ragosta wrote:
>
I have a folder full of jpg files that I've scanned of my kids.
>
They're in different sizes and shapes, but I'd like them all scaled to
>
the size of my desktop (currently 1280x1024). The following script
>
seems to work OK for landscape pictures, but crops those in portrait
>
layout.
>
>
<snip>
>
-----------------------------------------------------------------------
>
---------------------------------
>
property target_width : 1280
>
property target_height : 1024
>
>
on open input_files
>
set target_folder to choose folder with prompt "Pick a folder in
>
which to save images:"
>
tell application "Image Capture Scripting"
>
repeat with current_image in input_files
>
tell application "Finder" to set file_name to (name of item
>
current_image)
>
set current_image to open current_image
>
>
if the height of the current_image is greater than or equal
>
to width of the current_image then
>
scale the current_image to size target_height
>
else
>
scale the current_image to size target_width
>
end if
>
>
save current_image in file ((target_folder & file_name) as
>
text)
>
close current_image
>
end repeat
>
end tell
>
end open
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
References: | |
| >(no subject) (From: Joe Ragosta <email@hidden>) |