diff options
| author | jvoisin | 2011-11-07 11:41:22 +0100 |
|---|---|---|
| committer | jvoisin | 2011-11-07 11:41:22 +0100 |
| commit | 7e43701c21b04338ce3c44f5d1ea918fa4315047 (patch) | |
| tree | f69ef68b812bbab9afbc70c2022f587354223edb | |
| parent | 09f43643326a4511850f6a47215f37e6b7f32f51 (diff) | |
Comments
| -rw-r--r-- | mat/strippers.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/mat/strippers.py b/mat/strippers.py index 7e5ac9e..f7c49b0 100644 --- a/mat/strippers.py +++ b/mat/strippers.py | |||
| @@ -20,7 +20,7 @@ STRIPPERS = { | |||
| 20 | 'application/officeopenxml': office.OpenXmlStripper, | 20 | 'application/officeopenxml': office.OpenXmlStripper, |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | try: | 23 | try: # pdf support |
| 24 | import poppler | 24 | import poppler |
| 25 | import cairo | 25 | import cairo |
| 26 | STRIPPERS['application/x-pdf'] = office.PdfStripper | 26 | STRIPPERS['application/x-pdf'] = office.PdfStripper |
| @@ -29,20 +29,19 @@ except ImportError: | |||
| 29 | print('Unable to import python-poppler and/or python-cairo: no pdf \ | 29 | print('Unable to import python-poppler and/or python-cairo: no pdf \ |
| 30 | support') | 30 | support') |
| 31 | 31 | ||
| 32 | try: | 32 | try: # mutangen-python : audio format support |
| 33 | import mutagen | 33 | import mutagen |
| 34 | STRIPPERS['audio/x-flac'] = audio.FlacStripper | 34 | STRIPPERS['audio/x-flac'] = audio.FlacStripper |
| 35 | STRIPPERS['audio/vorbis'] = audio.OggStripper | 35 | STRIPPERS['audio/vorbis'] = audio.OggStripper |
| 36 | except ImportError: | 36 | except ImportError: |
| 37 | print('Unable to import python-mutagen: limited audio format support') | 37 | print('Unable to import python-mutagen: limited audio format support') |
| 38 | 38 | ||
| 39 | try: | 39 | try: # check if exiftool is installed on the system |
| 40 | # check if exiftool is installed on the system | ||
| 41 | subprocess.Popen('exiftool', stdout=open('/dev/null')) | 40 | subprocess.Popen('exiftool', stdout=open('/dev/null')) |
| 42 | import exiftool | 41 | import exiftool |
| 43 | STRIPPERS['image/jpeg'] = exiftool.JpegStripper | 42 | STRIPPERS['image/jpeg'] = exiftool.JpegStripper |
| 44 | STRIPPERS['image/png'] = exiftool.PngStripper | 43 | STRIPPERS['image/png'] = exiftool.PngStripper |
| 45 | except: | 44 | except: # if exiftool is not installed, use hachoir |
| 46 | print('Unable to find exiftool: limited images support') | 45 | print('Unable to find exiftool: limited images support') |
| 47 | STRIPPERS['image/jpeg'] = images.JpegStripper | 46 | STRIPPERS['image/jpeg'] = images.JpegStripper |
| 48 | STRIPPERS['image/png'] = images.PngStripper | 47 | STRIPPERS['image/png'] = images.PngStripper |
