Skip to content

Commit

Permalink
imgStore excludes gif
Browse files Browse the repository at this point in the history
  • Loading branch information
get-got committed Nov 28, 2020
1 parent 84590c7 commit f9da240
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions downloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,14 +529,14 @@ func tryDownload(inputURL string, filename string, path string, message *discord
}

// Check extension
extension := filepath.Ext(filename)
extension := strings.ToLower(filepath.Ext(filename))
if stringInSlice(extension, *channelConfig.ExtensionBlacklist) || stringInSlice(extension, []string{".com", ".net", ".org"}) {
log.Println(logPrefixFileSkip, color.GreenString("Unpermitted extension (%s) found at %s", extension, inputURL))
return mDownloadStatus(downloadSkippedUnpermittedExtension)
}

// Duplicate Image Filter
if config.FilterDuplicateImages && contentTypeFound == "image" {
if config.FilterDuplicateImages && contentTypeFound == "image" && extension != ".gif" && extension != ".webp" {
img, _, err := image.Decode(bytes.NewReader(bodyOfResp))
if err != nil {
log.Println(color.HiRedString("Error converting buffer to image for hashing:\t%s", err))
Expand Down

0 comments on commit f9da240

Please sign in to comment.