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

fix: move back to probe-image-size #1112

Merged
merged 4 commits into from
Mar 25, 2025
Merged

Conversation

scissorsneedfoodtoo
Copy link
Contributor

@scissorsneedfoodtoo scissorsneedfoodtoo commented Mar 23, 2025

Checklist:

probe-image-size is so much faster than any other solution I've been able to find, and should be ESM compatible in the future if we move in that direction, so it's best to go back to that.

After a lot of digging, it seems like the issue is that the network requests it's making under the hood follow redirects, which don't result in the final image. Might have something to do with the redirect from https://www.freecodecamp.org/news/content/images/2023/08/Learn-Python-with-Code-Examples-Handbook-Cover--2-.png --> https://cdn-media-0.freecodecamp.org/2023/08/Learn-Python-with-Code-Examples-Handbook-Cover--2-.png, and Cloudflare not allowing hotlinking?

Either way, the main fix is to go down from the default max redirects of 10 to 0. This probably means that more images won't have proper dimensions, but that should be fixed once we move to a new platform and move all images to a CDN.

Copy link

socket-security bot commented Mar 23, 2025

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] Transitive: filesystem, network +7 818 kB vitaly

🚮 Removed packages: npm/[email protected]

View full report↗︎

@scissorsneedfoodtoo scissorsneedfoodtoo force-pushed the fix/move-back-to-probe-image-size branch 3 times, most recently from f1ad9eb to a46ebf7 Compare March 24, 2025 08:28
@scissorsneedfoodtoo scissorsneedfoodtoo force-pushed the fix/move-back-to-probe-image-size branch from cedeb67 to 2076b8f Compare March 25, 2025 09:00
@scissorsneedfoodtoo scissorsneedfoodtoo marked this pull request as ready for review March 25, 2025 09:18
@scissorsneedfoodtoo scissorsneedfoodtoo requested a review from a team as a code owner March 25, 2025 09:18
@raisedadead raisedadead merged commit 1b6cbdc into main Mar 25, 2025
24 of 25 checks passed
@raisedadead raisedadead deleted the fix/move-back-to-probe-image-size branch March 25, 2025 11:28
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.

2 participants