Permalink
Browse files

Error checking on image writes

  • Loading branch information...
1 parent b913b36 commit f10ed36d8decdc7be56831e967c20dc5e54ec99a moodler committed Nov 21, 2002
Showing with 6 additions and 3 deletions.
  1. +6 −3 user/lib.php
View
@@ -113,9 +113,12 @@ function save_user_image($userid, $filename) {
ImageLine ($im2, 34, 34, 34, 0, $black2);
ImageLine ($im2, 34, 0, 0, 0, $black2);
- ImageJpeg($im1, "$CFG->dataroot/users/$userid/f1.jpg", 90);
- ImageJpeg($im2, "$CFG->dataroot/users/$userid/f2.jpg", 95);
- return 1;
+ if (ImageJpeg($im1, "$CFG->dataroot/users/$userid/f1.jpg", 90) and
+ ImageJpeg($im2, "$CFG->dataroot/users/$userid/f2.jpg", 95) ) {
+ return 1;
+ } else {
+ return 0;
+ }
}
}

0 comments on commit f10ed36

Please sign in to comment.