• Mac OS X

    Automating Image File Changes

    Ever need to automate changes to image files? Maybe a LaunchAgent that would watch a specific folder and resize png files that were dropped in there, or a little script that sanitized images as they came in to be a specific size (e.g. Poster Frames)? Well, sips is a little tool built into OS X that can help immensely with this. It will even convert that png to a jpeg or pict to png. Let’s look at using sips. First up, let’s just get the width and height of an image file: sips --getProperty pixelHeight /Shared/tmpimages/1.png sips --getProperty pixelWidth /Shared/tmpimages/1.png Or for dpi: sips --getProperty dpiHeight /Shared/tmpimages/1.png sips --getProperty dpiWidth…