How to convert SVG to PNG or JPG image with Python on Google Application Engine? Any idea? Google Application Engine has PIL support. However, PIL doesn't support SVG.
Asked
Active
Viewed 2,581 times
4
-
3Welcome to Stack Overflow! :) Please note that SO is for _high quality_ questions and answers; we like to help people who have obviously put some effort into asking their question before we put effort into answering their question. (We like a challenge.) I suggest reading http://tinyurl.com/so-hints for more details on what we like to see in our questions. Thanks! – sarnold Jun 22 '11 at 03:20
-
possible duplicate of [Server-side SVG to PNG (or some other image format) in python](http://stackoverflow.com/questions/2932408/server-side-svg-to-png-or-some-other-image-format-in-python) – Matt Ball Jun 22 '11 at 03:21
-
2It sounds like a duplicate but the GAE twist makes the answers from that QA not applicable. Installing Cairo on your server is a great idea if you control the server, but you can't do that on GAE. – jhocking Jun 22 '11 at 03:35
-
@Matt, not a duplicate. The problem with GAE is that it is not possible to install/run binary libraries. Only pure Python2.5 can be used, and the implementation even has some further restrictions – John La Rooy Jun 22 '11 at 04:06
-
1BTW, App Engine does *not* have PIL support. The dev server requires PIL to emulate the images API, but you can't directly use PIL in either the production or dev environments. – Wooble Jun 22 '11 at 18:40
2 Answers
-1
If you manage to find (or write) a pure Python library to do this, it is likely to be prohibitive to run it on GAE due to the amount of computation required and the request time restrictions.
I would consider hosting the image conversion service elsewhere and have the GAE fetch the PNGs from there

John La Rooy
- 295,403
- 53
- 369
- 502
-
This isn't an answer to the question, it basically says they're wrong to do it this way, but I see no reason why this isn't a legitimate question. This seems more like a comment than an answer to me. – Shaun Mar 19 '15 at 20:55
-
@Shaun, how is it less of an answer than the jhocking's answer? At least this offers a useful alternative solution. – John La Rooy Mar 19 '15 at 21:38