diff --git a/src/harmless.py b/src/harmless.py index dc543f227afffe83c80afadaf014dca526239ab6..235dabe4ea50c14b933eef3c63cd531c804bc68b 100644 --- a/src/harmless.py +++ b/src/harmless.py @@ -1,6 +1,7 @@ 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): diff --git a/src/images.py b/src/images.py index 560886ac3580f7cca294942946c7559586be3d70..93f3ec29bf3ded0647fe5cac165e966bbf9481cf 100644 --- a/src/images.py +++ b/src/images.py @@ -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] diff --git a/src/parser_factory.py b/src/parser_factory.py index 812d95cad35b4715a88e217e520a16fff8d1f61a..7fd42d7b661c9cffe010a119594f147dae925760 100644 --- a/src/parser_factory.py +++ b/src/parser_factory.py @@ -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