soywiz-archive / jtransc

Bytecode to source converting Java & Kotlin code into JavaScript, C++, D, C#, PHP, AS3, Dart and Haxe and run it everywhere. Also use JVM code in your favourite language as a library.
https://jtransc.soywiz.com/
Apache License 2.0
632 stars 67 forks source link

Get image info #195

Closed soywiz closed 7 years ago

soywiz commented 7 years ago

@SergeyLabutin this provides a filter |image_info. You can use it with a File, a ByteArray (contents) or a String (local path of a file). Test shows how to use it: https://github.com/jtransc/jtransc/pull/195/commits/ed6092659fba7e1a0b948d1995293b341e05ec53#diff-dd82426a9b94d700d048654d6b894effR100

You should use something like this:

{% set image = imagePath|image_info %}
<yyy path="{{ imagePath }}" width="{{ image.width }}" height="{{ image.height }}">