Skip to content

Commit

Permalink
Added a fix to help user profile pictures under safe mode (from Mahmo…
Browse files Browse the repository at this point in the history
…ud H. Hasan)

PHP manual mentions it too.
  • Loading branch information
moodler committed Jan 28, 2006
1 parent 0600f5b commit fe9f19e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/gdlib.php
Expand Up @@ -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);
Expand Down

0 comments on commit fe9f19e

Please sign in to comment.