Thanks to visit codestin.com
Credit goes to github.com

Skip to content

lazy create of file targets #4482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2025
Merged

lazy create of file targets #4482

merged 1 commit into from
Apr 30, 2025

Conversation

jcupitt
Copy link
Member

@jcupitt jcupitt commented Apr 28, 2025

vips_target_new_to_file() used to immediately create the target file. If the filename was not actually used (eg. by dzsave), a stray file would be left behind.

This PR moves the file create to the first _write() operation.

See #4476

`vips_target_new_to_file()` used to immediately create the target file.
If the filename was not actually used (eg. by `dzsave`), a stray file
would be left behind.

This PR moves the file create to the first `_write()` operation.

See #4476
Copy link
Member

@kleisauke kleisauke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I was going to suggest moving the connection->filename && connection->tracked_descriptor == -1 check outside the function (as vips_target_write_real() can be called many times), but it's probably inlined anyway.

@jcupitt
Copy link
Member Author

jcupitt commented Apr 30, 2025

Yes, I think (without evidence heh) the performance impact is negligible.

@jcupitt jcupitt merged commit 1fb9dc3 into master Apr 30, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants