-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathchepy_exif.py
More file actions
29 lines (23 loc) · 748 Bytes
/
chepy_exif.py
File metadata and controls
29 lines (23 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import logging
try:
import exiftool
except ImportError:
logging.warning("Could not import exiftool. Use pip install exiftool")
import chepy.core
class Chepy_Exif(chepy.core.ChepyCore):
"""This plugin allows exif data from files and images
"""
@chepy.core.ChepyDecorators.call_stack
def get_exif(self): # pragma: no cover
"""Extract EXIF data from a file
Returns:
ChepyPlugin: The Chepy object.
"""
filename = self._temp_file()
with exiftool.ExifTool() as et:
exif = et.get_metadata(filename)
if exif:
self.state = exif
else:
self._warning_logger("No exif data found")
return self