2017 © Pedro Peláez
 

silverstripe-module silverstripe-focuspointcropper

Even smarter automatic image cropping for SilverStripe

image

micschk/silverstripe-focuspointcropper

Even smarter automatic image cropping for SilverStripe

  • Tuesday, October 10, 2017
  • by micschk
  • Repository
  • 5 Watchers
  • 15 Stars
  • 201 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 11 Versions
  • 2 % Grown

The README.md

FocusPointCropper: (Even) Smarter Image Cropping for SilverStripe

This module bolts an interface to crop an image from within the CMS, on top of Jonom's excellent FocusPoint module. This facilitates setting an initial crop of an image, which will be used as the basis for FocusPoint's smarter cropping., (*1)

, (*2)

Set crop & zoom level (drag/scroll) and FocusPoint (click), (*3)

Requirements

SilverStripe 3.3+, (*4)

Install / Composer

composer require "micschk/silverstripe-focuspointcropper" "dev-master", (*5)

Basic usage

When you edit an image in the CMS there should be an extra 'Focus Point + Crop' field. Scroll on the image to zoom, drag the image and (depending on configuration) resize the selection to set the crop area. Click on the subject of the image to set the focus area and save the image., (*6)

Config

Config options can be set using the SilverStripe Config API and will be fed directly to the js cropperfield. Options can be set globally or per field instance., (*7)

Settable options: https://github.com/fengyuanchen/cropper/blob/v2.3.0/README.md#options, (*8)

Config example

Restrain the aspect-ratio to be square and set the initial crop to 80% of the image for a specific page in the CMS;, (*9)

public function getCMSFields(){
    ...
    // Set custom config on FocusCropField for this instance
    Config::inst()->update('FocusPointCropField', 'cropconfig', array(
        'aspectRatio' => 1,
        'autoCropArea' => 0.8,
    ));
    ...
}

, (*10)

(the image will need to be saved first, for the crop to actually be applied), (*11)

Further Usage

Check the original Silverstripe FocusPoint Module, (*12)

The Versions

10/10 2017

dev-master

9999999-dev

Even smarter automatic image cropping for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

image silverstripe crop focus cropping focuspoint

10/10 2017

1.6

1.6.0.0

Even smarter automatic image cropping for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

image silverstripe crop focus cropping focuspoint

03/05 2017

1.5.3

1.5.3.0

Even smarter automatic image cropping for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

image silverstripe crop focus cropping focuspoint

03/05 2017

1.5.2

1.5.2.0

Even smarter automatic image cropping for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

image silverstripe crop focus cropping focuspoint

03/05 2017

1.5.1

1.5.1.0

Even smarter automatic image cropping for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

image silverstripe crop focus cropping focuspoint

03/05 2017

1.5

1.5.0.0

Even smarter automatic image cropping for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

image silverstripe crop focus cropping focuspoint

25/10 2016

1.4

1.4.0.0

Even smarter automatic image cropping for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

image silverstripe crop focus cropping focuspoint

24/05 2016

1.3

1.3.0.0

Even smarter automatic image cropping for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

image silverstripe crop focus cropping focuspoint

23/05 2016

1.2

1.2.0.0

Even smarter automatic image cropping for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

image silverstripe crop focus cropping focuspoint

23/05 2016

1.1

1.1.0.0

Even smarter automatic image cropping for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

image silverstripe crop focus cropping focuspoint

23/05 2016

1.0

1.0.0.0

Even smarter automatic image cropping for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

image silverstripe crop focus cropping focuspoint