We have been using AppEngine's images API with no problem for the past year. Suddenly in the last week or so the images API seems to be corrupting the image. We use the images API to do a few different operations but the one that seems to be causing the problem is that we do an images.rotation(0) on TIFF data to convert it to a PNG. (We haven't tried other file type conversions but the point is that this was working for over a year so why should it suddenly stop working? Furthermore, we need it to work with TIFF to PNG as TIFF is the format of inbound data)
This worked without problem for a long time and suddenly today I find that any TIFF that goes through the process is corrupted on output. It looks as though it's doubled and skewed.
This is using the Python 2.7 API on AppEngine 1.7.7. We are using the Google images API directly not through PIL.
Please help! This is killing our production environment.
Example code:
from google.appengine.api import images
import webapp2
def get_sample():
# sample.tiff is a 1bit black and white group3 tiff from a fax service
with open("sample.tiff") as x:
f = x.read()
return f
class MainHandler(webapp2.RequestHandler):
def get(self):
# Convert to PNG using AppEngine's images API by doing a rotation of 0 degrees.
# This worked fine for over a year and now suddenly started corrupting the
# output image with a grainy double image that looks like two of the
# same image are layered on top of each other and vibrating.
sample = get_sample()
png = images.rotate(sample, 0)
self.response.headers["Content-Type"] = "image/png"
self.response.out.write(png)
application = webapp2.WSGIApplication([('/', MainHandler)], debug=True)