+1
I'm getting the same error, without any other explanation (Just
BadImageError). My code used to work fine a couple of days ago, but
not any more..
I tried two methods to upload, resize, store, and serve images. I can
upload images to the blobstore successfully; however, when resizing/
cropping, I either get a BadImageError or the image I store isn't
recognized as an image:
#1) Using this method, I can store the image successfully, but when
serving it, I get a "google.appengine.api.images.NotImageError"
#get the uploaded image:
upload_file = self.get_uploads('upload_image')
blob_info = upload_file[0]
#wrap the uploaded image data in an Image object
image = images.Image(blob_key=str(blob_info.key()))
#resize image
image.resize(width=800)
#execute transformation
image.execute_transforms(output_encoding=images.JPEG)
#Store it
photo = Photo(photo = str(image))
#2) If I use this instead (when resizing the image), I get a
BadImageError:
#resize image
image = images.Image(str(image), width=800)
#execute transformation
image = image.execute_transforms(output_encoding=images.JPEG)
please note that all of this is happening on my dev server. I was able
to upload and serve images successfully a couple of days ago, but I
don't know what changed in my code that made it crash.
Any help is appreciated :)
Thanks
On Jun 15, 1:36 pm, Matthew Wallace <[email protected]> wrote:
> I am on OS X snow leopard and trying to create an app with python. I
> did get PIL installed without any errors it seems. I used to get the
> PIL is not installed error but now after trying to resize several
> images from a form that I am uploading and trying to store in the
> datastore I am at a lose as to why I am getting the followingBadImageError
>
> Error That I am getting : ( like I said I tried several different
> images. some png and some jpg and get the same error)
>
> Traceback (most recent call last):
> File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
> GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
> google/appengine/ext/webapp/__init__.py", line 513, in __call__
> handler.post(*groups)
> File "/Users/mswallace/Development/webapps/nobluelego/main.py", line
> 48, in post
> screen_shot =
> db.Blob(images.resize(self.request.get('screen_shot'),320,240)),
> File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
> GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
> google/appengine/api/images/__init__.py", line 625, in resize
> return image.execute_transforms(output_encoding=output_encoding)
> File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
> GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
> google/appengine/api/images/__init__.py", line 523, in
> execute_transforms
> raiseBadImageError()BadImageError
>
> Here is the code that I am running when user submits the form with the
> image file to upload
>
> def post(self):
>
> sitePosts = SitePosts(
> screen_shot =
> db.Blob(images.resize(self.request.get('screen_shot'),320,240)),
> url=self.request.get('url'),
> site_name=self.request.get('site_name'),
> your_name=self.request.get('your_name'),
> your_email=self.request.get('your_email'),
> your_site=self.request.get('your_site')
> )
>
> sitePosts.put()
> self.redirect('/')
>
> any help would be great
> thanks
On Jun 15, 1:36 pm, Matthew Wallace <[email protected]> wrote:
> I am on OS X snow leopard and trying to create an app with python. I
> did get PIL installed without any errors it seems. I used to get the
> PIL is not installed error but now after trying to resize several
> images from a form that I am uploading and trying to store in the
> datastore I am at a lose as to why I am getting the followingBadImageError
>
> Error That I am getting : ( like I said I tried several different
> images. some png and some jpg and get the same error)
>
> Traceback (most recent call last):
> File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
> GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
> google/appengine/ext/webapp/__init__.py", line 513, in __call__
> handler.post(*groups)
> File "/Users/mswallace/Development/webapps/nobluelego/main.py", line
> 48, in post
> screen_shot =
> db.Blob(images.resize(self.request.get('screen_shot'),320,240)),
> File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
> GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
> google/appengine/api/images/__init__.py", line 625, in resize
> return image.execute_transforms(output_encoding=output_encoding)
> File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
> GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
> google/appengine/api/images/__init__.py", line 523, in
> execute_transforms
> raiseBadImageError()BadImageError
>
> Here is the code that I am running when user submits the form with the
> image file to upload
>
> def post(self):
>
> sitePosts = SitePosts(
> screen_shot =
> db.Blob(images.resize(self.request.get('screen_shot'),320,240)),
> url=self.request.get('url'),
> site_name=self.request.get('site_name'),
> your_name=self.request.get('your_name'),
> your_email=self.request.get('your_email'),
> your_site=self.request.get('your_site')
> )
>
> sitePosts.put()
> self.redirect('/')
>
> any help would be great
> thanks
--
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.