Skip to content

Commit

Permalink
Check server-supported thumbnail types too
Browse files Browse the repository at this point in the history
Fixes #460
  • Loading branch information
turt2live committed Sep 8, 2023
1 parent a877bd2 commit af45aaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Fixed

* Fixed media purge API not being able to delete thumbnails.
* Fixed thumbnails being attempted for disabled media types.

## [1.3.0] - September 8, 2023

Expand Down
4 changes: 4 additions & 0 deletions thumbnailing/thumbnail.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ func GenerateThumbnail(imgStream io.ReadCloser, contentType string, width int, h
ctx.Log.Debugf("Unsupported content type '%s'", contentType)
return nil, ErrUnsupported
}
if !util.ArrayContains(ctx.Config.Thumbnails.Types, contentType) {
ctx.Log.Debugf("Disabled content type '%s'", contentType)
return nil, ErrUnsupported
}

generator, reconstructed := i.GetGenerator(imgStream, contentType, animated)
if generator == nil {
Expand Down

0 comments on commit af45aaf

Please sign in to comment.