Fails when the image extension is different than mime type.
We have shops logo, given by external api.
Where, even though a file might have extension of type 'png', it's mime type is a 'gif'.
In those cases, the library throws an exception:
Command failed, return code: 25, command: /usr/bin/pngquant '--force' '--ext=.png' '--' '/home/vagrant/Code/pigogo/pigogo/public/user-assets/Files/stores/mg-manager.png' 1> /dev/null 2> /dev/null Dev note: Probably the image is a different type than that of file extension.
This pull request fixes this.
TODO:
Verify all different mime types. The current tests verifies .png with jpg mime type
Guard against invalid mime types: should throw exception if file mime type is other than the acceptable ones.
Fails when the image extension is different than mime type.
We have shops logo, given by external api.
Where, even though a file might have extension of type 'png', it's mime type is a 'gif'.
In those cases, the library throws an exception:
This pull request fixes this.
TODO: