Skip to content

Instantly share code, notes, and snippets.

@WietseWind
Created July 27, 2016 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WietseWind/63a41c3c7a71093c4838a6c24cf0ab8f to your computer and use it in GitHub Desktop.
Save WietseWind/63a41c3c7a71093c4838a6c24cf0ab8f to your computer and use it in GitHub Desktop.
Getting (from media, static) an image, resizing, serving
{% trim %}
{% do twig.noTemplate().addHeader('Content-type: image/png') %}
{% set image = api.IO_staticFile('1.png').get() %}
{#{{ api.Image_Resize(image, 100, 'center').data|raw }}#}
{#{{ api.Image_Resize(image, 100).data|raw }}#}
{#{{ api.Image_Resize(image, 100,125).data|raw }}#}
{{ api.Image_Resize(image, rest.get.size|default(100),'center').data|raw }}
{% endtrim %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment