• Matthias Käppler's avatar
    Use strict filetype checks when calling `gm` · 590b1306
    Matthias Käppler authored
    By default, `gm` will ignore file extensions and determine the correct decoder/encoder based on the file's magic bytes. This means that a file pretending to be something else based on its extension might get processed.
    
    According to http://www.graphicsmagick.org/security.html it is recommended to specify the reader based on the expected type instead by prefixing the input file with `jpg:` or `png:` respectively.
    
    Also started to add unit tests for the image resizer. Coverage still a
    bit spotty.
    590b1306
image_resizer_test.go 3.01 KB