Skip to content

Commit

Permalink
check if all frames exist before IFD extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaJafar committed Apr 2, 2024
1 parent 389b610 commit 82416b2
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ def process(self, instance):
render_rop(ropnode)

files = instance.data["frames"]
# Check if all frames exists.
# Frames can be nonexistent if user cancels the render.
missing_frames = [
frame
for frame in instance.data["frames"]
if not os.path.exists(
os.path.normpath(os.path.join(staging_dir, frame)))
]
if missing_frames:
raise RuntimeError("Failed to complete Mantra ifd extraction. "
"Missing output files: {}".format(
missing_frames))

if "representations" not in instance.data:
instance.data["representations"] = []
Expand Down

0 comments on commit 82416b2

Please sign in to comment.