restored metadata-extractor tiff detection false positive workaround
This commit is contained in:
parent
ad8e5253fd
commit
79f8fa7f71
1 changed files with 4 additions and 1 deletions
|
@ -222,14 +222,17 @@ class MetadataHandler(private val context: Context) : MethodCallHandler {
|
|||
// * file extension is unreliable
|
||||
// In the end, `metadata-extractor` is the most reliable, except for `tiff` (false positives, false negatives),
|
||||
// in which case we trust the file extension
|
||||
// cf https://github.com/drewnoakes/metadata-extractor/issues/296
|
||||
if (path?.matches(tiffExtensionPattern) == true) {
|
||||
metadataMap[KEY_MIME_TYPE] = MimeTypes.TIFF
|
||||
} else {
|
||||
dir.getSafeString(FileTypeDirectory.TAG_DETECTED_FILE_MIME_TYPE) {
|
||||
if (it != MimeTypes.TIFF) {
|
||||
metadataMap[KEY_MIME_TYPE] = it
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// EXIF
|
||||
for (dir in metadata.getDirectoriesOfType(ExifSubIFDDirectory::class.java)) {
|
||||
|
|
Loading…
Reference in a new issue