I am trying to export modified JPEG images of this image using the following code (the download part is omitted since this works fine):
basewidth = 400 # user-defined variable wpercent = (basewidth/float(img.size[0])) hsize = int((float(img.size[1])*float(wpercent))) img = img.resize((basewidth,hsize), Image.ANTIALIAS) theitemishere = "/home/myusername/public_html/resizer/" + filename img.save(theitemishere + extension, extension_caps)
However, I get the following error when the time comes to save a new image (here's the trace):
File "/home/myusername/public_html/cgi-bin/PIL/Image.py", line 1467, in save save_handler(self, fp, filename) File "/home/myusername/public_html/cgi-bin/PIL/JpegImagePlugin.py", line 557, in _save ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)]) File "/home/myusername/public_html/cgi-bin/PIL/ImageFile.py", line 466, in _save e = Image._getencoder(im.mode, e, a, im.encoderconfig) File "/home/myusername/public_html/cgi-bin/PIL/Image.py", line 395, in _getencoder return encoder(mode, *args + extra) TypeError: function takes at most 11 arguments (13 given)
Any thoughts on why this is happening?
FWIW, I cannot install the PIL module on the server, so I have it as a cgi-bin subdirectory.