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

ImageConverter: ignore '?' image URIs #10118

Merged
merged 1 commit into from Mar 23, 2022

Conversation

mgeier
Copy link
Contributor

@mgeier mgeier commented Jan 18, 2022

While #10073 has fixed my minimal example, it wasn't enough to fix my original problem spatialaudio/nbsphinx#559.

It turns out that on top of data: URIs, remote URIs have also been automatically handled as "not supported" and therefore unnecessarily invoked the image converters.

This PR ignores all '?' images, which includes data: URIs, therefore I've reverted the changes from #10099, which are no longer necessary.

I still don't know what '?' means exactly, it would probably be nice to add a comment explaining what that is and why it's ignored.

Example project for experiments: https://github.com/mgeier/rsvgconverter-bug

@tk0miya
Copy link
Member

tk0miya commented Mar 23, 2022

I consider the ImageConverter should handle both local and remote images. But, essentially, current implementation mainly supports local images only. So this proposal is a correct approach.

Note: One of my extension, sphinxcontrib-cacoo supports remote images by overriding match() method.
https://github.com/sphinx-contrib/cacoo

@tk0miya
Copy link
Member

tk0miya commented Mar 23, 2022

I still don't know what '?' means exactly, it would probably be nice to add a comment explaining what that is and why it's ignored.

'?' represents "nonlocal" images.

# Map the mimetype to the corresponding image. The writer may
# choose the best image from these candidates. The special key * is
# set if there is only single candidate to be used by a writer.
# The special key ? is set for nonlocal URIs.

@tk0miya tk0miya merged commit 138d71f into sphinx-doc:4.x Mar 23, 2022
tk0miya added a commit that referenced this pull request Mar 23, 2022
@mgeier mgeier deleted the image-converter-ignore-questionmark branch March 23, 2022 19:30
@mgeier
Copy link
Contributor Author

mgeier commented Mar 23, 2022

Thanks for merging, and thanks for the additional information, that's very helpful!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants