From e34bc19f7126b80764a4c8747a7a2a1636289396 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 16 Apr 2018 22:27:29 +0200 Subject: Add support for BMP To be completely honest, BMP have no metadata, but we still add it, just in caseā„¢ --- src/images.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/images.py b/src/images.py index 06f3e22..707207b 100644 --- a/src/images.py +++ b/src/images.py @@ -75,3 +75,17 @@ class TiffParser(GdkPixbufAbstractParser): 'FileTypeExtension', 'ImageHeight', 'ImageSize', 'ImageWidth', 'MIMEType', 'Megapixels', 'SourceFile'} + +class BMPParser(GdkPixbufAbstractParser): + mimetypes = {'image/bmp', 'image/x-ms-bmp'} + meta_whitelist = {'SourceFile', 'ExifToolVersion', 'FileName', 'Directory', + 'FileSize', 'FileModifyDate', 'FileAccessDate', + 'FileInodeChangeDate', 'FilePermissions', 'FileType', + 'FileTypeExtension', 'MIMEType', 'BMPVersion', 'ImageWidth', + 'ImageHeight', 'Planes', 'BitDepth', 'Compression', 'ImageLength', + 'PixelsPerMeterX', 'PixelsPerMeterY', 'NumColors', + 'NumImportantColors', 'RedMask', 'GreenMask', 'BlueMask', + 'AlphaMask', 'ColorSpace', 'RedEndpoint', 'GreenEndpoint', + 'BlueEndpoint', 'GammaRed', 'GammaGreen', 'GammaBlue', 'ImageSize', + 'Megapixels'} + -- cgit v1.3