Resize Image on Mac OS
Here is the sample code for doing a resize under Windows with Irfanview. I use the while loop to detect when the new file is created. It is usually pretty much instantaneous but helpful if you are running another operation on the file after you create it.
; Use Irfanview to Resize and Copy image to TransferPictures folder.
; pvMax = Max pixel value of any side of the image
Calculate lvParam1 as con(kDq,pvOrigPath,kDq,’ /resize_long=’,pvMax,’ /aspectratio /resample /jpgq=100 /convert=’,kDq,lvNewPath,kDq)
Call DLL (“Shell32.dll”,con(‘ShellExecute’,pick(inU,’A’,’W’)),0,”#NULL#”,inIrfanViewPath,lvParam1,”#NULL#”,1) Returns lvError
While lvLoop1<20
Calculate lvLoop1 as lvLoop1+1
Calculate lvLoop2 as #CT+20
While #CT
Subject: RE: Resize Image on Mac OS
Hi Mike,
I use IrfanView for this on Windows. Huge set up graphics abilities that can be done via GUI or invisibly via a large command line interface.
I will put up some code samples in the next day or so. I would do it no but need to run to an appointment.
*********************************************************************
Michael Mantkowski
ClienTrax Software
1-614-875-2245
*********************************************************************
—–Original Message—–
From: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] On Behalf Of Mike Motter
Sent: Thursday, November 23, 2017 1:50 PM
To: OmnisDev List – English <omnisdev-en@lists.omnis-dev.com>
Subject: Re: Resize Image on Mac OS
Hello all,
We’ve been using the sips commands to resize images on the mac and it works great. I now have a need to resize images on the windows platform, is there anything similar on the windows side of things?
Thanks,
Mike Motter
> On Nov 22, 2017, at 11:42 AM, Michael Mantkowski <michaelj@clientrax.com> wrote:
>
> 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
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com