SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/Helpers/ImageTransform.php

  1. <?php
  2. /*
  3.  * Copyright (C) 2017 Karmabunny Pty Ltd.
  4.  *
  5.  * This file is a part of SproutCMS.
  6.  *
  7.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  8.  * of the GNU General Public License as published by the Free Software Foundation, either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * For more information, visit <http://getsproutcms.com>.
  12.  */
  13.  
  14. namespace Sprout\Helpers;
  15.  
  16.  
  17. /**
  18. * Does image resizing, or whatever transforms wanted really.
  19. **/
  20. interface ImageTransform {
  21.  
  22. /**
  23.   * Does the actual transform.
  24.   *
  25.   * @param Image $img The image object to transform. This is an object
  26.   * provided by Kohana
  27.   * @return boolean True on success, false on error
  28.   *
  29.   * @see http://docs.kohanaphp.com/libraries/image
  30.   **/
  31. function transform (Image $img);
  32.  
  33.  
  34. /**
  35.   * Estimate the RAM requirement to run this transform
  36.   *
  37.   * @return int Bytes
  38.   **/
  39. function estimateRamRequirement();
  40.  
  41. }
  42.  
  43.  
  44.