diff options
Diffstat (limited to 'libmat/images.py')
| -rw-r--r-- | libmat/images.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/libmat/images.py b/libmat/images.py index 2daea88..67c710f 100644 --- a/libmat/images.py +++ b/libmat/images.py | |||
| @@ -7,21 +7,9 @@ References: | |||
| 7 | ''' | 7 | ''' |
| 8 | 8 | ||
| 9 | import parser | 9 | import parser |
| 10 | import pillow | ||
| 11 | 10 | ||
| 12 | 11 | ||
| 13 | class ImageStripper(parser.GenericParser, pillow.PillowStripper): | 12 | class JpegStripper(parser.GenericParser): |
| 14 | ''' Common stripper for images. | ||
| 15 | Its purpose is to open then save | ||
| 16 | images with PIL, the goal being to remove | ||
| 17 | unknown metadata. | ||
| 18 | ''' | ||
| 19 | def remove_all(self): | ||
| 20 | self.open_and_save() | ||
| 21 | super(ImageStripper, self).remove_all() | ||
| 22 | |||
| 23 | |||
| 24 | class JpegStripper(ImageStripper): | ||
| 25 | ''' Represents a jpeg file. | 13 | ''' Represents a jpeg file. |
| 26 | Custom Huffman and Quantization tables | 14 | Custom Huffman and Quantization tables |
| 27 | are stripped: they may leak | 15 | are stripped: they may leak |
| @@ -46,7 +34,7 @@ class JpegStripper(ImageStripper): | |||
| 46 | return True | 34 | return True |
| 47 | 35 | ||
| 48 | 36 | ||
| 49 | class PngStripper(ImageStripper): | 37 | class PngStripper(parser.GenericParser): |
| 50 | ''' Represents a png file | 38 | ''' Represents a png file |
| 51 | ''' | 39 | ''' |
| 52 | def _should_remove(self, field): | 40 | def _should_remove(self, field): |
