Changeset 408665
- Timestamp:
- 07/12/2011 08:53:28 AM (15 years ago)
- Location:
- imagemagick-engine
- Files:
-
- 6 edited
- 1 copied
-
tags/1.3.0 (copied) (copied from imagemagick-engine/trunk)
-
tags/1.3.0/imagemagick-engine.php (modified) (9 diffs)
-
tags/1.3.0/js/ime-admin.js (modified) (2 diffs)
-
tags/1.3.0/readme.txt (modified) (2 diffs)
-
trunk/imagemagick-engine.php (modified) (9 diffs)
-
trunk/js/ime-admin.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
imagemagick-engine/tags/1.3.0/imagemagick-engine.php
r380081 r408665 6 6 Author: Orangelab 7 7 Author URI: http://www.orangelab.se 8 Version: 1. 2.38 Version: 1.3.0 9 9 Text Domain: imagemagick-engine 10 10 … … 30 30 /* 31 31 * Current todo list: 32 * - position of resize progressbar in Chrome33 32 * - do not iterate through all images if only resizing non-ime images 34 33 * … … 378 377 $im->setImageCompressionQuality($quality); 379 378 } 380 $im->setImageOpacity(1.0); 379 if (method_exists($im, 'setImageOpacity')) 380 $im->setImageOpacity(1.0); 381 381 382 382 if ($crop) { … … 435 435 } 436 436 437 /* 438 * Try to get realpath of path 439 * 440 * This won't work if there is open_basename restrictions. 441 */ 442 function ime_try_realpath($path) { 443 $realpath = @realpath($path); 444 if ($realpath) 445 return $realpath; 446 else 447 return $path; 448 } 449 437 450 // Check if path leads to ImageMagick executable 438 451 function ime_im_cli_check_command($path, $executable='convert') { 439 $path = realpath($path); 440 if (!is_dir($path)) 441 return null; 452 $path = ime_try_realpath($path); 442 453 443 454 $cmd = $path . '/' . $executable; … … 457 468 458 469 foreach ($possible_paths AS $path) { 459 /*460 * This operation would give a warning if path is restricted by461 * open_basedir.462 */463 $path = @realpath($path);464 if (!$path)465 continue;466 470 if (ime_im_cli_check_command($path, $executable)) 467 471 return $path; … … 493 497 $new_file = addslashes($new_file); 494 498 495 $cmd = "\"$cmd\" -limit memory 150mb -limit map 128mb -size {$width}x{$height} \"{$old_file}\" -resize {$width}x{$height}"; 499 // limits are 150mb and 128mb 500 $cmd = "\"$cmd\" -limit memory 157286400 -limit map 134217728 -size {$width}x{$height} \"{$old_file}\" -resize {$width}x{$height}"; 496 501 if ($crop) 497 502 $cmd .= "^ -gravity center -extent {$width}x{$height}"; 503 else 504 $cmd .= "!"; // force these dimensions 498 505 499 506 $quality = ime_get_option('quality', '-1'); … … 747 754 ime_set_option('mode', $_POST['mode']); 748 755 if (isset($_POST['cli_path'])) 749 ime_set_option('cli_path', realpath($_POST['cli_path']));756 ime_set_option('cli_path', ime_try_realpath(trim($_POST['cli_path']))); 750 757 if (isset($_POST['quality'])) { 751 758 if (is_numeric($_POST['quality'])) … … 829 836 <?php 830 837 foreach($sizes AS $s => $name) { 831 echo '<input type="checkbox" name="regen-size-' . $s . '" value="1" ' . ( $handle_sizes[$s] ? ' CHECKED ' : '') . ' /> ' . $name . '<br />';838 echo '<input type="checkbox" name="regen-size-' . $s . '" value="1" ' . (isset($handle_sizes[$s]) && $handle_sizes[$s] ? ' CHECKED ' : '') . ' /> ' . $name . '<br />'; 832 839 } 833 840 ?> … … 910 917 <?php 911 918 foreach($sizes AS $s => $name) { 912 echo '<input type="checkbox" name="handle-' . $s . '" value="1" ' . ( $handle_sizes[$s] ? ' CHECKED ' : '') . ' /> ' . $name . '<br />';919 echo '<input type="checkbox" name="handle-' . $s . '" value="1" ' . (isset($handle_sizes[$s]) && $handle_sizes[$s] ? ' CHECKED ' : '') . ' /> ' . $name . '<br />'; 913 920 } 914 921 ?> -
imagemagick-engine/tags/1.3.0/js/ime-admin.js
r332392 r408665 31 31 32 32 jQuery('#regenerate-images-metabox input').each(function(){ 33 if(jQuery(this).attr('name').substring(0,11) == "regen-size-" && jQuery(this).attr('checked')) { 34 rt_sizes = rt_sizes + jQuery(this).attr('name').substring(11) + "|"; 33 var i = jQuery(this); 34 var name = i.attr('name'); 35 36 if(i.is(':checked') && name && name.substring(0,11) == "regen-size-") { 37 rt_sizes = rt_sizes + name.substring(11) + "|"; 35 38 } 36 39 }); 37 40 38 if(jQuery('#force'). attr('checked')) {41 if(jQuery('#force').is(':checked')) { 39 42 rt_force = 1; 40 43 } … … 72 75 var o = jQuery(this); 73 76 var mode = o.val(); 74 if (o. attr('selected'))77 if (o.is(':selected')) 75 78 jQuery('#ime-row-' + mode).show(); 76 79 else -
imagemagick-engine/tags/1.3.0/readme.txt
r380081 r408665 3 3 Tags: image, images, picture, imagemagick, gd 4 4 Requires at least: 2.9 5 Tested up to: 3. 1.26 Stable tag: 1. 2.35 Tested up to: 3.2 6 Stable tag: 1.3.0 7 7 8 8 Improve the quality of re-sized images by replacing standard GD library with ImageMagick. … … 75 75 == Changelog == 76 76 77 = 1.3.0 = 78 * Tested agains WP 3.2 79 * Fix JS to be compatible with jQuery 1.6 80 * Remove some PHP notices 81 * Change command line limit values to specifik byte amounts (instead of "mb") for compatability with really old IM versions 82 * Handle open_basename restrictions better 83 * Handle older versions (pre 6.3.1) of PHP Imagick class 84 * IM and WordPress compute aspect ratio slightly differently, force the WP values 85 77 86 = 1.2.3 = 78 87 * Fix bug in resize all images handling, also remove some PHP notices. Thanks to Andreas Kleinschmidt for the report -
imagemagick-engine/trunk/imagemagick-engine.php
r380081 r408665 6 6 Author: Orangelab 7 7 Author URI: http://www.orangelab.se 8 Version: 1. 2.38 Version: 1.3.0 9 9 Text Domain: imagemagick-engine 10 10 … … 30 30 /* 31 31 * Current todo list: 32 * - position of resize progressbar in Chrome33 32 * - do not iterate through all images if only resizing non-ime images 34 33 * … … 378 377 $im->setImageCompressionQuality($quality); 379 378 } 380 $im->setImageOpacity(1.0); 379 if (method_exists($im, 'setImageOpacity')) 380 $im->setImageOpacity(1.0); 381 381 382 382 if ($crop) { … … 435 435 } 436 436 437 /* 438 * Try to get realpath of path 439 * 440 * This won't work if there is open_basename restrictions. 441 */ 442 function ime_try_realpath($path) { 443 $realpath = @realpath($path); 444 if ($realpath) 445 return $realpath; 446 else 447 return $path; 448 } 449 437 450 // Check if path leads to ImageMagick executable 438 451 function ime_im_cli_check_command($path, $executable='convert') { 439 $path = realpath($path); 440 if (!is_dir($path)) 441 return null; 452 $path = ime_try_realpath($path); 442 453 443 454 $cmd = $path . '/' . $executable; … … 457 468 458 469 foreach ($possible_paths AS $path) { 459 /*460 * This operation would give a warning if path is restricted by461 * open_basedir.462 */463 $path = @realpath($path);464 if (!$path)465 continue;466 470 if (ime_im_cli_check_command($path, $executable)) 467 471 return $path; … … 493 497 $new_file = addslashes($new_file); 494 498 495 $cmd = "\"$cmd\" -limit memory 150mb -limit map 128mb -size {$width}x{$height} \"{$old_file}\" -resize {$width}x{$height}"; 499 // limits are 150mb and 128mb 500 $cmd = "\"$cmd\" -limit memory 157286400 -limit map 134217728 -size {$width}x{$height} \"{$old_file}\" -resize {$width}x{$height}"; 496 501 if ($crop) 497 502 $cmd .= "^ -gravity center -extent {$width}x{$height}"; 503 else 504 $cmd .= "!"; // force these dimensions 498 505 499 506 $quality = ime_get_option('quality', '-1'); … … 747 754 ime_set_option('mode', $_POST['mode']); 748 755 if (isset($_POST['cli_path'])) 749 ime_set_option('cli_path', realpath($_POST['cli_path']));756 ime_set_option('cli_path', ime_try_realpath(trim($_POST['cli_path']))); 750 757 if (isset($_POST['quality'])) { 751 758 if (is_numeric($_POST['quality'])) … … 829 836 <?php 830 837 foreach($sizes AS $s => $name) { 831 echo '<input type="checkbox" name="regen-size-' . $s . '" value="1" ' . ( $handle_sizes[$s] ? ' CHECKED ' : '') . ' /> ' . $name . '<br />';838 echo '<input type="checkbox" name="regen-size-' . $s . '" value="1" ' . (isset($handle_sizes[$s]) && $handle_sizes[$s] ? ' CHECKED ' : '') . ' /> ' . $name . '<br />'; 832 839 } 833 840 ?> … … 910 917 <?php 911 918 foreach($sizes AS $s => $name) { 912 echo '<input type="checkbox" name="handle-' . $s . '" value="1" ' . ( $handle_sizes[$s] ? ' CHECKED ' : '') . ' /> ' . $name . '<br />';919 echo '<input type="checkbox" name="handle-' . $s . '" value="1" ' . (isset($handle_sizes[$s]) && $handle_sizes[$s] ? ' CHECKED ' : '') . ' /> ' . $name . '<br />'; 913 920 } 914 921 ?> -
imagemagick-engine/trunk/js/ime-admin.js
r332392 r408665 31 31 32 32 jQuery('#regenerate-images-metabox input').each(function(){ 33 if(jQuery(this).attr('name').substring(0,11) == "regen-size-" && jQuery(this).attr('checked')) { 34 rt_sizes = rt_sizes + jQuery(this).attr('name').substring(11) + "|"; 33 var i = jQuery(this); 34 var name = i.attr('name'); 35 36 if(i.is(':checked') && name && name.substring(0,11) == "regen-size-") { 37 rt_sizes = rt_sizes + name.substring(11) + "|"; 35 38 } 36 39 }); 37 40 38 if(jQuery('#force'). attr('checked')) {41 if(jQuery('#force').is(':checked')) { 39 42 rt_force = 1; 40 43 } … … 72 75 var o = jQuery(this); 73 76 var mode = o.val(); 74 if (o. attr('selected'))77 if (o.is(':selected')) 75 78 jQuery('#ime-row-' + mode).show(); 76 79 else -
imagemagick-engine/trunk/readme.txt
r380081 r408665 3 3 Tags: image, images, picture, imagemagick, gd 4 4 Requires at least: 2.9 5 Tested up to: 3. 1.26 Stable tag: 1. 2.35 Tested up to: 3.2 6 Stable tag: 1.3.0 7 7 8 8 Improve the quality of re-sized images by replacing standard GD library with ImageMagick. … … 75 75 == Changelog == 76 76 77 = 1.3.0 = 78 * Tested agains WP 3.2 79 * Fix JS to be compatible with jQuery 1.6 80 * Remove some PHP notices 81 * Change command line limit values to specifik byte amounts (instead of "mb") for compatability with really old IM versions 82 * Handle open_basename restrictions better 83 * Handle older versions (pre 6.3.1) of PHP Imagick class 84 * IM and WordPress compute aspect ratio slightly differently, force the WP values 85 77 86 = 1.2.3 = 78 87 * Fix bug in resize all images handling, also remove some PHP notices. Thanks to Andreas Kleinschmidt for the report
Note: See TracChangeset
for help on using the changeset viewer.