diff options
Diffstat (limited to 'src/images.py')
| -rw-r--r-- | src/images.py | 59 |
1 files changed, 31 insertions, 28 deletions
diff --git a/src/images.py b/src/images.py index 6cc3dfe..c84952a 100644 --- a/src/images.py +++ b/src/images.py | |||
| @@ -14,11 +14,12 @@ from . import abstract | |||
| 14 | class PNGParser(abstract.AbstractParser): | 14 | class PNGParser(abstract.AbstractParser): |
| 15 | mimetypes = {'image/png', } | 15 | mimetypes = {'image/png', } |
| 16 | meta_whitelist = {'SourceFile', 'ExifToolVersion', 'FileName', | 16 | meta_whitelist = {'SourceFile', 'ExifToolVersion', 'FileName', |
| 17 | 'Directory', 'FileSize', 'FileModifyDate', 'FileAccessDate', | 17 | 'Directory', 'FileSize', 'FileModifyDate', |
| 18 | "FileInodeChangeDate", 'FilePermissions', 'FileType', | 18 | 'FileAccessDate', 'FileInodeChangeDate', |
| 19 | 'FileTypeExtension', 'MIMEType', 'ImageWidth', 'BitDepth', 'ColorType', | 19 | 'FilePermissions', 'FileType', 'FileTypeExtension', |
| 20 | 'Compression', 'Filter', 'Interlace', 'BackgroundColor', 'ImageSize', | 20 | 'MIMEType', 'ImageWidth', 'BitDepth', 'ColorType', |
| 21 | 'Megapixels', 'ImageHeight'} | 21 | 'Compression', 'Filter', 'Interlace', 'BackgroundColor', |
| 22 | 'ImageSize', 'Megapixels', 'ImageHeight'} | ||
| 22 | 23 | ||
| 23 | def __init__(self, filename): | 24 | def __init__(self, filename): |
| 24 | super().__init__(filename) | 25 | super().__init__(filename) |
| @@ -63,36 +64,38 @@ class GdkPixbufAbstractParser(abstract.AbstractParser): | |||
| 63 | class JPGParser(GdkPixbufAbstractParser): | 64 | class JPGParser(GdkPixbufAbstractParser): |
| 64 | mimetypes = {'image/jpeg'} | 65 | mimetypes = {'image/jpeg'} |
| 65 | meta_whitelist = {'SourceFile', 'ExifToolVersion', 'FileName', | 66 | meta_whitelist = {'SourceFile', 'ExifToolVersion', 'FileName', |
| 66 | 'Directory', 'FileSize', 'FileModifyDate', 'FileAccessDate', | 67 | 'Directory', 'FileSize', 'FileModifyDate', |
| 67 | "FileInodeChangeDate", 'FilePermissions', 'FileType', | 68 | 'FileAccessDate', "FileInodeChangeDate", |
| 68 | 'FileTypeExtension', 'MIMEType', 'ImageWidth', | 69 | 'FilePermissions', 'FileType', 'FileTypeExtension', |
| 69 | 'ImageSize', 'BitsPerSample', 'ColorComponents', 'EncodingProcess', | 70 | 'MIMEType', 'ImageWidth', 'ImageSize', 'BitsPerSample', |
| 70 | 'JFIFVersion', 'ResolutionUnit', 'XResolution', 'YCbCrSubSampling', | 71 | 'ColorComponents', 'EncodingProcess', 'JFIFVersion', |
| 71 | 'YResolution', 'Megapixels', 'ImageHeight'} | 72 | 'ResolutionUnit', 'XResolution', 'YCbCrSubSampling', |
| 73 | 'YResolution', 'Megapixels', 'ImageHeight'} | ||
| 72 | 74 | ||
| 73 | 75 | ||
| 74 | class TiffParser(GdkPixbufAbstractParser): | 76 | class TiffParser(GdkPixbufAbstractParser): |
| 75 | mimetypes = {'image/tiff'} | 77 | mimetypes = {'image/tiff'} |
| 76 | meta_whitelist = {'Compression', 'ExifByteOrder', 'ExtraSamples', | 78 | meta_whitelist = {'Compression', 'ExifByteOrder', 'ExtraSamples', |
| 77 | 'FillOrder', 'PhotometricInterpretation', 'PlanarConfiguration', | 79 | 'FillOrder', 'PhotometricInterpretation', |
| 78 | 'RowsPerStrip', 'SamplesPerPixel', 'StripByteCounts', | 80 | 'PlanarConfiguration', 'RowsPerStrip', 'SamplesPerPixel', |
| 79 | 'StripOffsets', 'BitsPerSample', 'Directory', 'ExifToolVersion', | 81 | 'StripByteCounts', 'StripOffsets', 'BitsPerSample', |
| 80 | 'FileAccessDate', 'FileInodeChangeDate', 'FileModifyDate', | 82 | 'Directory', 'ExifToolVersion', 'FileAccessDate', |
| 81 | 'FileName', 'FilePermissions', 'FileSize', 'FileType', | 83 | 'FileInodeChangeDate', 'FileModifyDate', 'FileName', |
| 82 | 'FileTypeExtension', 'ImageHeight', 'ImageSize', 'ImageWidth', | 84 | 'FilePermissions', 'FileSize', 'FileType', |
| 83 | 'MIMEType', 'Megapixels', 'SourceFile'} | 85 | 'FileTypeExtension', 'ImageHeight', 'ImageSize', |
| 86 | 'ImageWidth', 'MIMEType', 'Megapixels', 'SourceFile'} | ||
| 84 | 87 | ||
| 85 | 88 | ||
| 86 | class BMPParser(GdkPixbufAbstractParser): | 89 | class BMPParser(GdkPixbufAbstractParser): |
| 87 | mimetypes = {'image/x-ms-bmp'} | 90 | mimetypes = {'image/x-ms-bmp'} |
| 88 | meta_whitelist = {'SourceFile', 'ExifToolVersion', 'FileName', 'Directory', | 91 | meta_whitelist = {'SourceFile', 'ExifToolVersion', 'FileName', 'Directory', |
| 89 | 'FileSize', 'FileModifyDate', 'FileAccessDate', | 92 | 'FileSize', 'FileModifyDate', 'FileAccessDate', |
| 90 | 'FileInodeChangeDate', 'FilePermissions', 'FileType', | 93 | 'FileInodeChangeDate', 'FilePermissions', 'FileType', |
| 91 | 'FileTypeExtension', 'MIMEType', 'BMPVersion', 'ImageWidth', | 94 | 'FileTypeExtension', 'MIMEType', 'BMPVersion', |
| 92 | 'ImageHeight', 'Planes', 'BitDepth', 'Compression', 'ImageLength', | 95 | 'ImageWidth', 'ImageHeight', 'Planes', 'BitDepth', |
| 93 | 'PixelsPerMeterX', 'PixelsPerMeterY', 'NumColors', | 96 | 'Compression', 'ImageLength', 'PixelsPerMeterX', |
| 94 | 'NumImportantColors', 'RedMask', 'GreenMask', 'BlueMask', | 97 | 'PixelsPerMeterY', 'NumColors', 'NumImportantColors', |
| 95 | 'AlphaMask', 'ColorSpace', 'RedEndpoint', 'GreenEndpoint', | 98 | 'RedMask', 'GreenMask', 'BlueMask', 'AlphaMask', |
| 96 | 'BlueEndpoint', 'GammaRed', 'GammaGreen', 'GammaBlue', 'ImageSize', | 99 | 'ColorSpace', 'RedEndpoint', 'GreenEndpoint', |
| 97 | 'Megapixels'} | 100 | 'BlueEndpoint', 'GammaRed', 'GammaGreen', 'GammaBlue', |
| 98 | 101 | 'ImageSize', 'Megapixels'} | |
