Permalink
Browse files

placing uploaded images in different directory from previously uploaded

images to differentiate between bordered and borderless images
  • Loading branch information...
1 parent 34e85ec commit 4e95baef3c6bc92e581c6e69c48a57a0279b4f36 bawjaws committed Jul 6, 2005
Showing with 5 additions and 17 deletions.
  1. +5 −17 lib/gdlib.php
View
@@ -182,27 +182,15 @@ function save_profile_image($id, $uploadmanager, $dir='users') {
ImageCopyBicubic($im1, $im, 0, 0, $cx-$half, $cy-$half, 100, 100, $half*2, $half*2);
ImageCopyBicubic($im2, $im, 0, 0, $cx-$half, $cy-$half, 35, 35, $half*2, $half*2);
- // Draw borders over the top.
- $black1 = ImageColorAllocate ($im1, 0, 0, 0);
- $black2 = ImageColorAllocate ($im2, 0, 0, 0);
- ImageLine ($im1, 0, 0, 0, 99, $black1);
- ImageLine ($im1, 0, 99, 99, 99, $black1);
- ImageLine ($im1, 99, 99, 99, 0, $black1);
- ImageLine ($im1, 99, 0, 0, 0, $black1);
- ImageLine ($im2, 0, 0, 0, 34, $black2);
- ImageLine ($im2, 0, 34, 34, 34, $black2);
- ImageLine ($im2, 34, 34, 34, 0, $black2);
- ImageLine ($im2, 34, 0, 0, 0, $black2);
-
- 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);
- @chmod($CFG->dataroot .'/'. $dir .'/'. $id .'/f2.jpg', 0666);
+ if (ImageJpeg($im1, $CFG->dataroot .'/'. $dir .'/'. $id .'/user100.jpg', 90) and
+ ImageJpeg($im2, $CFG->dataroot .'/'. $dir .'/'. $id .'/user35.jpg', 95) ) {
+ @chmod($CFG->dataroot .'/'. $dir .'/'. $id .'/user100.jpg', 0666);
+ @chmod($CFG->dataroot .'/'. $dir .'/'. $id .'/user35.jpg', 0666);
return 1;
} else {
return 0;
}
}
-?>
+?>

0 comments on commit 4e95bae

Please sign in to comment.