mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
Fix image format detection for upper case extensions, e.g. JPG
This regression was introduced in 0.56.0. Fixes #6137
This commit is contained in:
@@ -209,7 +209,7 @@ func (r *Spec) newResource(sourceFs afero.Fs, fd ResourceSourceDescriptor) (reso
|
||||
fd.RelTargetFilename = sourceFilename
|
||||
}
|
||||
|
||||
ext := filepath.Ext(fd.RelTargetFilename)
|
||||
ext := strings.ToLower(filepath.Ext(fd.RelTargetFilename))
|
||||
mimeType, found := r.MediaTypes.GetFirstBySuffix(strings.TrimPrefix(ext, "."))
|
||||
// TODO(bep) we need to handle these ambigous types better, but in this context
|
||||
// we most likely want the application/xml type.
|
||||
|
Reference in New Issue
Block a user