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

get_or_save_image can fail if the downloaded image's is corrupted #145

Open
fabienheureux opened this issue Jan 22, 2022 · 2 comments
Open
Labels
bug Something isn't working

Comments

@fabienheureux
Copy link
Contributor

fabienheureux commented Jan 22, 2022

This image https://limonadier.net/wp-content/uploads/2019/09/IMG_1782.jpg appears to be corrupted, but returns a 200 in get_or_save_image function.

This causes django to raise an integrity error because its width is 0 pixel

psycopg2.errors.NotNullViolation: null value in column "width" of relation "wagtailimages_image" violates not-null constraint

IMG_1782

fabienheureux added a commit to fabienheureux/wagtail-wordpress-import that referenced this issue Jan 22, 2022
@fabienheureux fabienheureux changed the title image_linker can fail if the downloaded image as a width of 0 pixels image_linker can fail if the downloaded image's is corrupted Jan 22, 2022
@fabienheureux fabienheureux mentioned this issue Jan 22, 2022
7 tasks
@fabienheureux
Copy link
Contributor Author

Here is a potential fix #146 (still in draft)

Let me know what you think of this approach

@fabienheureux fabienheureux changed the title image_linker can fail if the downloaded image's is corrupted get_or_save_image can fail if the downloaded image's is corrupted Jan 22, 2022
@nickmoreton nickmoreton added the bug Something isn't working label Jan 22, 2022
fabienheureux added a commit to fabienheureux/wagtail-wordpress-import that referenced this issue Jan 22, 2022
@nickmoreton
Copy link
Collaborator

The example image seems to be unavailable now.

If you can complete the PR I'd be happy to review it. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants