Changeset 1456634
- Timestamp:
- 07/18/2016 10:02:23 PM (10 years ago)
- Location:
- cyclone-slider-2/trunk
- Files:
-
- 4 edited
-
README.txt (modified) (1 diff)
-
cyclone-slider.php (modified) (2 diffs)
-
src/CycloneSlider/ImageResizer.php (modified) (3 diffs)
-
src/code-5.3.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cyclone-slider-2/trunk/README.txt
r1456331 r1456634 118 118 119 119 == Changelog == 120 121 = 2.12.3 - 2016-07-19 = 122 * Fix for require_once not finding relative paths and fatal error when saving non image slides. 120 123 121 124 = 2.12.2 - 2016-07-18 = -
cyclone-slider-2/trunk/cyclone-slider.php
r1456331 r1456634 4 4 Plugin URI: http://www.codefleet.net/cyclone-slider-2/ 5 5 Description: Create and manage sliders with ease. Built for both casual users and developers. 6 Version: 2.12. 26 Version: 2.12.3 7 7 Author: Nico Amarilla 8 8 Author URI: http://www.codefleet.net/ … … 255 255 } 256 256 257 $object = new CycloneSlider_ImageResizer( $plugin['image_sizes'], $plugin['image_editor'] );257 $object = new CycloneSlider_ImageResizer( $plugin['image_sizes'], $plugin['image_editor'], $plugin['path'] ); 258 258 return $object; 259 259 } -
cyclone-slider-2/trunk/src/CycloneSlider/ImageResizer.php
r1456331 r1456634 4 4 */ 5 5 class CycloneSlider_ImageResizer { 6 6 7 7 protected $image_sizes; 8 8 protected $image_editor; 9 10 public function __construct( $image_sizes, $image_editor ){ 11 $this->image_sizes = $image_sizes; 9 protected $path; 10 11 public function __construct( $image_sizes, $image_editor, $path ){ 12 $this->image_sizes = $image_sizes; 12 13 $this->image_editor = $image_editor; 13 } 14 $this->path = $path; 15 } 14 16 15 17 /** … … 102 104 if(version_compare(PHP_VERSION, '5.3', '>=')){ 103 105 104 require_once '../code-5.3.php'; // Hack. This code is not placed here but in an external file to prevent PHP from parsing the code in versions below 5.3.0 despite the if..else check. See http://stackoverflow.com/questions/17275557/run-a-conditional-using-php-version106 require_once $this->path.'src/code-5.3.php'; // Hack. This code is not placed here but in an external file to prevent PHP from parsing the code in versions below 5.3.0 despite the if..else check. See http://stackoverflow.com/questions/17275557/run-a-conditional-using-php-version 105 107 106 108 } else { … … 114 116 $image->save( $image_file_dest, $resize_quality ); 115 117 116 return true; 118 117 119 } 118 120 return false; 119 121 } 120 122 return true; 121 123 } 122 124 -
cyclone-slider-2/trunk/src/code-5.3.php
r1456331 r1456634 1 1 <?php 2 2 // Used in ImageResizer 3 $editor = \CycloneSlider\Grafika\Grafika::createEditor(); 4 $editor->open( $image_file ); 5 if('fill'==$resize_option){ 6 $editor->resizeFill( $width, $height ); 7 } else if('crop'==$resize_option){ 8 $editor->crop( $width, $height ); 9 } else if('exact'==$resize_option){ 10 $editor->resizeExact( $width, $height ); 11 } else if('exactHeight'==$resize_option){ 12 $editor->resizeExactHeight( $height ); 13 } else if('exactWidth'==$resize_option){ 14 $editor->resizeExactWidth( $width ); 15 } else { 16 $editor->resizeFit( $width, $height ); 3 try { 4 $editor = \CycloneSlider\Grafika\Grafika::createEditor(); 5 $editor->open($image_file); 6 if ('fill' == $resize_option) { 7 $editor->resizeFill($width, $height); 8 } else if ('crop' == $resize_option) { 9 $editor->crop($width, $height); 10 } else if ('exact' == $resize_option) { 11 $editor->resizeExact($width, $height); 12 } else if ('exactHeight' == $resize_option) { 13 $editor->resizeExactHeight($height); 14 } else if ('exactWidth' == $resize_option) { 15 $editor->resizeExactWidth($width); 16 } else { 17 $editor->resizeFit($width, $height); 18 } 19 $editor->save($image_file_dest, null, $resize_quality); 20 return true; 21 } catch (Exception $e){ 22 return false; 17 23 } 18 $editor->save( $image_file_dest, null, $resize_quality );19 20 return true;
Note: See TracChangeset
for help on using the changeset viewer.