SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/config/file.php

Image transformations

This is an array of different operations that should be applied to the image

Currently supported transformations are:
   ResizeImageTransform  ( width , height )
   CropImageTransform  ( width , height , top_pos = 'center' , left_pos = 'center')

Transformations get applied in the order they are provided in the array.

You can also create your own transformations, just implement the ImageTransform interface
  1. <?php
  2. /*
  3.  * kate: tab-width 4; indent-width 4; space-indent on; word-wrap off; word-wrap-column 120;
  4.  * :tabSize=4:indentSize=4:noTabs=true:wrap=false:maxLineLen=120:mode=php:
  5.  *
  6.  * Copyright (C) 2016 Karmabunny Pty Ltd.
  7.  *
  8.  * This file is a part of SproutCMS.
  9.  *
  10.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  11.  * of the GNU General Public License as published by the Free Software Foundation, either
  12.  * version 2 of the License, or (at your option) any later version.
  13.  *
  14.  * For more information, visit <http://getsproutcms.com>.
  15.  */
  16.  
  17. use Sprout\Helpers\ResizeImageTransform;
  18.  
  19.  
  20. /**
  21.  * Image transformations
  22.  *
  23.  * This is an array of different operations that should be applied to the image
  24.  *
  25.  * Currently supported transformations are:
  26.  * ResizeImageTransform ( width , height )
  27.  * CropImageTransform ( width , height , top_pos = 'center' , left_pos = 'center')
  28.  *
  29.  * Transformations get applied in the order they are provided in the array.
  30.  *
  31.  * You can also create your own transformations, just implement the ImageTransform interface
  32.  */
  33.  
  34. $config['image_transformations']['small'] = array(
  35. new ResizeImageTransform (400, 400),
  36. );
  37.  
  38. $config['image_transformations']['medium'] = array(
  39. new ResizeImageTransform (680, null),
  40. );
  41.  
  42. $config['image_transformations']['large'] = array(
  43. new ResizeImageTransform (1280, null),
  44. );
  45.  
  46.  
  47. /**
  48. * The size to use for image links added using a rich text editor.
  49. * Specified in on-the-fly resize format.
  50. **/
  51. $config['imagelink_size'] = 'r500x500';
  52.  
  53.  
  54.