Skip to content
Merged
Changes from 1 commit
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
Next Next commit
fix export zoom percentage bug
corrects issue where zoom percentages were being stored as a multiplier, meaning the image size was shrinking with each export
  • Loading branch information
flimsyhat committed Apr 1, 2025
commit 2dfb6476c4af26b0b3fa565136c8388aa08d2d6f
15 changes: 14 additions & 1 deletion plotdevice/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ def beginExport(self, kind):
format = self.image['format']
accessory = self.imageAccessory

# Set the zoom value so that UI reflects the previously stored value
self.imageZoom.setStringValue_("%i%%" % self.image['zoom'])

if self.image['single']:
self.imageFormat.selectItemAtIndex_(1)
else:
Expand Down Expand Up @@ -442,7 +445,17 @@ def exportPanelDidEnd_returnCode_contextInfo_(self, panel, returnCode, context):
kind, opts = 'movie', self.movieState()
else:
kind, opts = 'image', self.imageState()
setattr(self, kind, dict(opts)) # save the options for next time

# Convert zoom multiplier back to percentage before saving
saved_opts = dict(opts)
if 'zoom' in saved_opts:
saved_opts['zoom'] = saved_opts['zoom'] * 100

# Save the modified options (with percentage zoom)
setattr(self, kind, saved_opts)
print("Export options:", saved_opts)

# Continue with the export using the original options (with decimal zoom)
self.last = os.path.split(fname) # save the path we exported to
self.script.exportInit(kind, fname, opts)

Expand Down