Skip to content

feat: add a fallback to image download fail case - #7

Merged
denisb0 merged 1 commit into
masterfrom
get-image-dimension-fix
May 14, 2025
Merged

feat: add a fallback to image download fail case#7
denisb0 merged 1 commit into
masterfrom
get-image-dimension-fix

Conversation

@denisb0

@denisb0 denisb0 commented May 13, 2025

Copy link
Copy Markdown

Based on this.

To find the good article image we try to check its dimensions.
To avoid downloading a whole image, Newspaper gets image data in chunks and tries to decode. Reading the header usually is enough to find out the size.
For some reason for .png images here this method fails.
Images are ok, they are correctly parsed when downloaded locally.

So anyway for this case I added the method, which downloads the whole image.

@denisb0
denisb0 requested review from idoshamun and vpol May 13, 2025 14:40
@denisb0
denisb0 merged commit 46fed32 into master May 14, 2025
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.

3 participants