Resize Image on Mac OS
Wow. All this time did not know about it.
> On 23-11-2017, at 8:57 PM, Kelly Burgess <email@example.com> wrote:
> Alex wrote:
>> Wrapping ImageMagick in an xcomp like what was done for cURL would be awesome.
> I’ve done some of that – see $resizeImage(imageBinary, width, height) in the appended list of “ImageMagicker” functions below. (The $dicom2jpg function wraps “imebra” open source for DICOM.)
> I’ve also got the ImageBox visual xcomp for displaying lists and grids of images, and it includes a static function intended for thumbnail production, but usable for general resizing (proportionally, given the larger dimension): ImageBox.$getthumbnail(pPicture, pPixelSize)
> Both are cross-platform and include 64-bit builds.
> ; The following 13 static functions are found in the ImageMagicker group in the Catalog:
> ; ;; these five functions are file-in, file-out
> ; $tiff2jpg(cTiffSourceFilePath, cJpgDestFilePath) ;; tiff2jpg accepts tiff, gif or png input
> ; $rotate90Right(cSourceFilePath, cJpgDestFilePath)
> ; $rotate90Left(cSourceFilePath, cJpgDestFilePath)
> ; $rotate180(cSourceFilePath, cJpgDestFilePath)
> ; $dicom2jpg(cDicomSourceFilePath, cJpgDestFilePath) ;; this one is a mandatory first step with DICOM files
> ; ;; The remaining methods are binary field-based, once the $file2image method reads from a file into an image binary.
> ; ;; They don’t work with DICOM format, which is why you must use $dicom2jpg() to convert them to JPG first.
> ; ;; $file2image should work for all image types except DICOM, and it also deals with discarding the header from an ICA file.
> ; ;; The format (“TIFF”,”PNG”,”GIF”,”JPG”,etc.) is returned to you in param3, along with the image pixel dimensions in param4 and param5.
> ; $file2image(cSourceFilePath, imageBinary, format, width, height)
> ; ;; the imageBinary field is modified in place by these five functions
> ; $reformatImage(imageBinary, newFormat [,compType, compQuality])
> ; $resizeImage(imageBinary, width, height)
> ; $rotateImage90CW(imageBinary) ;; 90° clockwise rotation
> ; $rotateImage90CC(imageBinary) ;; 90° counterclockwise rotation
> ; $rotateImage180(imageBinary) ;; 180° rotation
> ; ;; after rotating/resizing, write back to disk with an optional format change
> ; $image2file(imageBinary, cDestFilePath [,newFormat])
> ; ;; get a binary image’s format, dimensions and compression info with this function
> ; $getImageInfo(imageBinary, format, width, height [,compType, compQuality]) Returns imageBinary’s format, dimensions and compression properties
> Manage your list subscriptions at lists.omnis-dev.com
Manage your list subscriptions at lists.omnis-dev.com