Version Description
- 2016-07-19 =
- Fix for require_once not finding relative paths and fatal error when saving non image slides.
Download this release
Release Info
Developer | kosinix |
Plugin | Cyclone Slider |
Version | 2.12.3 |
Comparing to | |
See all releases |
Code changes from version 2.12.2 to 2.12.3
- README.txt +3 -0
- cyclone-slider.php +2 -2
- src/CycloneSlider/ImageResizer.php +10 -8
- src/code-5.3.php +20 -17
README.txt
CHANGED
@@ -118,6 +118,9 @@ See: [http://docs.codefleet.net/cyclone-slider-2/creating-your-own-template/](ht
|
|
118 |
|
119 |
== Changelog ==
|
120 |
|
|
|
|
|
|
|
121 |
= 2.12.2 - 2016-07-18 =
|
122 |
* Fix for parsing error in PHP versions 5.2 due to missing namespace support.
|
123 |
|
118 |
|
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.
|
123 |
+
|
124 |
= 2.12.2 - 2016-07-18 =
|
125 |
* Fix for parsing error in PHP versions 5.2 due to missing namespace support.
|
126 |
|
cyclone-slider.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Cyclone Slider 2
|
4 |
Plugin URI: http://www.codefleet.net/cyclone-slider-2/
|
5 |
Description: Create and manage sliders with ease. Built for both casual users and developers.
|
6 |
-
Version: 2.12.
|
7 |
Author: Nico Amarilla
|
8 |
Author URI: http://www.codefleet.net/
|
9 |
License: GPLv3
|
@@ -254,7 +254,7 @@ function cycloneslider_service_image_resizer( $plugin ) {
|
|
254 |
return $object;
|
255 |
}
|
256 |
|
257 |
-
$object = new CycloneSlider_ImageResizer( $plugin['image_sizes'], $plugin['image_editor'] );
|
258 |
return $object;
|
259 |
}
|
260 |
|
3 |
Plugin Name: Cyclone Slider 2
|
4 |
Plugin URI: http://www.codefleet.net/cyclone-slider-2/
|
5 |
Description: Create and manage sliders with ease. Built for both casual users and developers.
|
6 |
+
Version: 2.12.3
|
7 |
Author: Nico Amarilla
|
8 |
Author URI: http://www.codefleet.net/
|
9 |
License: GPLv3
|
254 |
return $object;
|
255 |
}
|
256 |
|
257 |
+
$object = new CycloneSlider_ImageResizer( $plugin['image_sizes'], $plugin['image_editor'], $plugin['path'] );
|
258 |
return $object;
|
259 |
}
|
260 |
|
src/CycloneSlider/ImageResizer.php
CHANGED
@@ -3,14 +3,16 @@
|
|
3 |
* Class for copying WP images for import/export purposes and resizing slide images
|
4 |
*/
|
5 |
class CycloneSlider_ImageResizer {
|
6 |
-
|
7 |
protected $image_sizes;
|
8 |
protected $image_editor;
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
12 |
$this->image_editor = $image_editor;
|
13 |
-
|
|
|
14 |
|
15 |
/**
|
16 |
* Resize Images
|
@@ -101,7 +103,7 @@ class CycloneSlider_ImageResizer {
|
|
101 |
private function resize_slide_image( $image_file, $image_file_dest, $width, $height, $resize_option, $resize_quality){
|
102 |
if(version_compare(PHP_VERSION, '5.3', '>=')){
|
103 |
|
104 |
-
require_once '
|
105 |
|
106 |
} else {
|
107 |
// Create
|
@@ -113,11 +115,11 @@ class CycloneSlider_ImageResizer {
|
|
113 |
$image->resize( $width, $height, $resize_option );
|
114 |
$image->save( $image_file_dest, $resize_quality );
|
115 |
|
116 |
-
|
117 |
}
|
118 |
return false;
|
119 |
}
|
120 |
-
|
121 |
}
|
122 |
|
123 |
/**
|
3 |
* Class for copying WP images for import/export purposes and resizing slide images
|
4 |
*/
|
5 |
class CycloneSlider_ImageResizer {
|
6 |
+
|
7 |
protected $image_sizes;
|
8 |
protected $image_editor;
|
9 |
+
protected $path;
|
10 |
+
|
11 |
+
public function __construct( $image_sizes, $image_editor, $path ){
|
12 |
+
$this->image_sizes = $image_sizes;
|
13 |
$this->image_editor = $image_editor;
|
14 |
+
$this->path = $path;
|
15 |
+
}
|
16 |
|
17 |
/**
|
18 |
* Resize Images
|
103 |
private function resize_slide_image( $image_file, $image_file_dest, $width, $height, $resize_option, $resize_quality){
|
104 |
if(version_compare(PHP_VERSION, '5.3', '>=')){
|
105 |
|
106 |
+
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
|
107 |
|
108 |
} else {
|
109 |
// Create
|
115 |
$image->resize( $width, $height, $resize_option );
|
116 |
$image->save( $image_file_dest, $resize_quality );
|
117 |
|
118 |
+
|
119 |
}
|
120 |
return false;
|
121 |
}
|
122 |
+
return true;
|
123 |
}
|
124 |
|
125 |
/**
|
src/code-5.3.php
CHANGED
@@ -1,20 +1,23 @@
|
|
1 |
<?php
|
2 |
// Used in ImageResizer
|
3 |
-
|
4 |
-
$editor
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
}
|
18 |
-
$editor->save( $image_file_dest, null, $resize_quality );
|
19 |
-
|
20 |
-
return true;
|
1 |
<?php
|
2 |
// Used in ImageResizer
|
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;
|
23 |
}
|
|
|
|
|
|