add ability to set maximum pixel length of uploaded pictures

This commit is contained in:
Zach Prezkuta 2012-06-28 10:33:21 -06:00
commit 3fe5bdbd8d
2 changed files with 24 additions and 0 deletions

View file

@ -743,6 +743,12 @@ function photos_post(&$a) {
$ph->orient($src);
@unlink($src);
$max_length = get_config('system','max_image_length');
if(! $max_length)
$max_length = MAX_IMAGE_LENGTH;
if($max_length > 0)
$ph->scaleImage($max_length);
$width = $ph->getWidth();
$height = $ph->getHeight();