The goal of this module is to provide some control over automatic image cropping in SilverStripe.
Problem: SilverStripe crops all images from the centre. If the subject is off-centre, it may be cropped out.
Solution: FocusPoint allows you to tag the subject in an image and ensures it is not lost during cropping.
Download, place the folder in your project root and run a dev/build?flush=1.
Note: Currently dev/build?flush=1 does not flush .ss template files. Usually template flushing happens automatically but ocassionally there can be problems with
<% include %> templates not being flushed. If the FocusPoint field in the CMS looks broken try flushing the current URL e.g. yoursite.com/admin/?flush=1
When you edit an image in the CMS there should be an extra 'Focus Point' field. Click on the subject of the image to set the focus area and save the image.
Use just like CroppedImage, but use CroppedFocusedImage instead.
You can specify that images should not be upscaled by passing a third argument:
<% with $SomeImage %>
<img src="$Link" alt="" />
<% end_with %>
Try something like this to get a full-screen background image that preserves your focus point.
<% with $BGImage %>
background-position: $PercentageX $PercentageY;
<% end_with %>
If you are caching page content that includes a CroppedFocusedImage and you edit the image (i.e. by changing the focus point) but not the page, you may want to invalidate the page's cache as the updated CroppedFocusedImage will have a different filename. Gordon Banderson has written a robust extension to help you achieve this.