diff --git a/lib/Artwork.php b/lib/Artwork.php index 2533bad6..dc159742 100644 --- a/lib/Artwork.php +++ b/lib/Artwork.php @@ -509,8 +509,8 @@ class Artwork{ } } - if($this->MimeType === null && !$error->Has('Exceptions\InvalidImageUploadException')){ - // Only notify of wrong mimetype if there is no other problem with the uploaded image + if($imagePath !== null && $this->MimeType === null && !$error->Has('Exceptions\InvalidImageUploadException')){ + // Only notify of wrong mimetype if there are no other problem with the uploaded image $error->Add(new Exceptions\InvalidMimeTypeException()); } diff --git a/www/artworks/post.php b/www/artworks/post.php index 98897d5f..13c30abb 100644 --- a/www/artworks/post.php +++ b/www/artworks/post.php @@ -68,6 +68,10 @@ try{ $artwork->Status = $newStatus; } + if(HttpInput::File('artwork-image') === null){ + $artwork->MimeType = $originalArtwork->MimeType; + } + $artwork->Save(HttpInput::File('artwork-image')); $_SESSION['artwork'] = $artwork;