diff options
Diffstat (limited to 'libmat/pillow.py')
| -rw-r--r-- | libmat/pillow.py | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/libmat/pillow.py b/libmat/pillow.py deleted file mode 100644 index 5406b8b..0000000 --- a/libmat/pillow.py +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | ''' Care about images with help of PIL. | ||
| 2 | This class doesn't remove metadata in the "conventional way"; | ||
| 3 | it opens, then saves the image. This should remove unknown metadata. | ||
| 4 | ''' | ||
| 5 | |||
| 6 | # FIXME Implement this with a decorator instead | ||
| 7 | |||
| 8 | import parser | ||
| 9 | |||
| 10 | |||
| 11 | class PillowStripper(object): | ||
| 12 | ''' This class implements a single method, "open_and_save". | ||
| 13 | It's a class instead of a function so it can be inherited. | ||
| 14 | ''' | ||
| 15 | def open_and_save(self): | ||
| 16 | ''' Open and save the image with PIL. | ||
| 17 | This should remove a lot of unknown metadata. | ||
| 18 | ''' | ||
| 19 | try: | ||
| 20 | from PIL import Image | ||
| 21 | except ImportError: | ||
| 22 | logging.error('Unable to import PIL, image support degraded. Be careful.') | ||
| 23 | |||
| 24 | try: | ||
| 25 | Image.open(self.filename).save(self.filename, exif='') | ||
| 26 | except IOError: | ||
| 27 | logging.error('Can not save %s.' % self.filename) | ||
