summaryrefslogtreecommitdiff
path: root/lib/images.py
blob: d09001518f4785d904ca7c6473f4f7f740bc57a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
'''
    Takes care about pictures formats
'''

import parser


class JpegStripper(parser.GenericParser):
    '''
        represents a jpeg file
    '''
    def _should_remove(self, field):
        '''
            return True if the field is compromizing
        '''
        if field.name.startswith('comment'):
            return True
        elif field.name in ("photoshop", "exif", "adobe"):
            return True
        else:
            return False


class PngStripper(parser.GenericParser):
    '''
        represents a png file
    '''
    def _should_remove(self, field):
        '''
            return True if the field is compromizing
        '''
        if field.name.startswith("text["):
            return True
        elif field.name is "time":
            return True
        else:
            return False