From fe9f19ef1e59377fec0698614f199d2fa4aa4e22 Mon Sep 17 00:00:00 2001 From: moodler Date: Sat, 28 Jan 2006 14:15:56 +0000 Subject: [PATCH] Added a fix to help user profile pictures under safe mode (from Mahmoud H. Hasan) PHP manual mentions it too. --- lib/gdlib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/gdlib.php b/lib/gdlib.php index 8e007f0884b..09b2ab313fd 100644 --- a/lib/gdlib.php +++ b/lib/gdlib.php @@ -183,6 +183,8 @@ function save_profile_image($id, $uploadmanager, $dir='users') { ImageCopyBicubic($im2, $im, 0, 0, $cx-$half, $cy-$half, 35, 35, $half*2, $half*2); if (function_exists('ImageJpeg')) { + @touch($CFG->dataroot .'/'. $dir .'/'. $id .'/f1.jpg'); // Helps in Safe mode + @touch($CFG->dataroot .'/'. $dir .'/'. $id .'/f2.jpg'); // Helps in Safe mode if (ImageJpeg($im1, $CFG->dataroot .'/'. $dir .'/'. $id .'/f1.jpg', 90) and ImageJpeg($im2, $CFG->dataroot .'/'. $dir .'/'. $id .'/f2.jpg', 95) ) { @chmod($CFG->dataroot .'/'. $dir .'/'. $id .'/f1.jpg', 0666);