Open
Conversation
Author
|
I found it is interesting, I used the following code to test it separately in Node environment, browser environment under localhost URL, and https URL. fetch("https:/raw.githubusercontent.com/jimp-dev/jimp/main/plugins/plugin-print/fonts/open-sans/open-sans-16-black/open-sans-16-black.png")It can take effect in both Node environment and browser localhost address. |
|
I can confirm this problem is very real, though the impact appears to depend on specific browser/node version, and how the http:/... malformed prefix is handled in the underlying fetch implementation. (We are hitting this in CyberChef and it is currently a blocker for our update to Node 24) |
|
@hipstersmoothie Any chance to take a look on that please? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Jimp supports loading fonts from URLs, but on the browser, I found that it performs abnormally under non localhost domains.
Then I found that there was a problem with the following line of code,
jimp/plugins/plugin-print/src/load-bitmap-font.ts
Line 161 in b6b0e41
and it will eventually construct a similar one
https:/raw.githubusercontent.com/jimp-dev/jimp/main/plugins/plugin-print/fonts/open-sans/open-sans-16-black/open-sans-16-black.pngThe link clearly shows that there is a missing '/' after 'https'.