Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MicaSense Image Processing Tutorial 1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"if os.name == 'nt':\n",
" exiftoolPath = os.environ.get('exiftoolpath')\n",
"# get image metadata\n",
"meta = metadata.Metadata(panelImageName, exiftool_path=exiftoolPath)\n",
"meta = metadata.Metadata(panelImageName)\n",
"cameraMake = meta.get_item('EXIF:Make')\n",
"cameraModel = meta.get_item('EXIF:Model')\n",
"firmwareVersion = meta.get_item('EXIF:Software')\n",
Expand Down
7 changes: 2 additions & 5 deletions micasense/imageset.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self, captures):
captures.sort()

@classmethod
def from_directory(cls, directory, progress_callback=None, exiftool_path=None, allow_uncalibrated=False):
def from_directory(cls, directory, progress_callback=None, allow_uncalibrated=False):
"""
Create and ImageSet recursively from the files in a directory
"""
Expand All @@ -64,10 +64,7 @@ def from_directory(cls, directory, progress_callback=None, exiftool_path=None, a

images = []

if exiftool_path is None and os.environ.get('exiftoolpath') is not None:
exiftool_path = os.path.normpath(os.environ.get('exiftoolpath'))

with exiftool.ExifToolHelper(exiftool_path) as exift:
with exiftool.ExifToolHelper() as exift:
for i, path in enumerate(matches):
images.append(image.Image(path, exiftool_obj=exift, allow_uncalibrated=allow_uncalibrated))
if progress_callback is not None:
Expand Down
9 changes: 2 additions & 7 deletions micasense/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,11 @@
class Metadata(object):
""" Container for Micasense image metadata"""

def __init__(self, filename: str, exiftool_path=None, exiftool_obj=None):
def __init__(self, filename: str, exiftool_obj=None):
if exiftool_obj is not None:
self.exif = exiftool_obj.get_metadata(filename)
return
if exiftool_path is not None:
self.exiftoolPath = exiftool_path
elif os.environ.get('exiftoolpath') is not None:
self.exiftoolPath = os.path.normpath(os.environ.get('exiftoolpath'))
else:
self.exiftoolPath = None

if not os.path.isfile(filename):
raise IOError("Input path is not a file")
with exiftool.ExifToolHelper() as exift:
Expand Down