• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Image Resolution
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Image Resolution


  • Subject: Image Resolution
  • From: Leonide Principe <email@hidden>
  • Date: Fri, 1 May 2009 13:00:05 -0400

Hi all,
several months ago I subscribed this list and started my AppleScript journey. I expanded a lot my computing power and the way that my FileMaker Digital Assets Management interact with other applications.
Good, now I can import the most important image formats, including embedded Metadata, create four Versions from images (MasterFile, DisplayImage, WebImage and Thumbnail), then, the best of all I can create Custom Version with several option: Size, Format, Compression level, Profile.
Custom Versions are generated from FileMaker, from a Collection of Images, using the Internal MasterFile created on importing...
... everything works as expected... but I cannot find the solution for  one important detail: the Image Resolution.
Based on the Image Events Dictionary I added this line but don't works:

-- set the resolution of theNewFile to {72.0, 72.0}

It seems that resolution is a property used to reed resolution not to modify... but I believe much more that I am not writing the correct code.

Thanks for helping, Leo

Below, the Conversion Handler of the importing script (I hope to be useful for some beginner like me)


on runConversion(theMasterFile)
tell application "Finder"
set theType to file type of theMasterFile
set saveExt to extension hidden of theMasterFile
set extension hidden of theMasterFile to true
set theFolder to (container of theMasterFile) as text
set theFilename to displayed name of theMasterFile
set extension hidden of theMasterFile to saveExt
end tell
tell application "Image Events"
launch
set imageFile to (open theMasterFile)
-- create the Hires Image
set theHiresImage to save imageFile as JPEG ¬
with compression level high in (theHiresFolder as text) & (theFilename) & ".jpg"
set theHiresImage to theHiresImage as alias
-- create the Preview Image
set saveFolder to thePreviewFolder
set newHeight to 1024
set newWidth to 1024
set theSize to dimensions of imageFile
set width to item 1 of theSize
set height to item 2 of theSize
if height > width then
scale imageFile to size newHeight
else
scale imageFile to size newWidth
end if
set thePreviewImage to save imageFile as JPEG ¬
with compression level high in ¬
(thePreviewFolder as text) & (theFilename) & ".jpg"
set thePreviewImage to thePreviewImage as alias
-- create the Web500px image
set saveFolder to theWebFolder
set newHeight to 500
set newWidth to 500
set theSize to dimensions of imageFile
set width to item 1 of theSize
set height to item 2 of theSize
if height > width then
scale imageFile to size newHeight
else
scale imageFile to size newWidth
end if
set theWebImage to save imageFile as JPEG ¬
with compression level high in ¬
(theWebFolder as text) & (theFilename) & ".jpg"
set theWebImage to theWebImage as alias
-- create Thumbnail
set saveFolder to theThumbFolder
set newHeight to 210
set newWidth to 210
set theSize to dimensions of imageFile
set width to item 1 of theSize
set height to item 2 of theSize
if height > width then
scale imageFile to size newHeight
else
scale imageFile to size newWidth
end if
set theThumbImage to save imageFile as ¬
JPEG with compression level high ¬
in (theThumbFolder as text) & (theFilename) & ".jpg"
set theThumbImage to theThumbImage as alias
close imageFile
end tell
tell application "ColorSyncScripting"
embed theHiresImage with source profile "Adobe RGB (1998)" matching with perceptual intent
set quality of first profile in theHiresImage to best
embed thePreviewImage with source profile "sRGB IEC61966-2.1" matching with perceptual intent
set quality of first profile in thePreviewImage to best
embed theWebImage with source profile "sRGB IEC61966-2.1" matching with perceptual intent
set quality of first profile in theWebImage to best
embed theThumbImage with source profile "sRGB IEC61966-2.1" matching with perceptual intent
set quality of first profile in theThumbImage to best
end tell
end runConversion






Leonide Principe

Amazon Stock Photography
Welcome Page: http://www.leonideprincipe.com
Archive: http://www.photoshelter.com/c/principe/

PhotoKey Solution
Keywording, Tracking and Selling RM Photographs
http://www.leonideprincipe.com/photokey/
Community Forum
http://www.leonideprincipe.com/forum/









 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Image Resolution
      • From: Tim Mansour <email@hidden>
    • Re: Image Resolution
      • From: Roger Howard <email@hidden>
    • Re: Image Resolution
      • From: Yvan KOENIG <email@hidden>
  • Next by Date: Re: Styled text and non-Gregorian dates
  • Next by thread: Re: Image Resolution
  • Index(es):
    • Date
    • Thread