From bb531d6284e3a936e8e2184104edd9a665c5c363 Mon Sep 17 00:00:00 2001 From: Omar Date: Fri, 29 Jun 2012 10:48:28 -0300 Subject: Fixing imagemagick maintain ratio not implemented --- system/libraries/Image_lib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 4735dfd08..ebd214ef0 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -855,7 +855,10 @@ class CI_Image_lib { } else // Resize { - $cmd .= ' -resize '.$this->width.'x'.$this->height.' "'.$this->full_src_path.'" "'.$this->full_dst_path.'" 2>&1'; + if($this->maintain_ratio) + $cmd .= " -resize ".$this->width."x".$this->height." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; + else + $cmd .= " -resize ".$this->width."x".$this->height."\\! \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; } $retval = 1; -- cgit v1.2.3-24-g4f1b From 24063af4005804e271ac04fecca4a410a0a7b269 Mon Sep 17 00:00:00 2001 From: Omar Date: Mon, 2 Jul 2012 13:50:17 -0300 Subject: Fixed code styling --- system/libraries/Image_lib.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index ebd214ef0..899b995d4 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -855,10 +855,14 @@ class CI_Image_lib { } else // Resize { - if($this->maintain_ratio) - $cmd .= " -resize ".$this->width."x".$this->height." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; + if($this->maintain_ratio === TRUE) + { + $cmd .= ' -resize '.$this->width.'x'.$this->height.' "'.$this->full_src_path.'" "'.$this->full_dst_path.'" 2>&1'; + } else - $cmd .= " -resize ".$this->width."x".$this->height."\\! \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; + { + $cmd .= ' -resize '.$this->width.'x'.$this->height.'\! "'.$this->full_src_path.'" "'.$this->full_dst_path.'" 2>&1'; + } } $retval = 1; -- cgit v1.2.3-24-g4f1b From 655cfb789ec2a818ab0c8735224db1a4f79cdef0 Mon Sep 17 00:00:00 2001 From: Omar Date: Mon, 2 Jul 2012 13:53:00 -0300 Subject: Added changelog entry --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index d2774ca12..a2446259a 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -150,6 +150,7 @@ Release Date: Not Released - Added support for 3-length hex color values for wm_font_color and wm_shadow_color properties, as well as validation for them. - Class properties wm_font_color, wm_shadow_color and wm_use_drop_shadow are now protected, to avoid breaking the text_watermark() method if they are set manually after initialization. - If property maintain_ratio is set to TRUE, image_reproportion() now doesn't need both width and height to be specified. + - Property maintain_ratio is now taken into account when resizing images using ImageMagick library - Removed SHA1 function in the :doc:`Encryption Library `. - Added $config['csrf_regeneration'] to the CSRF protection in the :doc:`Security library `, which makes token regeneration optional. - Added $config['csrf_exclude_uris'] to the CSRF protection in the :doc:`Security library `, which allows you list URIs which will not have the CSRF validation functions run. -- cgit v1.2.3-24-g4f1b