Skip to content

feat: image handle from path with a user provided version#3310

Open
hojjatabdollahi wants to merge 1 commit into
iced-rs:masterfrom
hojjatabdollahi:hojjat/fix-handle
Open

feat: image handle from path with a user provided version#3310
hojjatabdollahi wants to merge 1 commit into
iced-rs:masterfrom
hojjatabdollahi:hojjat/fix-handle

Conversation

@hojjatabdollahi
Copy link
Copy Markdown
Contributor

This allow the user to provide a version alongside the file path. The version could be based on file metadata, size, modification time, inode, file hash... The onus is on the user to provide what makes the image unique. This keeps the construction of the handle cheap, but the handle contains info that the user can use to know if the cached image is outdated.

Alternatively, we can add this to Handle::from_path and force everybody to provide something, letting them know that if a file changes in-place the handle won't change and the old cached image will be used.

To fix issues like #2941.

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.

1 participant