这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@scribblemaniac
Copy link
Member

#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.

Some formats don't use this as they have their own logic for
file extensions. Without this, `filters.split(";;")` returns `""`
and the assertion fails.
…xport

This isn't the prettiest solution, but it works for now. Doing this solves
two issues:
1. Formats that do not support transparency would still call exportIm
   with transparency=true if the transparency box was checked while
   a format with transparency support was active.
2. File paths could have an extension that does not match their format
   or even no extension at all.
@github-project-automation github-project-automation bot moved this from Needs Review to Approved in Pull Request Priority Nov 3, 2025
@chchwy
Copy link
Member

chchwy commented Nov 3, 2025

Thanks for catching this and submitting a fix!

@chchwy chchwy changed the title Fix some file extension related issues with image and image sequence export Fix some file extension issues with image and image sequence export Nov 3, 2025
@chchwy chchwy merged commit 6148971 into pencil2d:release/0.7.1 Nov 3, 2025
12 of 15 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Merged in Pull Request Priority Nov 3, 2025
chchwy pushed a commit that referenced this pull request Nov 3, 2025
…1943)

* Skip hasValidSuffix check if no filters are used

Some formats don't use this as they have their own logic for
file extensions. Without this, `filters.split(";;")` returns `""`
and the assertion fails.

* Handle image export format and extension the same as image sequence export

This isn't the prettiest solution, but it works for now. Doing this solves
two issues:
1. Formats that do not support transparency would still call exportIm
   with transparency=true if the transparency box was checked while
   a format with transparency support was active.
2. File paths could have an extension that does not match their format
   or even no extension at all.
@chchwy
Copy link
Member

chchwy commented Nov 3, 2025

The fix was cherry-picked to the master branch.

@scribblemaniac scribblemaniac deleted the fix-imgseq-export branch November 6, 2025 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

2 participants