Autodetect whether pgf can use \includegraphics[interpolate]. #15150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #10963 (see discussion there); replaces #10973.
This is done by reusing the same LatexManager instance as the one used
for measuring text extents.
As an aside, this exposes an awkwardness in the implementation of
LatexManager -- after an error occurs, the instance needs to be
discarded (ideally, the instance would auto-create a new subprocess).
This is why _get_image_inclusion_command manually discards the cached
instance in such a case.
For recent setups where \includegraphics[interpolate=true] is available,
the cost of this PR is essentially just an additional
\usepackage{graphicx} executed once; for older setups, an additional
instantiation of a latex subprocess (only once).
This can't be tested on CI because Travis' version of latex is too old,
but can be manually tested by inspecting a resulting pgf output, and
possibly changing
interpolate=true
by a nonexistent option (e.g.foobar
and checking that there's fallback to \pgfimage in that case.PR Summary
PR Checklist