I have the following python code, but it fails sometimes, and
sometimes works fine... the troubleshoot line is:

                    imagen = images.Image(img)

I'm uploading pics, and the curious thing is that this sometimes works
with some pics, and sometimes, with the same pics, it doesn't work...

I'm pretty sure, i'm initializing the images api correctly...


        if str(request.POST['cmd']) == 'add-item':
            if 'userfile' in request.FILES:
                respuesta = galleryRemote.addItem()
                archivo = request.FILES["userfile"]

                if str(request.POST["set_albumName"]).count("EVENTO")
> 0:

                    key = str(request.POST["set_albumName"]).replace
("EVENTO:","")
                    evento = db.get(key)

                    img = archivo.read()

                    imagen = images.Image(img)
                    imagen.resize(width=1024)

                    imagen_mini = images.Image(img)
                    imagen_mini.resize(width=150)


                    foto = galerias.Fotografia(
                        evento = evento,
                        nombre = request.FILES["userfile"].name,
                        imagen = imagen.execute_transforms
(output_encoding=images.PNG),
                        imagen_mini = imagen_mini.execute_transforms
(output_encoding=images.PNG)
                        )

                    foto.put()
                    respuesta.setResultCode("GR_STAT_SUCCESS")
                    respuesta.setItemName("Thumb")
                    respuesta.setExplanatoryText("Se subio la
fotografia")

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to