magesuite / brand-management

Open Software License 3.0
4 stars 3 forks source link

Validation #6

Closed koria closed 3 years ago

koria commented 3 years ago

Problem with ImageContentValidator #5

            $imageProperties = @getimagesizefromstring($fileContent);
            if (empty($imageProperties)) {
                throw new InputException(new Phrase('The image content must be valid base64 encoded data.'));
            }
            $sourceMimeType = $imageProperties['mime'];

getimagesizefromstring () returns null for .svg images just wrap this method with the isSvg () method and we can load .svg images via the API

Need more refactor, but now it works without problems