python-appengine图像api错误

python-appengine图像api错误,python,django,google-app-engine,Python,Django,Google App Engine,**错误是无法识别的图像格式,来自: class Image(Image\u data=None,blob\u key=None) image\u data图像数据,作为bytestring(str)。形象 数据可以用JPEG、PNG、WEBP、GIF(包括动画)、BMP、, TIFF或ICO格式 作为bytestring: def embedd_image(): from google.appengine.api import images img1 = images.Im

**错误是无法识别的图像格式,来自:

class Image(Image\u data=None,blob\u key=None)

image\u data
图像数据,作为bytestring(str)。形象 数据可以用JPEG、PNG、WEBP、GIF(包括动画)、BMP、, TIFF或ICO格式

作为bytestring:

def embedd_image():
    from google.appengine.api import images

    img1 = images.Image('/home/ubuntu/a.png')  // Here I am getting **error
    img2 = images.Image('/home/ubuntu/text.png')   // Here I am getting **error                                                                                                                                 
    composite = images.composite([(img1, 0, 0, 1.0, images.TOP_LEFT), (img2, 81, 25, 1.0, images.TOP_LEFT)], 144, 68,  output_encoding=0)                          
    return composite                                                                                                                                                  

您将无法访问app Engine上应用程序根目录之外的文件-毕竟,部署的应用程序将如何访问您的主目录?此外,当您发布这些问题时,请包括完整的异常stacktrace,而不仅仅是错误的解释。
img1 = images.Image(open('/home/ubuntu/a.png').read())