diff options
| author | jvoisin | 2015-12-02 17:07:19 +0100 |
|---|---|---|
| committer | jvoisin | 2015-12-02 17:22:45 +0100 |
| commit | 80ece3001895ea13d50915a5215fd47e313bab4c (patch) | |
| tree | c5ede43867c5d7fe2af4178b34b0e6dc219f6aac /libmat/strippers.py | |
| parent | 3cf80e8b5d6faf410e9ad3aad77f23cf6418a587 (diff) | |
Remove hachoir from MAT.
This (huge) commit removes completely hachoir from MAT.
Audio files are now processed with mutagen, and images
with exiftool, since the main python imaging library (PIL)
isn't super-great to deal with metadata (and damaged/non-standard
files).
Package maintainer should change the dependencies to reflect this.
Diffstat (limited to 'libmat/strippers.py')
| -rw-r--r-- | libmat/strippers.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/libmat/strippers.py b/libmat/strippers.py index 3aca04f..5920c41 100644 --- a/libmat/strippers.py +++ b/libmat/strippers.py | |||
| @@ -2,8 +2,7 @@ | |||
| 2 | """ | 2 | """ |
| 3 | 3 | ||
| 4 | import archive | 4 | import archive |
| 5 | import audio | 5 | import mutagenstripper |
| 6 | import images | ||
| 7 | import logging | 6 | import logging |
| 8 | import mat | 7 | import mat |
| 9 | import misc | 8 | import misc |
| @@ -15,7 +14,6 @@ STRIPPERS = { | |||
| 15 | 'application/x-bzip2': archive.Bzip2Stripper, | 14 | 'application/x-bzip2': archive.Bzip2Stripper, |
| 16 | 'application/x-gzip': archive.GzipStripper, | 15 | 'application/x-gzip': archive.GzipStripper, |
| 17 | 'application/zip': archive.ZipStripper, | 16 | 'application/zip': archive.ZipStripper, |
| 18 | 'audio/mpeg': audio.MpegAudioStripper, | ||
| 19 | 'application/x-bittorrent': misc.TorrentStripper, | 17 | 'application/x-bittorrent': misc.TorrentStripper, |
| 20 | 'application/torrent': misc.TorrentStripper, | 18 | 'application/torrent': misc.TorrentStripper, |
| 21 | 'application/opendocument': office.OpenDocumentStripper, | 19 | 'application/opendocument': office.OpenDocumentStripper, |
| @@ -52,11 +50,11 @@ if pdfSupport: | |||
| 52 | # audio format support with mutagen-python | 50 | # audio format support with mutagen-python |
| 53 | try: | 51 | try: |
| 54 | import mutagen | 52 | import mutagen |
| 55 | STRIPPERS['audio/x-flac'] = audio.FlacStripper | 53 | STRIPPERS['audio/x-flac'] = mutagenstripper.FlacStripper |
| 56 | STRIPPERS['audio/flac'] = audio.FlacStripper | 54 | STRIPPERS['audio/flac'] = mutagenstripper.FlacStripper |
| 57 | STRIPPERS['audio/vorbis'] = audio.OggStripper | 55 | STRIPPERS['audio/vorbis'] = mutagenstripper.OggStripper |
| 58 | STRIPPERS['audio/ogg'] = audio.OggStripper | 56 | STRIPPERS['audio/ogg'] = mutagenstripper.OggStripper |
| 59 | STRIPPERS['audio/mpeg'] = audio.MpegAudioStripper | 57 | STRIPPERS['audio/mpeg'] = mutagenstripper.MpegAudioStripper |
| 60 | except ImportError: | 58 | except ImportError: |
| 61 | logging.info('Unable to import python-mutagen: limited audio format support') | 59 | logging.info('Unable to import python-mutagen: limited audio format support') |
| 62 | 60 | ||
| @@ -67,7 +65,5 @@ try: | |||
| 67 | STRIPPERS['image/jpeg'] = exiftool.JpegStripper | 65 | STRIPPERS['image/jpeg'] = exiftool.JpegStripper |
| 68 | STRIPPERS['image/png'] = exiftool.PngStripper | 66 | STRIPPERS['image/png'] = exiftool.PngStripper |
| 69 | STRIPPERS['image/tiff'] = exiftool.TiffStripper | 67 | STRIPPERS['image/tiff'] = exiftool.TiffStripper |
| 70 | except OSError: # if exiftool is not installed, use hachoir instead | 68 | except OSError: |
| 71 | logging.info('Unable to find exiftool: limited images support') | 69 | logging.info('Unable to find exiftool: limited images support') |
| 72 | STRIPPERS['image/jpeg'] = images.JpegStripper | ||
| 73 | STRIPPERS['image/png'] = images.PngStripper | ||
