From 433609f8eadc05ec6aceeb2b71951cc6db318d81 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 3 Feb 2019 21:01:58 +0100 Subject: Implement .gif support --- libmat2/images.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libmat2') diff --git a/libmat2/images.py b/libmat2/images.py index 153a83d..dd3be53 100644 --- a/libmat2/images.py +++ b/libmat2/images.py @@ -42,6 +42,21 @@ class PNGParser(exiftool.ExiftoolParser): return True +class GIFParser(exiftool.ExiftoolParser): + mimetypes = {'image/gif'} + meta_whitelist = {'AnimationIterations', 'BackgroundColor', 'BitsPerPixel', + 'ColorResolutionDepth', 'Directory', 'Duration', + 'ExifToolVersion', 'FileAccessDate', + 'FileInodeChangeDate', 'FileModifyDate', 'FileName', + 'FilePermissions', 'FileSize', 'FileType', + 'FileTypeExtension', 'FrameCount', 'GIFVersion', + 'HasColorMap', 'ImageHeight', 'ImageSize', 'ImageWidth', + 'MIMEType', 'Megapixels', 'SourceFile',} + + def remove_all(self) -> bool: + return self._lightweight_cleanup() + + class GdkPixbufAbstractParser(exiftool.ExiftoolParser): """ GdkPixbuf can handle a lot of surfaces, so we're rending images on it, this has the side-effect of completely removing metadata. -- cgit v1.3