Re: Scaling large images w/ Akua Sweets
Re: Scaling large images w/ Akua Sweets
- Subject: Re: Scaling large images w/ Akua Sweets
- From: Landis <email@hidden>
- Date: Tue, 23 Oct 2001 09:12:39 -0700
Thanks for the great and rapid responses. I appreciate the help.
I've gotten three replies so far, and have tried all three methods
without success.
Chris Adams suggested:
> The trick is to save a "dummy" file name using the finder
that the image can then be "saved as."
I've tried things along the line of:
set FileL to (choose file name with prompt "Folder?")
tell "Finder"
--(run-time) Finder doesn't understand the "make" message
set tempFile to (make new document file in FileL)
end tell
or
set SaveFolder to (choose folder with prompt "Folder?")
set FileL to "NewDamnFile.pict"
tell "Finder"
--(run-time) Finder doesn't understand the "make" message
set tempFile to (make new folder in SaveFolder with
properties {name:FileL}) --as alias
end tell
I've tried to use duplicate (on the original image reference imgFile)
as well with the same type of run-time message.
Shane Stanley said:
That's not really necessary -- just use the form:
export movie 1 to file filePath...
which i tried with a compiler error (see below)
and Marc Myers helped with:
I think your problem is that you've got the wrong kind of file reference
in your "store image" statement. Try changing
set FileL to (choose file name with prompt "Save resized PICT as")
to
set FileL to (choose file name with prompt "Save resized PICT as")
as text
which i tried with seemingly the same results w/o "as text" or "as string"
and you should change
store image (scale image thePict to {WidthL, HeightL}) in FileL as "PICT"
to
store image ImageL in FileL as "PICT"
since you already scaled it two statements back and stored the
result in "ImageL"
This was a mistake I left in from trying to resolve the error I kept
getting telling me that "ImageL is not defined". (see below)
This is what I've got now, with parts that don't seem to be working
commented out with the reason above it:
BEGIN SCRIPT
set imgFile to (choose file with prompt "Choose any PICT file")
-- use "Akua Sweets"
-- check that Quicktime's image importer can read it
if (the image type in imgFile) is "PICT" then
-- get Mac 'pict' object from image file
set thePict to the image from imgFile with proxy return
-- get picture information
set picInfo to the picture info for thePict
-- get picture
set picBounds to picture bounds of picInfo -- {left, top,
right, bottom}
-- get width and height...
set WidthO to (item 3 of picBounds as string)
set HeightO to (item 4 of picBounds as string)
--calculate L, M, & S series sizes that will work
set HeightL to ((round (HeightO / 196)) * 196)
set WidthL to ((round (WidthO / 4)) * 4)
--scale image and save
set ImageL to (scale image thePict to {WidthL, HeightL})
--tried "as text" and "as string" and blank w/ no noticeable change
set FileL to (choose file name with prompt "Where to Store?") --as text
--(run-time) the variable "ImageL" is not defined
store image ImageL in FileL as "PICT"
--(compiler) expected end of line but found "to"
--export ImageL to file FileL
dispose proxy data thePict
end if
END SCRIPT
Interesting thing is that this one works with smaller image sizes if
I take out the "with proxy return", but then it won't work on larger
file sizes. Maybe I'm not using the proxy right. Anyone know what
I'm doing wrong? Again, thanks so much for the suggestions and help.
Landis