diff --git a/bin/filecheck.py b/bin/filecheck.py index c33339b..66c5e38 100644 --- a/bin/filecheck.py +++ b/bin/filecheck.py @@ -238,7 +238,6 @@ class File(FileBase): """ if self.maintype in Config.ignored_mimes: self.should_copy = False - self.mime_processing_options.get(self.maintype, self.unknown)() else: self._check_dangerous() self._check_filename() @@ -246,8 +245,9 @@ class File(FileBase): self._check_extension() if self.has_mimetype: self._check_mimetype() - if not self.is_dangerous: - self.mime_processing_options.get(self.maintype, self.unknown)() + + if not self.is_dangerous: + self.mime_processing_options.get(self.maintype, self.unknown)() def write_log(self): """Pass information about the file to self.logger""" @@ -255,7 +255,7 @@ class File(FileBase): props = self.get_all_props() if not self.is_archive: if os.path.exists(self.tempdir_path): - # FIXME: in_tempdir is a hack to make images appear at the correct tree depth in log + # FIXME: in_tempdir is a hack to make image files appear at the correct tree depth in log self.logger.add_file(self.src_path, props, in_tempdir=True) return self.logger.add_file(self.src_path, props) diff --git a/tests/file_catalog.yaml b/tests/file_catalog.yaml index 8d8a496..71a0903 100644 --- a/tests/file_catalog.yaml +++ b/tests/file_catalog.yaml @@ -27,6 +27,9 @@ normal: mimetype: text/rtf sample_mpeg4.mp4: # Added 28-06-2017, source: https://support.apple.com/en-us/HT201549 mimetype: video/mp4 + word_docx.docx: # Added 24-07-2017, source: hand-generated using MacOS Microsoft Word 2011 + description: normal word document + # mimetype: zip_archive.zip: # Added 27-06-2017, source: hand-generated mimetype: application/zip diff --git a/tests/normal/word_docx.docx b/tests/normal/word_docx.docx new file mode 100644 index 0000000..b28b11b Binary files /dev/null and b/tests/normal/word_docx.docx differ