Coppermine and PHP 4.4.1 - imagejpeg workaround Coppermine and PHP 4.4.1 - imagejpeg workaround
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Coppermine and PHP 4.4.1 - imagejpeg workaround

Started by kegobeer, November 02, 2005, 11:56:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kegobeer

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)

imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);

and replace with

$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.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

JDuc

where should picmgmt.inc.php be located?  what folder?

thanks :)


dizydizzy

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.  ;)

Poom


kegobeer

Quote from: PoomThis won't work for me

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

This thread is now locked.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Joachim Müller

@dev team: should this go into the maintenance release?


Joachim Müller

#8
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]

kegobeer

Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Joachim Müller

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.

Joachim Müller

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).