ImageMagick Engine - Version 1.5.3

Version Description

  • Tested with WP 5.0
Download this release

Release Info

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

Code changes from version 1.5.2 to 1.5.3

Files changed (5) hide show
  1. imagemagick-engine.php +4 -3
  2. js/ime-admin.js +161 -161
  3. readme.txt +7 -5
  4. screenshot-1.jpg +0 -0
  5. screenshot-2.jpg +0 -0
imagemagick-engine.php CHANGED
@@ -3,9 +3,9 @@
3
  Plugin Name: ImageMagick Engine
4
  Plugin URI: https://wordpress.org/plugins/imagemagick-engine/
5
  Description: Improve the quality of re-sized images by replacing standard GD library with ImageMagick
6
- Author: Brand Manual
7
- Author URI: http://www.thebrandmanual.com/
8
- Version: 1.5.2
9
  Text Domain: imagemagick-engine
10
 
11
  Copyright 2010, 2011, 2012, 2013, 2014, 2015 Brand Manual Sweden AB
@@ -63,6 +63,7 @@ $ime_options = null;
63
  $ime_image_sizes = null;
64
  $ime_image_file = null;
65
 
 
66
  /*
67
  * Functions
68
  */
3
  Plugin Name: ImageMagick Engine
4
  Plugin URI: https://wordpress.org/plugins/imagemagick-engine/
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
63
  $ime_image_sizes = null;
64
  $ime_image_file = null;
65
 
66
+
67
  /*
68
  * Functions
69
  */
js/ime-admin.js CHANGED
@@ -1,161 +1,161 @@
1
- //Variables
2
- var rt_images = "";
3
- var rt_total = 1;
4
- var rt_count = 1;
5
- var rt_force = 0;
6
- var rt_precision = 0;
7
- var rt_sizes = "";
8
-
9
- // Ajax test IM path
10
- function imeTestPath () {
11
- jQuery('.cli_path_icon').hide();
12
- jQuery('#cli_path_progress').show();
13
- jQuery.get(ajaxurl, {
14
- action: "ime_test_im_path",
15
- cli_path: jQuery('#cli_path').val()
16
- }, function(data) {
17
- jQuery('#cli_path_progress').hide();
18
- r = parseInt(data);
19
- if (r > 0) {
20
- jQuery('#cli_path_yes').show();
21
- jQuery('#cli_path_no').hide();
22
- } else {
23
- jQuery('#cli_path_yes').hide();
24
- jQuery('#cli_path_no').show();
25
- }
26
- });
27
- }
28
-
29
- function imeStartResize() {
30
- rt_sizes = "";
31
- rt_force = 0;
32
-
33
- jQuery('#regenerate-images-metabox input').each(function(){
34
- var i = jQuery(this);
35
- var name = i.attr('name');
36
-
37
- if(i.is(':checked') && name && name.substring(0,11) == "regen-size-") {
38
- rt_sizes = rt_sizes + name.substring(11) + "|";
39
- }
40
- });
41
-
42
- if (jQuery('#force').is(':checked'))
43
- rt_force = 1;
44
-
45
- if (rt_total > 20000)
46
- rt_precision = 3;
47
- else if (rt_total > 2000)
48
- rt_precision = 2;
49
- else if (rt_total > 200)
50
- rt_precision = 1;
51
- else
52
- rt_precision = 0;
53
-
54
- var rt_percent = 0;
55
-
56
- rt_count = 1;
57
- jQuery("#regenbar").progressbar();
58
- jQuery("#regenbar-percent").html( rt_percent.toFixed(rt_precision) + " %" );
59
- jQuery('#regeneration').dialog( { 'dialogClass': 'ime-dialog' } ).dialog( 'open' );
60
-
61
- imeRegenImages( rt_images.shift() );
62
- }
63
-
64
- //Regeneration of progressbar
65
- function imeRegenImages( id ) {
66
- jQuery.post(ajaxurl, { action: "ime_process_image", id: id, sizes: rt_sizes, force: rt_force }, function(data) {
67
- var n = parseInt(data, 10);
68
- if (isNaN(n)) {
69
- alert(data);
70
- }
71
-
72
- // todo: test and handle negative return
73
-
74
- if ( rt_images.length <= 0 ) {
75
- jQuery('#regen-message').removeClass('hidden').html("<p><strong>" + ime_admin.done + "</strong> " + ime_admin.processed_fmt.replace('%d', rt_total) + ".</p>");
76
- jQuery('#regeneration').dialog('close');
77
- jQuery("#regenbar").progressbar( "value", 0 );
78
- return;
79
- }
80
-
81
- var next_id = rt_images.shift();
82
- var rt_percent = ( rt_count / rt_total ) * 100;
83
- jQuery("#regenbar").progressbar( "value", rt_percent );
84
- jQuery("#regenbar-percent").html( rt_percent.toFixed(rt_precision) + " %" );
85
- rt_count = rt_count + 1;
86
-
87
- // tail recursion
88
- imeRegenImages(next_id);
89
- });
90
- }
91
-
92
- // Regen single image on media pages
93
- function imeRegenMediaImage( id, sizes, force ) {
94
- var link = jQuery('#ime-regen-link-' + id);
95
-
96
- if (link.hasClass('disabled'))
97
- return false;
98
-
99
- link.addClass('disabled');
100
-
101
- var spinner = jQuery('#ime-spinner-' + id).children('img');
102
- spinner.show();
103
-
104
- var message = jQuery('#ime-message-' + id).show();
105
- jQuery.post(ajaxurl, { action: "ime_process_image", id: id, sizes: sizes, force: force }, function(data) {
106
- spinner.hide();
107
- link.removeClass('disabled');
108
-
109
- var n = parseInt(data, 10);
110
- if (isNaN(n) || n < 0) {
111
- message.html(ime_admin.failed);
112
- if (isNaN(n))
113
- alert(data);
114
- } else {
115
- message.html(ime_admin.resized);
116
- }
117
- });
118
- }
119
-
120
- function imeUpdateMode() {
121
- jQuery("#ime-select-mode option").each(function(i,e) {
122
- var o = jQuery(this);
123
- var mode = o.val();
124
- if (o.is(':selected'))
125
- jQuery('#ime-row-' + mode).show();
126
- else
127
- jQuery('#ime-row-' + mode).hide();
128
- });
129
- }
130
-
131
- jQuery(document).ready(function($) {
132
- jQuery('#ime_cli_path_test').click(imeTestPath);
133
-
134
- imeUpdateMode();
135
- jQuery('#ime-select-mode').change(imeUpdateMode);
136
-
137
- $('#regeneration').dialog({
138
- height: 42,
139
- minHeight: 42,
140
- closeText: 'X',
141
- width: '75%',
142
- modal: true,
143
- autoOpen: false
144
- });
145
-
146
- $('#regenerate-images').click(function(){
147
- $('#regenerate-images-metabox img.ajax-feedback').css('visibility','visible');
148
- $.post(ajaxurl, { action: "ime_regeneration_get_images" }, function(data) {
149
- jQuery('#regen-message').addClass('hidden');
150
- $('#regenerate-images-metabox img.ajax-feedback').css('visibility','hidden');
151
- rt_images = data.split(",");
152
- rt_total = rt_images.length;
153
-
154
- if(rt_total > 0) {
155
- imeStartResize();
156
- } else {
157
- alert(ime_admin.noimg);
158
- }
159
- });
160
- });
161
- });
1
+ //Variables
2
+ var rt_images = "";
3
+ var rt_total = 1;
4
+ var rt_count = 1;
5
+ var rt_force = 0;
6
+ var rt_precision = 0;
7
+ var rt_sizes = "";
8
+
9
+ // Ajax test IM path
10
+ function imeTestPath () {
11
+ jQuery('.cli_path_icon').hide();
12
+ jQuery('#cli_path_progress').show();
13
+ jQuery.get(ajaxurl, {
14
+ action: "ime_test_im_path",
15
+ cli_path: jQuery('#cli_path').val()
16
+ }, function(data) {
17
+ jQuery('#cli_path_progress').hide();
18
+ r = parseInt(data);
19
+ if (r > 0) {
20
+ jQuery('#cli_path_yes').show();
21
+ jQuery('#cli_path_no').hide();
22
+ } else {
23
+ jQuery('#cli_path_yes').hide();
24
+ jQuery('#cli_path_no').show();
25
+ }
26
+ });
27
+ }
28
+
29
+ function imeStartResize() {
30
+ rt_sizes = "";
31
+ rt_force = 0;
32
+
33
+ jQuery('#regenerate-images-metabox input').each(function(){
34
+ var i = jQuery(this);
35
+ var name = i.attr('name');
36
+
37
+ if(i.is(':checked') && name && name.substring(0,11) == "regen-size-") {
38
+ rt_sizes = rt_sizes + name.substring(11) + "|";
39
+ }
40
+ });
41
+
42
+ if (jQuery('#force').is(':checked'))
43
+ rt_force = 1;
44
+
45
+ if (rt_total > 20000)
46
+ rt_precision = 3;
47
+ else if (rt_total > 2000)
48
+ rt_precision = 2;
49
+ else if (rt_total > 200)
50
+ rt_precision = 1;
51
+ else
52
+ rt_precision = 0;
53
+
54
+ var rt_percent = 0;
55
+
56
+ rt_count = 1;
57
+ jQuery("#regenbar").progressbar();
58
+ jQuery("#regenbar-percent").html( rt_percent.toFixed(rt_precision) + " %" );
59
+ jQuery('#regeneration').dialog( { 'dialogClass': 'ime-dialog' } ).dialog( 'open' );
60
+
61
+ imeRegenImages( rt_images.shift() );
62
+ }
63
+
64
+ //Regeneration of progressbar
65
+ function imeRegenImages( id ) {
66
+ jQuery.post(ajaxurl, { action: "ime_process_image", id: id, sizes: rt_sizes, force: rt_force }, function(data) {
67
+ var n = parseInt(data, 10);
68
+ if (isNaN(n)) {
69
+ alert(data);
70
+ }
71
+
72
+ // todo: test and handle negative return
73
+
74
+ if ( rt_images.length <= 0 ) {
75
+ jQuery('#regen-message').removeClass('hidden').html("<p><strong>" + ime_admin.done + "</strong> " + ime_admin.processed_fmt.replace('%d', rt_total) + ".</p>");
76
+ jQuery('#regeneration').dialog('close');
77
+ jQuery("#regenbar").progressbar( "value", 0 );
78
+ return;
79
+ }
80
+
81
+ var next_id = rt_images.shift();
82
+ var rt_percent = ( rt_count / rt_total ) * 100;
83
+ jQuery("#regenbar").progressbar( "value", rt_percent );
84
+ jQuery("#regenbar-percent").html( rt_percent.toFixed(rt_precision) + " %" );
85
+ rt_count = rt_count + 1;
86
+
87
+ // tail recursion
88
+ imeRegenImages(next_id);
89
+ });
90
+ }
91
+
92
+ // Regen single image on media pages
93
+ function imeRegenMediaImage( id, sizes, force ) {
94
+ var link = jQuery('#ime-regen-link-' + id);
95
+
96
+ if (link.hasClass('disabled'))
97
+ return false;
98
+
99
+ link.addClass('disabled');
100
+
101
+ var spinner = jQuery('#ime-spinner-' + id).children('img');
102
+ spinner.show();
103
+
104
+ var message = jQuery('#ime-message-' + id).show();
105
+ jQuery.post(ajaxurl, { action: "ime_process_image", id: id, sizes: sizes, force: force }, function(data) {
106
+ spinner.hide();
107
+ link.removeClass('disabled');
108
+
109
+ var n = parseInt(data, 10);
110
+ if (isNaN(n) || n < 0) {
111
+ message.html(ime_admin.failed);
112
+ if (isNaN(n))
113
+ alert(data);
114
+ } else {
115
+ message.html(ime_admin.resized);
116
+ }
117
+ });
118
+ }
119
+
120
+ function imeUpdateMode() {
121
+ jQuery("#ime-select-mode option").each(function(i,e) {
122
+ var o = jQuery(this);
123
+ var mode = o.val();
124
+ if (o.is(':selected'))
125
+ jQuery('#ime-row-' + mode).show();
126
+ else
127
+ jQuery('#ime-row-' + mode).hide();
128
+ });
129
+ }
130
+
131
+ jQuery(document).ready(function($) {
132
+ jQuery('#ime_cli_path_test').click(imeTestPath);
133
+
134
+ imeUpdateMode();
135
+ jQuery('#ime-select-mode').change(imeUpdateMode);
136
+
137
+ $('#regeneration').dialog({
138
+ height: 42,
139
+ minHeight: 42,
140
+ closeText: 'X',
141
+ width: '75%',
142
+ modal: true,
143
+ autoOpen: false
144
+ });
145
+
146
+ $('#regenerate-images').click(function(){
147
+ $('#regenerate-images-metabox img.ajax-feedback').css('visibility','visible');
148
+ $.post(ajaxurl, { action: "ime_regeneration_get_images" }, function(data) {
149
+ jQuery('#regen-message').addClass('hidden');
150
+ $('#regenerate-images-metabox img.ajax-feedback').css('visibility','hidden');
151
+ rt_images = data.split(",");
152
+ rt_total = rt_images.length;
153
+
154
+ if(rt_total > 0) {
155
+ imeStartResize();
156
+ } else {
157
+ alert(ime_admin.noimg);
158
+ }
159
+ });
160
+ });
161
+ });
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === ImageMagick Engine ===
2
- Contributors: rickardw, johanee
3
  Tags: image, images, picture, imagemagick, gd
4
  Requires at least: 2.9
5
- Tested up to: 4.1
6
- Stable tag: 1.5.1
7
 
8
  Improve the quality of re-sized images by replacing standard GD library with ImageMagick.
9
 
@@ -70,11 +70,13 @@ You'll probably have problems with various other plugins too unless you fix this
70
 
71
  == Screenshots ==
72
 
73
- 1. Example image: ImageMagick vs GD
74
- 2. Administration interface
75
 
76
  == Changelog ==
77
 
 
 
 
78
  = 1.5.2 =
79
  * Tested with WP 4.1
80
 
1
  === ImageMagick Engine ===
2
+ 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
 
70
 
71
  == Screenshots ==
72
 
73
+ 1. Administration interface
 
74
 
75
  == Changelog ==
76
 
77
+ = 1.5.3 =
78
+ * Tested with WP 5.0
79
+
80
  = 1.5.2 =
81
  * Tested with WP 4.1
82
 
screenshot-1.jpg CHANGED
Binary file
screenshot-2.jpg DELETED
Binary file