Resize Image on Mac OS
I wanted to share the code I put together to Resize Images on OS X in case someone could use it. This what led to the whole discussion about zipping files. I needed to transfer data and pictures via FTP in a zip file. The pictures need to be quite small and the originals are large.
This snippet will make a copy of the file into the Transfer Folder then resize it with a max height or width of the specified size (pvMax).
; Move Oringinal File to DataTransfer folder.
Do FileOps.$copyfile(pvOrigPath,lvNewPath) Returns lvError
If lvError=0
; Use SIPS to resize image
Do FileOps.$converthfspathtoposixpath(lvNewPath,lvNewPath)
Calculate lvCommand as con(‘do shell script ‘,kDq,’sips -Z ‘,pvMax,’ ‘,kSq,lvNewPath,kSq,kDq)
Do $runapplescript(lvCommand,lvResponse) Returns lvError
If lvError=0
Quit method lvNewPath
End If
End If
*********************************************************************
Michael Mantkowski
ClienTrax Software
1-614-875-2245
*********************************************************************
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com