- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @author Zach Copley <zach@controlyourself.ca>
- * @copyright 2008-2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @author Zach Copley <zach@status.net>
+ * @copyright 2008-2009 StatusNet, Inc.
- case UPLOAD_ERR_INI_SIZE:
- case UPLOAD_ERR_FORM_SIZE:
- throw new Exception(sprintf(_('That file is too big. The maximum file size is %d.'), $this->maxFileSize()));
+ case UPLOAD_ERR_INI_SIZE:
+ case UPLOAD_ERR_FORM_SIZE:
+ throw new Exception(sprintf(_('That file is too big. The maximum file size is %s.'),
+ ImageFile::maxFileSize()));
+ case UPLOAD_ERR_NO_FILE:
+ // No file; probably just a non-AJAX submission.
+ return;
+ default:
+ common_log(LOG_ERR, __METHOD__ . ": Unknown upload error " .
+ $_FILES[$param]['error']);
$outpath = Avatar::path($outname);
@copy($this->filepath, $outpath);
return $outname;
$outpath = Avatar::path($outname);
@copy($this->filepath, $outpath);
return $outname;
imagecopyresampled($image_dest, $image_src, 0, 0, $x, $y, $size, $size, $w, $h);
$outname = Avatar::filename($this->id,
imagecopyresampled($image_dest, $image_src, 0, 0, $x, $y, $size, $size, $w, $h);
$outname = Avatar::filename($this->id,
$num = substr($str, 0, -1);
switch(strtoupper($unit)){
$num = substr($str, 0, -1);
switch(strtoupper($unit)){