rsmclaren/silverstripe-kraken

Use the kraken API to optimize images

Installs: 37

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 2

Open Issues: 1

Type:silverstripe-module

dev-master 2017-04-26 17:16 UTC

This package is auto-updated.

Last update: 2024-10-26 08:08:31 UTC


README

Maintainer Contact

  • Ryan McLaren <ryansm (at) outlook (dot) com>

Requirements

Installation

  • Extract all files into a folder called "kraken" under your SilverStripe root. Install the Kraken PHP API into a folder called "vendor" under your Silverstripe root, or use composer (recommended):
composer require rsmclaren/silverstripe-kraken
  • Run dev/build?flush=all

  • Sign up for the Kraken API and obtain your unique API Key and API Secret

  • Enter your API Key and API Secret in the Settings > Kraken Tab fields

Usage

After setting up your API keys, images will be automatically optimized using the Kraken API. You will likely notice that Uploading Images is slower after activating the module.

Existing images can be optimized using the Optimize Images button located in the Files section of the CMS. Individual images can also be optimized by viewing their details page and clicking the Optimize button.

You can enable the Kraken API Sandbox by using the following in your config.yml.

Kraken:
    dev: true

You can read more about the API Sandbox at https://kraken.io/docs/sandbox.

If you are using a version of SilverStripe <= 3.1.5 you must set the Image backend through your _config.php

Image::set_backend('KrakenGDBackend'); //for GD
Image::set_backend('KrakenImagickBackend'); // for ImageMagick

Notes

Please note that images optimized using this module are replaced. A backup of the original, unoptimized image will not be saved. Please consider creating a backup of your assets folder before using this module.