Slightly off topic, do you think it is best to store thumbnails or generate them each time they are required from the primary image. I am currently storing them and am wondering if I should just generate them to reduce the amount of stored data.
On May 14, 3:07 am, Philip <[email protected]> wrote: > Hi there, wanted to share the solution i found. before doing any > manipulations on the images, you should call read() method on the > image field of the FILES dictionary > > image = request.FILES["picture"].read() > > On May 9, 11:57 pm, Philip <[email protected]> wrote: > > > > > > > Sure Martin, > > > I am using Django forms to handle data inputing > > > from django import forms > > > class MyForm(forms.Form): > > picture = forms.FileField() > > > Here's how it gets bound in the request handler > > > myForm = MyForm(request.POST, request.FILES) > > > And then i attempt to generate a thumbnail > > > from google.appengine.api import images > > images.resize(myForm.cleaned_data["picture"], 50, 50) > > > I should note that the whole thing runs on django non-rel for > > appengine. > > > Thanks for your time, > > > Philip > > > On May 9, 8:13 pm, Martin Webb <[email protected]> wrote: > > > > Can you send over more of your code - ie the handler that gets the image > > > and the complete code you are using to resize it including all your > > > includes - i will tell you what you are doing wrong. > > > > Regards > > > > Martin Webb > > > > The information contained in this email is confidential and may contain > > > proprietary information. It is meant solely for the intended recipient. > > > Access to this email by anyone else is unauthorised. If you are not the > > > intended recipient, any disclosure, copying, distribution or any action > > > taken or omitted in reliance on this, is prohibited and may be unlawful. > > > No liability or responsibility is accepted if information or data is, for > > > whatever reason corrupted or does not reach its intended recipient. No > > > warranty is given that this email is free of viruses. The views expressed > > > in this email are, unless otherwise stated, those of the author > > > > ________________________________ > > > From: Philip <[email protected]> > > > To: Google App Engine <[email protected]> > > > Sent: Sun, 9 May, 2010 13:45:08 > > > Subject: [google-appengine] images api: problem generating a thumbnail > > > > Hello, > > > > I'm trying to generate a thumbnail for an image uploaded through a > > > form. I use images api provided with app engine: > > > > images.resize(pic, width, height) > > > > When run on a dev server, I get > > > google.appengine.api.images.BadImageError exception > > > On the appspot, I get > > > An error occurred parsing (locally or remotely) the > > > arguments to images.Transform(). <class > > > 'google.appengine.runtime.apiproxy_errors.ArgumentError'> > > > > I am positive that the original image is not null (i am able to store > > > it in the database and later retrieve and render it). > > > > Any ideas? > > > > -- > > > 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 > > > athttp://groups.google.com/group/google-appengine?hl=en. > > > > -- > > > 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 > > > athttp://groups.google.com/group/google-appengine?hl=en. > > > -- > > 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 > > athttp://groups.google.com/group/google-appengine?hl=en. > > -- > 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 > athttp://groups.google.com/group/google-appengine?hl=en. -- 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.
