Fix some file extension issues with image and image sequence export #1943
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1736 Introduced a check to make sure that when a file is selected, that it has an extension matching one of the formats in the file extension filter list. It assumes that there is at least one filter, but this is not true for the image and image sequence exports, which do not have a filter and instead rely upon a dropdown dialog to determine the export format. This PR skips that check if there is no filter, otherwise an assertion will be triggered.
While fixing this, I noticed that single image export doesn't handle file extensions as well as the image sequence export. Notably, it doesn't force the output filename to match the output format, and it will try to export jpgs/bmps with transparency if you check off the transparency box before switching to those formats. I resolved both of these issues by simply copying what image sequence export does. I think there's got to be much better ways to handle this, but I hope that using this tried-and-tested code is sufficient for v0.7.1. I do have plans for support additional image formats in the future which will likely involve rewriting all this code anyway.