What is the hash (#) resize option in ImageMagick?

imagemagick, paperclip, ruby-on-rails

Solution

According to Paperclip's API documentation:

Paperclip also adds the “#” option (e.g. “50x50#”), which will resize the image to fit maximally inside the dimensions and then crop the rest off (weighted at the center).

So, if you upload a 120x100 image and crop to "50x50#", it'll resize the image to 60x50, and then crop 50x50 using the image's centroid as the anchor (thereby removing 5px from the left and 5px from the right).

Problem

Just came across this resize option '300x300#' and is wondering what the hash option means? There seems to be nothing on this option in the official ImageMagick documentation.

Original source