Add minimum artwork dimensions

This commit is contained in:
Alex Cabal 2024-01-08 13:48:56 -06:00
parent 3d85a6d936
commit 5b6a334dd0
4 changed files with 21 additions and 2 deletions

View file

@ -365,7 +365,13 @@ class Artwork extends PropertiesBase{
}
if(!is_uploaded_file($uploadedFile['tmp_name'])){
throw new Exceptions\InvalidImageUploadException();
$error->Add(new Exceptions\InvalidImageUploadException());
}
// Check for minimum dimensions
list($imageWidth, $imageHeight) = getimagesize($uploadedFile['tmp_name']);
if(!$imageWidth || !$imageHeight || $imageWidth < COVER_ARTWORK_IMAGE_MINIMUM_WIDTH || $imageHeight < COVER_ARTWORK_IMAGE_MINIMUM_HEIGHT){
$error->Add(new Exceptions\ArtworkImageDimensionsTooSmallException());
}
}