• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] CI3.1.0 image library broken

#1
The image library has been broken when using Imagemagik since version 3.1.0. I've reported this twice now.

https://github.com/bcit-ci/CodeIgniter/issues/4902
Reply

#2
(11-04-2016, 07:26 AM)spjonez Wrote: The image library has been broken when using Imagemagik since version 3.1.0. I've reported this twice now.

https://github.com/bcit-ci/CodeIgniter/issues/4902

I managed to fix the Image_lib.php by adding a space:

CodeIgniter-3.1.2/system/libraries/Image_lib.php
// about line 888
PHP Code:
# John_Betong ADDED LEADING SPACE - 2016-11-05
  
$cmd .= ' ' .escapeshellarg($this->full_src_path) .' '.escapeshellarg($this->full_dst_path).' 2>&1'

Edit:
Problem was no space after the image dimensions:
Quote:/* # ORIGINAL HAS MISSING LEADING SPACE
$cmd .= escapeshellarg($this->full_src_path).' '.escapeshellarg($this->full_dst_path).' 2>&1';

$cmd = '
/etc/alternatives/convert
-quality 84
-resize 128x100'/home/john-betong/www/afiles/images/douglas-adams-happy-towel-day.jpg'
'/home/john-betong/www/thumb/douglas-adams-happy-towel-day_thumb.jpg' 2>&1'
;

*/
Reply

#3
(11-06-2016, 11:14 PM)John_Betong Wrote:
(11-04-2016, 07:26 AM)spjonez Wrote: The image library has been broken when using Imagemagik since version 3.1.0. I've reported this twice now.

https://github.com/bcit-ci/CodeIgniter/issues/4902

I managed to fix the Image_lib.php by adding a space:

CodeIgniter-3.1.2/system/libraries/Image_lib.php
// about line 888
PHP Code:
# John_Betong ADDED LEADING SPACE - 2016-11-05
 
 $cmd .= ' ' .escapeshellarg($this->full_src_path) .' '.escapeshellarg($this->full_dst_path).' 2>&1'

Edit:
Problem was no space after the image dimensions:
Quote:/* # ORIGINAL HAS MISSING LEADING SPACE
 $cmd .= escapeshellarg($this->full_src_path).' '.escapeshellarg($this->full_dst_path).' 2>&1';

 $cmd = '
 /etc/alternatives/convert
  -quality 84
  -resize 128x100'/home/john-betong/www/afiles/images/douglas-adams-happy-towel-day.jpg'
 '/home/john-betong/www/thumb/douglas-adams-happy-towel-day_thumb.jpg' 2>&1'
;

*/

Yes I know I included the proper fix in both of the GitHub issues I opened. Thanks for posting it here in case others run into it and don't check the repo.
Reply

#4
(11-07-2016, 06:15 AM)spjonez Wrote:
(11-06-2016, 11:14 PM)John_Betong Wrote:
(11-04-2016, 07:26 AM)spjonez Wrote: The image library has been broken when using Imagemagik since version 3.1.0. I've reported this twice now.

https://github.com/bcit-ci/CodeIgniter/issues/4902

I managed to fix the Image_lib.php by adding a space:

CodeIgniter-3.1.2/system/libraries/Image_lib.php
// about line 888
PHP Code:
# John_Betong ADDED LEADING SPACE - 2016-11-05
 
 $cmd .= ' ' .escapeshellarg($this->full_src_path) .' '.escapeshellarg($this->full_dst_path).' 2>&1'

Edit:
Problem was no space after the image dimensions:
Quote:/* # ORIGINAL HAS MISSING LEADING SPACE
 $cmd .= escapeshellarg($this->full_src_path).' '.escapeshellarg($this->full_dst_path).' 2>&1';

 $cmd = '
 /etc/alternatives/convert
  -quality 84
  -resize 128x100'/home/john-betong/www/afiles/images/douglas-adams-happy-towel-day.jpg'
 '/home/john-betong/www/thumb/douglas-adams-happy-towel-day_thumb.jpg' 2>&1'
;

*/

Yes I know I included the proper fix in both of the GitHub issues I opened. Thanks for posting it here in case others run into it and don't check the repo.

I tried this method but doesn't work for me. Finnaly I switched back to CI 3.1.0. Sad
Reply

#5
(11-08-2016, 11:19 PM)andoyoandoyo Wrote:
(11-07-2016, 06:15 AM)spjonez Wrote:
(11-06-2016, 11:14 PM)John_Betong Wrote:
(11-04-2016, 07:26 AM)spjonez Wrote: The image library has been broken when using Imagemagik since version 3.1.0. I've reported this twice now.

https://github.com/bcit-ci/CodeIgniter/issues/4902

I managed to fix the Image_lib.php by adding a space:

CodeIgniter-3.1.2/system/libraries/Image_lib.php
// about line 888
PHP Code:
# John_Betong ADDED LEADING SPACE - 2016-11-05
 
 $cmd .= ' ' .escapeshellarg($this->full_src_path) .' '.escapeshellarg($this->full_dst_path).' 2>&1'

Edit:
Problem was no space after the image dimensions:
Quote:/* # ORIGINAL HAS MISSING LEADING SPACE
 $cmd .= escapeshellarg($this->full_src_path).' '.escapeshellarg($this->full_dst_path).' 2>&1';

 $cmd = '
 /etc/alternatives/convert
  -quality 84
  -resize 128x100'/home/john-betong/www/afiles/images/douglas-adams-happy-towel-day.jpg'
 '/home/john-betong/www/thumb/douglas-adams-happy-towel-day_thumb.jpg' 2>&1'
;

*/

Yes I know I included the proper fix in both of the GitHub issues I opened. Thanks for posting it here in case others run into it and don't check the repo.

I tried this method but doesn't work for me. Finnaly I switched back to CI 3.1.0. Sad

I ran into a similar issue.  See my notes.  The issue related to something I didn't have initiated within my PHP install.  In CI 3.1.1, they removed a contingency check:  if (function_exists('finfo_file')) { }.  Removing that caused my upload functionality to bomb out, due to not having php_fileinfo initiated in my install.  Once I initiated that, and restarted the web services, things worked fine.  
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.