1

The docs state:

format can be set to 'jpg', 'gif', 'png', or 'Auto'.

*Why is it 'Auto' not 'auto'?!

https://craftcms.com/docs/image-transforms#possible-values

I'm using a variable to define the transform settings:

{% set small = {
    mode:       'fit',
    width:      800,
    height:     600,
    quality:    80,
    position:   'center-center',
    format:     'Auto'
} %}

But Craft errors with:

Imagine\Exception\InvalidArgumentException Saving image in "auto" format is not supported, please use one of the following extensions: "gif", "jpeg", "png", "wbmp", "xbm"

Is this a bug or is my code incorrect?

2
  • Does this work without the 'format' parameter? Are you using ImageMagik or GD?
    – Matt P
    Mar 14, 2016 at 17:58
  • Yes it works without, so I'm assuming it defaults to Auto. Must be GD as I've not installed ImageMagik. Mar 15, 2016 at 13:34

1 Answer 1

3

This was an error in the docs. You get the automatic format assignment by default, no need to explicitly set format: 'auto'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.