Skip to content

Fix SeekableFileObject does not have readline when loading HTTP file - #1084

Merged
FirefoxMetzger merged 4 commits into
imageio:masterfrom
Pandede:fix-seekable-file-object-has-no-readline
Jun 16, 2024
Merged

FirefoxMetzger merged 4 commits into
imageio:masterfrom
Pandede:fix-seekable-file-object-has-no-readline

Conversation

@Pandede

@Pandede Pandede commented May 8, 2024 •

Copy link
Copy Markdown
Contributor

Fixes #1065.
The reason of this issue is Pillow sometimes read the image with .readline but not only .read.

Update:
It happens seldomly when loading a WebP image.

@FirefoxMetzger FirefoxMetzger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good ... just the test image is unlicensed, so we will have to find an alternative (again ._.).

@Pandede do you know what causes Pillow to use readline vs read? If so, we can probably generate an artificial test image and use it for the test here.


There also is an issue with CI right now. Github has switched Mac runners to M1 and some of our old plugins don't support that. I'm looking currently looking into a fix and will let you know once it's in master so we can run the test suite again.

@Pandede

Pandede commented May 13, 2024

Copy link
Copy Markdown
Contributor Author

I may reproduce the bug with this test image of Pillow.
Note that although the extension of this image (fotografia-a-coruna.jpeg) is JPEG, it is actually a WebP image.

@FirefoxMetzger FirefoxMetzger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pillow's test images work perfect for us :) LGTM

@Pandede

Pandede commented May 30, 2024

Copy link
Copy Markdown
Contributor Author

It seems like pillow cannot to read WebP image as the missing package libwebp-dev.

@FirefoxMetzger
FirefoxMetzger merged commit e418a2d into imageio:master Jun 16, 2024
@FirefoxMetzger

Copy link
Copy Markdown
Contributor

Took a while to find the time to fix CI, but we eventually got there :) Thanks for the PR and thanks for being patient 🚀

@Pandede
Pandede deleted the fix-seekable-file-object-has-no-readline branch July 6, 2024 14:27
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.

AttributeError: 'SeekableFileObject' object has no attribute 'readline'

2 participants