views:

47

answers:

2

I'm using aino-convert on a project and running into an issue I've never seen before. I've taken the exact same code from another project where I've used aino-convert, but it's blowing up with an ImageMagick error in the new project. My template code looks like this:

{% thumbnail img.image "156x106" as thumb %}
<img src="{{ thumb }}" alt="{{ img.name }}" />

and that results in the following TemplateSyntaxError:

Caught ExecuteException while rendering: Magick: invalid argument for option `-resize': '156x106' @ error/convert.c/ConvertImageCommand/2343.

I've tried playing around with the sizes to see if it was an issue with the source image. I've tried removing the quotation marks and not aliasing the result to a variable, but it all results in that same error. I'm running ImageMagick 6.6.2 on Windows, also seeing the error on the live Linux server.

+1  A: 

make sure that the x character in size option "156x106" is really lower case letter x and not e.g. multiplication sign ×

UPDATE

alternatively, you can try using different syntax:

{% convert img.image "-resize 156x106" as thumb %}
mykhal
A: 

Are you sure Django Template Engine is not interpreting the x in 156x106 as hexa-decimal?

That way by the thin aino (or convert) gets the resize options it's all screwed up. This could cause the problem.

MovieYoda