Skip to content
Snippets Groups Projects
Commit 04a0032e authored by Julien (jvoisin) Voisin's avatar Julien (jvoisin) Voisin
Browse files

Add some comments

parent b5a5535e
No related branches found
No related tags found
No related merge requests found
from . import abstract
class HarmlessParser(abstract.AbstractParser):
""" This is the parser for filetypes that do not contain metadata. """
mimetypes = {'application/xml', 'text/plain', 'application/rdf+xml'}
def __init__(self, filename: str):
......
......@@ -32,6 +32,9 @@ class PNGParser(abstract.AbstractParser):
return True
class GdkPixbufAbstractParser(abstract.AbstractParser):
""" GdkPixbuf can handle a lot of surfaces, so we're rending images on it,
this has the side-effect of removing metadata completely.
"""
def get_meta(self):
out = subprocess.check_output(['exiftool', '-json', self.filename])
meta = json.loads(out.decode('utf-8'))[0]
......
......@@ -8,6 +8,7 @@ from typing import Type, TypeVar
T = TypeVar('T', bound='abstract.AbstractParser')
# This loads every parser in a dynamic way
for module_loader, name, ispkg in pkgutil.walk_packages('.src'):
if not name.startswith('src.'):
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment