2017 © Pedro Peláez
 

neos-plugin krakenoptimizer

Image optimizer for Neos utilizing the Kraken API

image

gesagtgetan/krakenoptimizer

Image optimizer for Neos utilizing the Kraken API

  • Friday, July 27, 2018
  • by gesagt.getan.
  • Repository
  • 5 Watchers
  • 2 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 15 Versions
  • 18 % Grown

The README.md


GesagtGetan.KrakenOptimizer

Image optimizer for Neos utilizing the Kraken API, (*1)

Version Neos
1.x 2.3 LTS
2.x 3.x, 4.x
3.x 5.x

Installation

composer require gesagtgetan/krakenoptimizer

Create a Kraken account on https://kraken.io and generate new API Keys on https://kraken.io/account/api-credentials., (*2)

Add the credentials to your global Settings.yaml:, (*3)

GesagtGetan:
  KrakenOptimizer:
    krakenOptions:
      auth:
        api_key: '<yourApiKey>'
        api_secret: '<yourApiSecret>'

Usage

Warning:

⚠ As with any plugin that actively works on your database and resources it is a good idea to make sure you keep regular backups for your website. No known disasters have been caused by this plugin, but it's always better to be safe than sorry., (*4)

  1. We usually want to optimize all existing resources. We can do this by running this CLI command
./flow kraken:optimize

All existing thumbnails will be replaced by optimized version from Kraken. By default we perform lossy optimizations, because this can dramatically decrease image size, while no noticeable decrease in image quality should occur. You can change the optimization strategy by altering the krakenOptions in the settings (set lossy: false), along with other arbitrary Kraken API options (see https://kraken.io/docs/)., (*5)

Tip:

In case something goes wrong during the initial optimization, it's possible to resume optimization from a preferred offset. For example ./flow kraken:optimize --offset 300 will skip the first 299 thumbnails., (*6)

Warning:

⚠ Executing this command multiple times will send potentially already optimized images to the Kraken API and thus will still count towards your API quota and can lead to "over optimized" images when running lossy optimizations multiple times., (*7)

  1. Now is the perfect time to activate live optimizations. All generated thumbnails after the initial optimiziation will be send to kraken for improvement when this flag is set:
GesagtGetan:
  KrakenOptimizer:
    liveOptimization: true

♻ Don't forget to flush your caches after adding the flag in a production environment., (*8)

  1. Delete Production cache
FLOW_CONTEXT=Production ./flow flow:cache:flush

Additional options

optimizeOriginalResource

By enabling the optimizeOriginalResource flag, the original image will be replaced with an optimized version, if no thumbnail creation was necessary for a particular image. Neos will not create a thumbnail for an image, if the the necessary dimensions are equal or lower than the original image., (*9)

By default we do not optimize original images. Make sure you have regular backups of your server, in case something goes wrong during optimization!, (*10)

Usage:

GesagtGetan:
  KrakenOptimizer:
    optimizeOriginalResource: true

Troubleshooting and FAQ

Q: I already optimized my thumbnails before installing this plugin, but I'm unhappy with the result, (*11)

A: If your thumbnails already show signs of high compression like artefacts, this plugin can not restore that missing information. In that case it's necessary to clear all your existing thumbnails with ./flow media:clearthumbnails. Be aware that this can put a lot of load on your server since all thumbnails need recreation, when a page has been called. You can activate liveOptimization right away, or optimize the created thumbnails later by running ./flow kraken:optimize., (*12)

If you need all your thumbnails in all your preset sizes, you can pre-generate them by running ./flow media:createthumbnails and ./flow media:renderthumbnails. Either optimize afterwads or have liveOptimization activated., (*13)

The Versions

27/07 2018

dev-master

9999999-dev

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

27/07 2018

1.0.x-dev

1.0.9999999.9999999-dev

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

27/07 2018

2.2.0

2.2.0.0

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

15/05 2018

1.1.2

1.1.2.0

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

15/05 2018

2.1.2

2.1.2.0

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

14/05 2018

2.1.1

2.1.1.0

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

14/05 2018

1.1.1

1.1.1.0

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

13/05 2018

2.1.0

2.1.0.0

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

13/05 2018

1.1.0

1.1.0.0

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

25/04 2018

2.0.2

2.0.2.0

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

25/04 2018

1.0.2

1.0.2.0

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

23/04 2018

2.0.1

2.0.1.0

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

23/04 2018

1.0.1

1.0.1.0

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

23/04 2018

2.0.0

2.0.0.0

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires

 

23/04 2018

1.0.0

1.0.0.0

Image optimizer for Neos utilizing the Kraken API

  Sources   Download

The Requires