Skip to content

Commit 9c802f4

Browse files
committed
Export: Don't double file extensions
1 parent ad1df9e commit 9c802f4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/windows/export.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -711,10 +711,15 @@ def accept(self):
711711
# Determine final exported file path (and replace blank paths with default ones)
712712
default_filename = "Untitled Project"
713713
default_folder = os.path.join(info.HOME_PATH)
714-
if export_type != _("Image Sequence"):
715-
file_name_with_ext = "%s.%s" % (self.txtFileName.text().strip() or default_filename, self.txtVideoFormat.text().strip())
716-
else:
714+
if export_type == _("Image Sequence"):
717715
file_name_with_ext = "%s%s" % (self.txtFileName.text().strip() or default_filename, self.txtImageFormat.text().strip())
716+
else:
717+
file_ext = self.txtVideoFormat.text().strip()
718+
file_name_with_ext = self.txtFileName.text().strip() or default_filename
719+
# Append extension, if not already present
720+
if not file_name_with_ext.endswith(file_ext):
721+
file_name_with_ext = '{}.{}'.format(file_name_with_ext, file_ext)
722+
718723
export_file_path = os.path.join(self.txtExportFolder.text().strip() or default_folder, file_name_with_ext)
719724
log.info("Export path: %s" % export_file_path)
720725

0 commit comments

Comments
 (0)