ImageMagick Engine - Version 1.5.4

Version Description

  • Fixed a bug that could cause transparency errors with PNG
Download this release

Release Info

Developer rickardw
Plugin Icon 128x128 ImageMagick Engine
Version 1.5.4
Comparing to
See all releases

Code changes from version 1.5.3 to 1.5.4

Files changed (2) hide show
  1. imagemagick-engine.php +10 -5
  2. readme.txt +4 -1
imagemagick-engine.php CHANGED
@@ -5,7 +5,7 @@
5
  Description: Improve the quality of re-sized images by replacing standard GD library with ImageMagick
6
  Author: Orangelab
7
  Author URI: https://orangelab.com/
8
- Version: 1.5.3
9
  Text Domain: imagemagick-engine
10
 
11
  Copyright 2010, 2011, 2012, 2013, 2014, 2015 Brand Manual Sweden AB
@@ -390,6 +390,12 @@ function ime_im_filename_is_jpg($filename) {
390
  return (strcasecmp($ext, 'jpg') == 0) || (strcasecmp($ext, 'jpeg') == 0);
391
  }
392
 
 
 
 
 
 
 
393
  /*
394
  * PHP ImageMagick ("Imagick") class handling
395
  */
@@ -406,14 +412,13 @@ function ime_im_php_resize( $old_file, $new_file, $width, $height, $crop, $resiz
406
  return false;
407
 
408
  try {
 
409
  $quality = ime_get_quality( $resize_mode );
410
  if ( is_numeric( $quality ) && $quality >= 0 && $quality <= 100 && ime_im_filename_is_jpg( $new_file ) ) {
411
  $im->setImageCompression( Imagick::COMPRESSION_JPEG );
412
  $im->setImageCompressionQuality( $quality );
413
  }
414
- if ( method_exists( $im, 'setImageOpacity' ) )
415
- $im->setImageOpacity( 1.0 );
416
-
417
  if ( $resize_mode == 'size' )
418
  $im->stripImage();
419
 
@@ -1073,4 +1078,4 @@ function ime_option_page() {
1073
  </div>
1074
  <?php
1075
  }
1076
- ?>
5
  Description: Improve the quality of re-sized images by replacing standard GD library with ImageMagick
6
  Author: Orangelab
7
  Author URI: https://orangelab.com/
8
+ Version: 1.5.4
9
  Text Domain: imagemagick-engine
10
 
11
  Copyright 2010, 2011, 2012, 2013, 2014, 2015 Brand Manual Sweden AB
390
  return (strcasecmp($ext, 'jpg') == 0) || (strcasecmp($ext, 'jpeg') == 0);
391
  }
392
 
393
+ // Get file extenstion
394
+ function ime_im_get_filetype($filename) {
395
+ $info = pathinfo($filename);
396
+ return strtolower($info['extension']);
397
+ }
398
+
399
  /*
400
  * PHP ImageMagick ("Imagick") class handling
401
  */
412
  return false;
413
 
414
  try {
415
+ $im->setImageFormat( ime_im_get_filetype( $old_file) );
416
  $quality = ime_get_quality( $resize_mode );
417
  if ( is_numeric( $quality ) && $quality >= 0 && $quality <= 100 && ime_im_filename_is_jpg( $new_file ) ) {
418
  $im->setImageCompression( Imagick::COMPRESSION_JPEG );
419
  $im->setImageCompressionQuality( $quality );
420
  }
421
+
 
 
422
  if ( $resize_mode == 'size' )
423
  $im->stripImage();
424
 
1078
  </div>
1079
  <?php
1080
  }
1081
+ ?>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: rickardw, johanee, orangelab
3
  Tags: image, images, picture, imagemagick, gd
4
  Requires at least: 2.9
5
  Tested up to: 5.0
6
- Stable tag: 1.5.3
7
 
8
  Improve the quality of re-sized images by replacing standard GD library with ImageMagick.
9
 
@@ -74,6 +74,9 @@ You'll probably have problems with various other plugins too unless you fix this
74
 
75
  == Changelog ==
76
 
 
 
 
77
  = 1.5.3 =
78
  * Tested with WP 5.0
79
 
3
  Tags: image, images, picture, imagemagick, gd
4
  Requires at least: 2.9
5
  Tested up to: 5.0
6
+ Stable tag: 1.5.4
7
 
8
  Improve the quality of re-sized images by replacing standard GD library with ImageMagick.
9
 
74
 
75
  == Changelog ==
76
 
77
+ = 1.5.4 =
78
+ * Fixed a bug that could cause transparency errors with PNG
79
+
80
  = 1.5.3 =
81
  * Tested with WP 5.0
82