forum.coppermine-gallery.net

No Support => Announcements => Topic started by: kegobeer on November 02, 2005, 11:56:47 pm

Title: Coppermine and PHP 4.4.1 - imagejpeg workaround
Post by: kegobeer on November 02, 2005, 11:56:47 pm
If your server is running PHP 4.4.1 and is also running in safe mode, you may have issues with uploading jpeg images.  You may receive this type of error message:

Unable to create thumbnail or reduced size image.
imagejpeg(): unable to access

There is a bug report at bugs.php.net about safe_mode and imagejpeg() in 4.4.1.

http://bugs.php.net/?id=35060

This workaround will fix the issue, until a fix from PHP is released.  Open up picmgmt.inc.php, find (around line 209)

Code: [Select]
imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);
and replace with

Code: [Select]
$fh=fopen($dest_file,'w');
fclose($fh);
imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);

If you are using GD1, look a few lines above and make a similar change.
Title: Re: Coppermine and PHP 4.4.1 - imagejpeg workaround
Post by: JDuc on November 28, 2005, 11:38:17 pm
where should picmgmt.inc.php be located?  what folder?

thanks :)
Title: Re: Coppermine and PHP 4.4.1 - imagejpeg workaround
Post by: Nibbler on November 28, 2005, 11:40:13 pm
It's under include.  ::)
Title: Re: Coppermine and PHP 4.4.1 - imagejpeg workaround
Post by: dizydizzy on December 01, 2005, 09:44:46 pm
After 3 days of searching this forum I finally found the answer here in this thread...thnx to Kegobeer I finally got CPM to work.

Big  :-* to you.  ;)
Title: Re: Coppermine and PHP 4.4.1 - imagejpeg workaround
Post by: Poom on December 04, 2005, 06:45:20 pm
This won't work for me :(
Title: Re: Coppermine and PHP 4.4.1 - imagejpeg workaround
Post by: kegobeer on December 04, 2005, 11:08:13 pm
Quote from: Poom
This won't work for me

Because you did not apply the fix correctly, as stated in your related thread.

This thread is now locked.
Title: Re: Coppermine and PHP 4.4.1 - imagejpeg workaround
Post by: Joachim Müller on February 24, 2006, 05:32:23 pm
@dev team: should this go into the maintenance release?
Title: Re: Coppermine and PHP 4.4.1 - imagejpeg workaround
Post by: Nibbler on February 24, 2006, 05:44:40 pm
Will do.
Title: Re: Coppermine and PHP 4.4.1 - imagejpeg workaround
Post by: Joachim Müller on February 26, 2006, 06:54:47 pm
The code in this fix has gone into cpg1.4.4 - users running any previous versions may have to apply the fix, users who run cpg1.4.4 (or better) won't have to.

[edit GauGau 2006-03-01]
The fix didn't go into cpg1.4.4, sorry folks - see postings below
[/edit]
Title: Re: Coppermine and PHP 4.4.1 - imagejpeg workaround
Post by: kegobeer on March 01, 2006, 07:07:21 pm
I don't see it in the 1.4.4 release.
Title: Re: Coppermine and PHP 4.4.1 - imagejpeg workaround
Post by: Joachim Müller on March 01, 2006, 07:55:03 pm
dang, something went wrong:  the last-minute commit didn't make it into the package. Oh well, sorry then: I edited my above posting accordingly.
Title: Re: Coppermine and PHP 4.4.1 - imagejpeg workaround
Post by: Joachim Müller on May 18, 2006, 06:12:51 am
The fix has gone into stable and devel branch today. This means that the fix will go into cpg1.4.6. All users who run an older version together with PHP4.4.1 will have to apply the fix manually (or even better upgrade to cpg1.4.6 once it got released).