Merge pull request #10099 from mgeier/skip-data-uris

Skip "data:" URIs in ImageConverter
This commit is contained in:
Takeshi KOMIYA 2022-01-15 14:21:08 +09:00 committed by GitHub
commit 54159f66d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -200,6 +200,9 @@ class ImageConverter(BaseImageConverter):
elif set(self.guess_mimetypes(node)) & set(self.app.builder.supported_image_types):
# builder supports the image; no need to convert
return False
elif node['uri'].startswith('data:'):
# all data URI MIME types are assumed to be supported
return False
elif self.available is None:
# store the value to the class variable to share it during the build
self.__class__.available = self.is_available()