Skip to content

fix: refresh images when source files change - #393

Open
dajiaohuang wants to merge 1 commit into
3rd:masterfrom
dajiaohuang:task/source-refresh
Open

dajiaohuang wants to merge 1 commit into
3rd:masterfrom
dajiaohuang:task/source-refresh

Conversation

@dajiaohuang

Copy link
Copy Markdown

Fixes #388.

The from_file() fast path reused an image based only on its path, and Image:render() tracked changes with second-resolution getftime. Both can keep stale content after a source changes. Use transform_cache.source_identity() (canonical path, subsecond mtime, and size) for reuse and render invalidation; refresh dimensions and clear transformed output when the identity changes.

The regression rewrites the source without changing its size, changes only the subsecond mtime, and verifies that getftime is unchanged while both reload and render refresh the image.

Validation: the targeted source-refresh regression passed. The full Busted suite was not run locally because busted is unavailable; CI is pending.

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.

Images/PDFs don’t re-render after source file changes on disk, even when mtime updates correctly

1 participant