Add support for HEIC files
Thanks to Maxime Morin ( https://www.maijin.fr/ ) for the patch.
This commit is contained in:
parent
2639713709
commit
704367f91e
4 changed files with 35 additions and 0 deletions
|
@ -181,3 +181,23 @@ class PPMParser(abstract.AbstractParser):
|
|||
line = re.sub(r"\s+", "", line, flags=re.UNICODE)
|
||||
fout.write(line)
|
||||
return True
|
||||
|
||||
class HEICParser(exiftool.ExiftoolParser):
|
||||
mimetypes = {'image/heic'}
|
||||
meta_allowlist = {'SourceFile', 'ExifToolVersion', 'FileName','Directory',
|
||||
'FileSize', 'FileModifyDate', 'FileAccessDate',
|
||||
'FileInodeChangeDate', 'FilePermissions', 'FileType',
|
||||
'FileTypeExtension', 'MIMEType', 'MajorBrand', 'MinorVersion',
|
||||
'CompatibleBrands','HandlerType', 'PrimaryItemReference',
|
||||
'HEVCConfigurationVersion', 'GeneralProfileSpace',
|
||||
'GeneralTierFlag', 'GeneralProfileIDC',
|
||||
'GenProfileCompatibilityFlags', 'ConstraintIndicatorFlags',
|
||||
'GeneralLevelIDC', 'MinSpatialSegmentationIDC',
|
||||
'ParallelismType','ChromaFormat', 'BitDepthLuma', 'BitDepthChroma',
|
||||
'NumTemporalLayers', 'TemporalIDNested', 'ImageWidth',
|
||||
'ImageHeight', 'ImageSpatialExtent', 'ImagePixelDepth',
|
||||
'AverageFrameRate', 'ConstantFrameRate', 'MediaDataSize',
|
||||
'MediaDataOffset','ImageSize', 'Megapixels'}
|
||||
|
||||
def remove_all(self) -> bool:
|
||||
return self._lightweight_cleanup()
|
||||
|
|
|
@ -11,6 +11,10 @@ T = TypeVar('T', bound='abstract.AbstractParser')
|
|||
mimetypes.add_type('application/epub+zip', '.epub')
|
||||
mimetypes.add_type('application/x-dtbncx+xml', '.ncx') # EPUB Navigation Control XML File
|
||||
|
||||
# This should be removed after we move to python3.10
|
||||
# https://github.com/python/cpython/commit/20a5b7e986377bdfd929d7e8c4e3db5847dfdb2d
|
||||
mimetypes.add_type('image/heic', '.heic')
|
||||
|
||||
|
||||
def __load_all_parsers():
|
||||
""" Loads every parser in a dynamic way """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue