Requires Mac OS X 10.5 or higher
HAMSoft Engineering allows free use of this code and/or software in its "as is" condition. HAMSoft Engineering disclaims any liability of any kind for any damages whatsoever resulting from the use of this code and/or software. If you find it useful please consider making a donation to help HAMSoft Engineering stay in business.
download the compiled command line tool
download the source code project
download the version history
Use this command line tool to get either the regular file icon or the preview image as seen in QuickLook for a file in jpg, png, or tif format. This project uses some techniques derived from code written by Matt Gemmel. Matt's code called NSImage+QuickLook is at http://mattgemmell.com/source.
Version 0.2 has several upgrades from the 0.1 version. Thanks for these upgrades goes to Colorhythm, makers of the Prismpoint™ System. Colorythm will be using these upgrades in a future product.
qlpreview -imageType jpg/png/tif -JPEGimageQuality theQuality -maxWidth imageWidth -maxHeight imageHeight -asIcon yes/no -inPath /path/to/file -outPath /path/to/file -preferFileIcon yes/no -generatePreviewOnly yes/no
The input variables explained:
[-imageType "jpg, png, or tif"] the output image format either jpg, png, or tif
[-JPEGimageQuality "0 through 100"] only applicable when the "imageType" is jpg. Defines the amount of compression used. Must be a value between 0 and 100, 0-max compression and 100-no compression.
[-maxWidth "width in pixels"] the maximum width of the output image
[-maxHeight "width in pixels"] the maximum height of the output image
[-asIcon "yes or no"] when yes the output image is rendered as an icon with a border, shadow, page curl etc.
[-inPath "path"] the path to the file that you want the image
[-outPath "path"] a path for the saved image
[-preferFileIcon "yes or no"] when yes only the file icon is returned even if a preview image exists
[-generatePreviewOnly "yes or no"] when yes only the quicklook preview image is returned. If the preview can't be found then nothing is returned.
Example usage of the tool with applescript:
Open this Script in your Editor