Hello, i m uploading images to Blobstore, and then resize or convert
them if their size is more then blobstore.MAX_BLOB_FETCH_SIZE using
code below.
The trick is good with png or jpeg, but no success with tif files. As
i see in docs, images API do support tiff resizing. What i m doing
wrong? (btw: it is ok on local dev with PIL)
upload_files = self.get_uploads('myfile') # 'file' is
file upload field in the form
blob_info = upload_files[0]
uImage = images.Image(blob_key=str(blob_info.key()))
if blob_info.size > MAX_SIZE: #1025554#Encounter 1MB limit
for Google Images API
uImage.resize(width=1024)
try:
src_data = uImage.execute_transforms(images.JPEG)
except images.BadImageError, e:
log("first try of converting to JPEG failed")
log(sys.exc_info())
log(e)
try:
src_data =
uImage.execute_transforms(images.PNG)
except images.BadImageError, e:
log("second try of converting to PNG failed")
log(sys.exc_info())
log(e)
log("seems like we can't convert that type of
image")
#clean up
blob_info.delete()
#end clean up
self.redirect("/afterupload?
msg=error&type="+img_type)
return
I got that errors in log to prove:
08-19 11:35AM 28.511
Image img_type: image/tiff
E 08-19 11:35AM 28.624
first try of converting to JPEG failed
E 08-19 11:35AM 28.624
(<class 'google.appengine.api.images.BadImageError'>, BadImageError(),
<traceback object at 0xe1bb17993ce98720>)
E 08-19 11:35AM 28.672
second try of converting to PNG failed
E 08-19 11:35AM 28.673
(<class 'google.appengine.api.images.BadImageError'>, BadImageError(),
<traceback object at 0xe1bb17993ce98b48>)
seems like we can't convert that type of image
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.