Skip to content
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

assets: ensure forced-standalone handles new-and-matches images #1066

Merged

Conversation

jdknight
Copy link
Member

@jdknight jdknight commented Dec 5, 2024

When forcing assets in standalone (e.g. images that are dynamically generated after the pre-processing stage), it will assume a found asset entry is an indication that the asset was generated by another dynamic image on the same document. However, this not guaranteed to be the case. For example, "page a" may generate a standalone image and register it into the asset manager. A few moments later, "page b" may generate its own standalone image instance that results in the same physical file, but the asset message indicates its origin is "page a". With the original implementation, this would generate an assert.

Since the assert is wrong in this case, instead of asserting the document name maps in the asset name, if it does not map, do not consider the cached asset as the asset to use. Instead, we clear the key which allows a translator to rework the asset reference. This in turn should register a reference of this new document in the asset.

When forcing assets in standalone (e.g. images that are dynamically
generated after the pre-processing stage), it will assume a found
asset entry is an indication that the asset was generated by another
dynamic image on the same document. However, this not guaranteed to be
the case. For example, "page a" may generate a standalone image and
register it into the asset manager. A few moments later, "page b" may
generate its own standalone image instance that results in the same
physical file, but the asset message indicates its origin is "page a".
With the original implementation, this would generate an assert.

Since the assert is wrong in this case, instead of asserting the
document name maps in the asset name, if it does not map, do not
consider the cached asset as the asset to use. Instead, we clear the
key which allows a translator to rework the asset reference. This in
turn should register a reference of this new document in the asset.

Signed-off-by: James Knight <[email protected]>
@jdknight jdknight merged commit e6f05c4 into main Dec 5, 2024
24 checks passed
@jdknight jdknight deleted the correct-forced-standalone-assets-with-matching-dynamic-images branch December 5, 2024 05:36
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