Hi Doug,

The 1MB size limit which you mentioned applies to the original image
as well as the transformed image. The error noted: image data was:
1.25500011444 MB so it sounds like the original image was too large.

Thank you,

Jeff

On Jan 21, 3:38 am, linderd <douglas.lin...@gmail.com> wrote:
> The error I'm receiving for a section of my code is:
> RequestTooLargeError: The request to API call images.Transform() was
> too large.
>
> I'm trying to resize images to thumb nails, and it's failing.
>
> I saw this thread (which mysteriously I can't seem to reply 
> to...):http://groups.google.com/group/google-appengine/browse_thread/thread/...

Older threads are eventually "closed" automatically so replies are not
enabled.

>
> Quote:
> "
> Currently we have a 1MB request limit, which likely explains the error
> you're seeing. At the moment the only workaround is to restrict the
> size of images accepted by your application.
>
> Daniel
> "
>
> However, I'm seeing this error turn up for numbers much lower than 1
> MB, and its weird.
> Anyone else seen this?
>
> For example my code (below) returns:
> Failed: Invalid file: The request to API call images.Transform() was
> too large. (image size was: 2592 x 1944) (image data was:
> 1.25500011444 MB)
>
> But unexpectedly:
> Failed: Invalid file: The request to API call images.Transform() was
> too large. (image size was: 768 x 1024) (image data was:
> 0.292947769165 MB)
>
> As if the resize request is converting the low quality JPG in the
> second example into a bitmap, and then realizing that the resulting
> image is too large?
>
> I've looked into /google/appengine/api/images/images_stub.py but it
> seems to just be passing the request on to PIL, which is definitely
> not the source of this error.
>
> So... help?
>
> The code I'm using is:
> try:
>                     # Data image bytes
>                     data = args['data'].value # Raw form data
>                     type, swidth, sheight = img.getImageInfo (data)
>                     type = images.PNG # Transcode to PNG
>                     width = 640
>                     height = 480
>                     thumb = images.resize (data, width, height)
>
>                     # Apply action
>                     response = self.savePicture (user, data, thumb,
> type)
>                     success = response['status']
>                     response = response['response']
>                     error = ''
>                 except Exception, e:
>                     success = 'false'
>                     lvalue = (float(len(args['data'].value)) /
> 1024.0) / 1024.0;
>                     response = '\'Invalid file: ' + str(e) + '(image
> size was: ' + str(swidth) + ' x ' + str(sheight) + ') (image data was:
> ' + str(lvalue) + ' MB)\''
>                     error = ''
>
> ~
> Doug.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to