Instead of enabling cropping through the template tag {% ultimatethumb 'sourceset' image '320x400,400x500' crop=True %} by setting crop=True we need to optionally pass the gravitiy as string. See https://www.imagemagick.org/script/command-line-options.php#gravity for the possible values. The mapping could be the following:
crop=True ---> gravity='Center'
crop='C' ---> gravity='Center'
crop='N' ---> gravity='North'
crop='NW' ---> gravity='NorthWest'
crop='NE' ---> gravity='NorthEast'
crop='W' ---> gravity='West'
crop='E' ---> gravity='East'
crop='S' ---> gravity='South'
crop='SW' ---> gravity='SouthWest'
crop='SE' ---> gravity='SouthEast'
But I think we also need to support the imagemagick default values. So a full mapping can look like this:
Instead of enabling cropping through the template tag
{% ultimatethumb 'sourceset' image '320x400,400x500' crop=True %}
by settingcrop=True
we need to optionally pass the gravitiy as string. See https://www.imagemagick.org/script/command-line-options.php#gravity for the possible values. The mapping could be the following:crop=True
--->gravity='Center'
crop='C'
--->gravity='Center'
crop='N'
--->gravity='North'
crop='NW'
--->gravity='NorthWest'
crop='NE'
--->gravity='NorthEast'
crop='W'
--->gravity='West'
crop='E'
--->gravity='East'
crop='S'
--->gravity='South'
crop='SW'
--->gravity='SouthWest'
crop='SE'
--->gravity='SouthEast'
But I think we also need to support the imagemagick default values. So a full mapping can look like this:
crop=True
--->gravity='Center'
crop='C'
--->gravity='Center'
crop='N'
--->gravity='North'
crop='NW'
--->gravity='NorthWest'
crop='NE'
--->gravity='NorthEast'
crop='W'
--->gravity='West'
crop='E'
--->gravity='East'
crop='S'
--->gravity='South'
crop='SW'
--->gravity='SouthWest'
crop='SE'
--->gravity='SouthEast'
crop='Center'
--->gravity='Center'
crop='North'
--->gravity='North'
crop='NorthWest'
--->gravity='NorthWest'
crop='NorthEast'
--->gravity='NorthEast'
crop='West'
--->gravity='West'
crop='East'
--->gravity='East'
crop='South'
--->gravity='South'
crop='SouthWest'
--->gravity='SouthWest'
crop='SouthEast'
--->gravity='SouthEast'