Changed SpiderImagePlugin register and save calls to use format property

This commit is contained in:
Andrew Murray 2016-06-19 15:13:02 +10:00
parent d378508905
commit 879aeb9b3a

View File

@ -282,7 +282,7 @@ def _save(im, fp, filename):
def _save_spider(im, fp, filename): def _save_spider(im, fp, filename):
# get the filename extension and register it with Image # get the filename extension and register it with Image
ext = os.path.splitext(filename)[1] ext = os.path.splitext(filename)[1]
Image.register_extension("SPIDER", ext) Image.register_extension(SpiderImageFile.format, ext)
_save(im, fp, filename) _save(im, fp, filename)
# -------------------------------------------------------------------- # --------------------------------------------------------------------
@ -319,4 +319,4 @@ if __name__ == "__main__":
print( print(
"saving a flipped version of %s as %s " % "saving a flipped version of %s as %s " %
(os.path.basename(filename), outfile)) (os.path.basename(filename), outfile))
im.save(outfile, "SPIDER") im.save(outfile, SpiderImageFile.format)