I am trying to convert a HTML string into a .PNG file. Thanks to Nick Johnson who pointed me to GAE Conversion API see previous post Here.
I use the GAE Conversion API
The documentation says that the name of the asset should match the src attribute of the img tag.
Here is a python code I tried in the interactive console, and it actually produced the two images
from google.appengine.api import urlfetch
from google.appengine.api import conversion
url = "http://a0.twimg.com/profile_images/77186109/favicon_reasonably_small.png"
asset = conversion.Asset("text/html", '<b>some data</b><br/><img src="a.png"/><img src="%s"/><br/>Foo' % url, "test.html")
conversion_obj = conversion.Conversion(asset, "image/png")
img_response = urlfetch.fetch(url)
image1 = conversion.Asset('image/png', img_response.content, "a.png")
image2 = conversion.Asset('image/png', img_response.content, url)
conversion_obj.add_asset(image1)
conversion_obj.add_asset(image2)
result = conversion.convert(conversion_obj)
print result.error_text
print repr(result.assets[0].data)