Image cropping sometimes crops improperly

I have a KM macro which will crop a certain number of pixels off the bottom of a picture. A prompt comes up and asks how many pixels to remove and that's it. It will work for all selected pictures in Finder. I'm confused because most of the time it works properly. However sometimes, it shrinks the photo into the bottom left hand of the image, at about 25% of the original image. The rest of the image is white.

Please let me know what I can do to troubleshoot this. I'm happy to upload some sample photos and the macro.Crop Image.kmmacros (5.6 KB)

Update: I uploaded the macro.

I don’t know why the macro doesn’t work, but since KM’s image tools are rather limited [1] I would use the command line tool ImageMagick for this kind of stuff.

This has several advantages:

  • Simpler macro
  • More flexibility
  • You don’t have to worry about the image file format
  • Getting familiar with ImageMagick will open up sheer endless possibilities

If you don’t have ImageMagick on your computer you can install it via Homebrew:

brew install imagemagick

(Make sure KM knows the path of your command line tools; if necessary set the ENV_PATH variable accordingly.)

The macro then goes like this:

Chop Image.kmmacros (3.1 KB)

ImageMagick’s chop operator is documented here.


Note: As your original macro, this macro is destructive. It will overwrite the original files.


[1] KM’s image cropping also has been buggy in the past. But according to here this was fixed with version 7.3.

1 Like

Email the macro and some example images that fail (all together in a zip folder so Mail does not mess with the images) to support at stairways dot com and I will see if I can duplicate or explain the issue.

This is fixed for the next version.

Setting the DPI of the image to 72 first should resolve it in the meantime.