resources: Support output image format in image operations
authorJ. Ansorg <github@joachim-ansorg.de>
Sat, 21 Sep 2019 14:50:27 +0000 (16:50 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 21 Sep 2019 14:50:27 +0000 (16:50 +0200)
commite5856e61d88ef5149582851b00e06b5b93dce9f8
tree5cfa1d63c34fbca7c4c226827dc574794edd4ecd
parent34dc06b032741abac342d7a2a77510ded9b72ae8
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
media/mediaType.go
resources/image.go
resources/image_test.go
resources/images/config.go
resources/images/image.go
resources/resource.go
resources/resource_metadata.go