Skip to content

Commit

Permalink
Fixed pathnames for proper migration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Aubreville committed Mar 13, 2024
1 parent c422cd9 commit 013732e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exact/exact/images/migrations/0033_image_stack_setfilename.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ def remove_natively_handled_files_auxfiles(apps, schema_editor):
if slide is None:
continue
if image.depth==1:
if not os.path.exists(image.get_file_name()):
rp = image.image_set.root_path()
if not os.path.exists(rp / Path(image.filename)):
print('Setting image filename from: ',image.filename,'to:',image.name)
image.filename = image.name
image.save()
for frame in range(image.frames):
rp = image.image_set.root_path()
filepath = rp / Path(Path(image.name).stem) / "{}_{}_{}".format(1, frame+1, image.name)
if os.path.exists(filepath):
print('Removing: ', filepath)
Expand Down

0 comments on commit 013732e

Please sign in to comment.