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

Improve image detection #48

Open
Glodenox opened this issue Nov 13, 2023 · 1 comment
Open

Improve image detection #48

Glodenox opened this issue Nov 13, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Glodenox
Copy link
Owner

URLs like https://i0.wp.com/mediachomp.com/wp-content/uploads/2022/05/moose-dive-comic-03.jpg?resize=650%2C651&ssl=1 should still be detected as an image URL. Either due to the query params or the "%2C", this is not detected as an image.

Ideally, there's a way to check the presence of an image for every link that doesn't end with a slash. But I suspect that will cause quite a few unnecessary network calls.

@Glodenox Glodenox added enhancement New feature or request needs research Still need to figure out how to proceed on this issue labels Nov 13, 2023
@Glodenox Glodenox removed the needs research Still need to figure out how to proceed on this issue label Nov 12, 2024
@Glodenox
Copy link
Owner Author

URLs can be parsed with the JavaScript URL object, which then allows checking the pathfile contents without the query parts.

Additionally, this is a good time to clean up that code from "yay, it works, ship it" to "I could easily support other image hosting sites here".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant