ImageMagick Engine - Version 1.2.3

Version Description

  • Fix bug in resize all images handling, also remove some PHP notices. Thanks to Andreas Kleinschmidt for the report
  • Upgrade jQuery UI Progressbar to version 1.8.9, to match version of UI Core in WordPress
Download this release

Release Info

Developer orangelab
Plugin Icon 128x128 ImageMagick Engine
Version 1.2.3
Comparing to
See all releases

Code changes from version 1.2.2 to 1.2.3

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: http://www.orangelab.se
8
- Version: 1.2.2
9
  Text Domain: imagemagick-engine
10
 
11
  Copyright 2010, 2011 Orangelab
@@ -39,6 +39,7 @@
39
  * - unsharp mask, sharpening level options (perhaps on a picture-by-picture basis)
40
  * - handle TIF and other IM formats if possible
41
  * - can we use IM instead of GD in more places?
 
42
  */
43
 
44
  if (!defined('ABSPATH'))
@@ -106,7 +107,7 @@ function ime_init() {
106
  * jQuery UI version 1.7 and 1.8 seems incompatible...
107
  */
108
  if (ime_script_version_compare('jquery-ui-core', '1.8', '>=')) {
109
- wp_register_script('jquery-ui-progressbar', plugins_url('/js/ui.progressbar-1.8.7.js', __FILE__), array('jquery-ui-core', 'jquery-ui-widget'), '1.8.7');
110
  } else {
111
  wp_register_script('jquery-ui-progressbar', plugins_url('/js/ui.progressbar-1.7.2.js', __FILE__), array('jquery-ui-core'), '1.7.2');
112
  }
@@ -292,7 +293,7 @@ function ime_filter_attachment_metadata($metadata, $attachment_id) {
292
  $new_ext = $ext;
293
  else
294
  $new_ext = "jpg";
295
-
296
  /*
297
  * Do the actual resize
298
  */
@@ -322,6 +323,10 @@ function ime_filter_attachment_metadata($metadata, $attachment_id) {
322
  , 'width' => $dst_w
323
  , 'height' => $dst_h
324
  );
 
 
 
 
325
  $metadata['image-converter'][$size] = 'IME';
326
 
327
  // Set correct file permissions
@@ -582,9 +587,12 @@ function ime_ajax_process_image() {
582
 
583
  $metadata = wp_get_attachment_metadata($id);
584
 
585
- if (!$force) {
 
 
 
586
  foreach ($sizes AS $s => $ignore) {
587
- if ($metadata['image-converter'][$s] == 'IME')
588
  unset($sizes[$s]);
589
  }
590
  if (count($sizes) < 1)
5
  Description: Improve the quality of re-sized images by replacing standard GD library with ImageMagick
6
  Author: Orangelab
7
  Author URI: http://www.orangelab.se
8
+ Version: 1.2.3
9
  Text Domain: imagemagick-engine
10
 
11
  Copyright 2010, 2011 Orangelab
39
  * - unsharp mask, sharpening level options (perhaps on a picture-by-picture basis)
40
  * - handle TIF and other IM formats if possible
41
  * - can we use IM instead of GD in more places?
42
+ * - custom crop of images instead of blindly going for the middle
43
  */
44
 
45
  if (!defined('ABSPATH'))
107
  * jQuery UI version 1.7 and 1.8 seems incompatible...
108
  */
109
  if (ime_script_version_compare('jquery-ui-core', '1.8', '>=')) {
110
+ wp_register_script('jquery-ui-progressbar', plugins_url('/js/ui.progressbar-1.8.9.js', __FILE__), array('jquery-ui-core', 'jquery-ui-widget'), '1.8.9');
111
  } else {
112
  wp_register_script('jquery-ui-progressbar', plugins_url('/js/ui.progressbar-1.7.2.js', __FILE__), array('jquery-ui-core'), '1.7.2');
113
  }
293
  $new_ext = $ext;
294
  else
295
  $new_ext = "jpg";
296
+
297
  /*
298
  * Do the actual resize
299
  */
323
  , 'width' => $dst_w
324
  , 'height' => $dst_h
325
  );
326
+
327
+ if (!isset($metadata['image-converter']) || !is_array($metadata['image-converter']))
328
+ $metadata['image-converter'] = array();
329
+
330
  $metadata['image-converter'][$size] = 'IME';
331
 
332
  // Set correct file permissions
587
 
588
  $metadata = wp_get_attachment_metadata($id);
589
 
590
+ // Do not re-encode IME images unless forced
591
+ if (!$force && isset($metadata['image-converter']) && is_array($metadata['image-converter'])) {
592
+ $converter = $metadata['image-converter'];
593
+
594
  foreach ($sizes AS $s => $ignore) {
595
+ if (isset($converter[$s]) && $converter[$s] == 'IME')
596
  unset($sizes[$s]);
597
  }
598
  if (count($sizes) < 1)
js/{ui.progressbar-1.8.7.js → ui.progressbar-1.8.9.js} RENAMED
@@ -1,7 +1,7 @@
1
  /*
2
- * jQuery UI Progressbar 1.8.7
3
  *
4
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
5
  * Dual licensed under the MIT or GPL Version 2 licenses.
6
  * http://jquery.org/license
7
  *
@@ -13,4 +13,4 @@
13
  */
14
  (function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
15
  this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*
16
- this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.7"})})(jQuery);
1
  /*
2
+ * jQuery UI Progressbar 1.8.9
3
  *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
  * Dual licensed under the MIT or GPL Version 2 licenses.
6
  * http://jquery.org/license
7
  *
13
  */
14
  (function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
15
  this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*
16
+ this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.9"})})(jQuery);
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: orangelab
3
  Tags: image, images, picture, imagemagick, gd
4
  Requires at least: 2.9
5
  Tested up to: 3.1.2
6
- Stable tag: 1.2.2
7
 
8
  Improve the quality of re-sized images by replacing standard GD library with ImageMagick.
9
 
@@ -74,6 +74,10 @@ You'll probably have problems with various other plugins too unless you fix this
74
 
75
  == Changelog ==
76
 
 
 
 
 
77
  = 1.2.2 =
78
  * Fixed filepath with spaces on Windows
79
  * Tested with WordPress 3.1.2
3
  Tags: image, images, picture, imagemagick, gd
4
  Requires at least: 2.9
5
  Tested up to: 3.1.2
6
+ Stable tag: 1.2.3
7
 
8
  Improve the quality of re-sized images by replacing standard GD library with ImageMagick.
9
 
74
 
75
  == Changelog ==
76
 
77
+ = 1.2.3 =
78
+ * Fix bug in resize all images handling, also remove some PHP notices. Thanks to Andreas Kleinschmidt for the report
79
+ * Upgrade jQuery UI Progressbar to version 1.8.9, to match version of UI Core in WordPress
80
+
81
  = 1.2.2 =
82
  * Fixed filepath with spaces on Windows
83
  * Tested with WordPress 3.1.2