diff options
| author | jvoisin | 2022-05-15 18:57:27 +0200 |
|---|---|---|
| committer | jvoisin | 2022-05-15 18:57:27 +0200 |
| commit | 704367f91eebe6158399f930f725334db96de134 (patch) | |
| tree | 2a2f77e6e0b241b1120915df3608d961320072e7 /libmat2/images.py | |
| parent | 263971370931b1c5b8c49ab287e6d30e40d974e2 (diff) | |
Add support for HEIC files
Thanks to Maxime Morin ( https://www.maijin.fr/ )
for the patch.
Diffstat (limited to 'libmat2/images.py')
| -rw-r--r-- | libmat2/images.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libmat2/images.py b/libmat2/images.py index 3da2673..9c24998 100644 --- a/libmat2/images.py +++ b/libmat2/images.py | |||
| @@ -181,3 +181,23 @@ class PPMParser(abstract.AbstractParser): | |||
| 181 | line = re.sub(r"\s+", "", line, flags=re.UNICODE) | 181 | line = re.sub(r"\s+", "", line, flags=re.UNICODE) |
| 182 | fout.write(line) | 182 | fout.write(line) |
| 183 | return True | 183 | return True |
| 184 | |||
| 185 | class HEICParser(exiftool.ExiftoolParser): | ||
| 186 | mimetypes = {'image/heic'} | ||
| 187 | meta_allowlist = {'SourceFile', 'ExifToolVersion', 'FileName','Directory', | ||
| 188 | 'FileSize', 'FileModifyDate', 'FileAccessDate', | ||
| 189 | 'FileInodeChangeDate', 'FilePermissions', 'FileType', | ||
| 190 | 'FileTypeExtension', 'MIMEType', 'MajorBrand', 'MinorVersion', | ||
| 191 | 'CompatibleBrands','HandlerType', 'PrimaryItemReference', | ||
| 192 | 'HEVCConfigurationVersion', 'GeneralProfileSpace', | ||
| 193 | 'GeneralTierFlag', 'GeneralProfileIDC', | ||
| 194 | 'GenProfileCompatibilityFlags', 'ConstraintIndicatorFlags', | ||
| 195 | 'GeneralLevelIDC', 'MinSpatialSegmentationIDC', | ||
| 196 | 'ParallelismType','ChromaFormat', 'BitDepthLuma', 'BitDepthChroma', | ||
| 197 | 'NumTemporalLayers', 'TemporalIDNested', 'ImageWidth', | ||
| 198 | 'ImageHeight', 'ImageSpatialExtent', 'ImagePixelDepth', | ||
| 199 | 'AverageFrameRate', 'ConstantFrameRate', 'MediaDataSize', | ||
| 200 | 'MediaDataOffset','ImageSize', 'Megapixels'} | ||
| 201 | |||
| 202 | def remove_all(self) -> bool: | ||
| 203 | return self._lightweight_cleanup() | ||
