Skip to content

Commit

Permalink
🎨 more image type support
Browse files Browse the repository at this point in the history
  • Loading branch information
acidjazz committed Oct 12, 2023
1 parent 8cd6a0c commit 74ca750
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,18 @@ func getExtension(bytes []byte) (string, string, error) {
contentType := http.DetectContentType(bytes)

switch contentType {
case "image/jpg":
extension = "jpg"
case "image/jpeg":
extension = "jpg"
case "image/png":
extension = "png"
case "image/gif":
extension = "gif"
case "image/webp":
extension = "webp"
case "image/svg":
extension = "webp"
default:
return "", "", errors.New("unable to detect Content Type: " + contentType)
}
Expand Down

0 comments on commit 74ca750

Please sign in to comment.