mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
resources: Support output image format in image operations
The image format is defined as the image extension of the known formats, excluding the dot. All of 'img.Resize "600x jpeg"', 'img.Resize "600x jpg"', and 'img.Resize "600x png"' are valid format definitions. If the target format is defined in the operation definition string, then the converted image will be stored in this format. Permalinks and media type are updated correspondingly. Unknown image extensions in the operation definition have not effect. See #6298
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
34dc06b032
commit
e5856e61d8
@@ -220,6 +220,10 @@ func (l *genericResource) MediaType() media.Type {
|
||||
return l.mediaType
|
||||
}
|
||||
|
||||
func (l *genericResource) setMediaType(mediaType media.Type) {
|
||||
l.mediaType = mediaType
|
||||
}
|
||||
|
||||
func (l *genericResource) Name() string {
|
||||
return l.name
|
||||
}
|
||||
|
Reference in New Issue
Block a user