summaryrefslogtreecommitdiff
path: root/libmat/pillow.py
diff options
context:
space:
mode:
authorjvoisin2015-07-21 21:37:32 +0200
committerjvoisin2015-07-21 21:37:32 +0200
commitfb550678117a6963539b864a18b904021e619dc5 (patch)
tree17c7dfd312a3f80d9ac886fefa5f79b744b3b468 /libmat/pillow.py
parentdc718900a2160c29cade4ed44cf5101b07c97240 (diff)
Remove the pillow stuff, because it was a bad idea.
Pillow sucks at parsing malformed pictures :/
Diffstat (limited to 'libmat/pillow.py')
-rw-r--r--libmat/pillow.py27
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.
2This class doesn't remove metadata in the "conventional way";
3it opens, then saves the image. This should remove unknown metadata.
4'''
5
6# FIXME Implement this with a decorator instead
7
8import parser
9
10
11class 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)