Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deprecate imread() reading from URLs#18649

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

timhoffm
Copy link
Member

PR Summary

Closes#18648.

@timhoffmtimhoffm added this to thev3.4.0 milestoneOct 3, 2020
@timhoffmtimhoffmforce-pushed thedeprecate-imread-url branch 2 times, most recently from96ac787 to53a1b1fCompareOctober 4, 2020 22:00
@jklymak
Copy link
Member

recyclying to get doc build to rerun...

@jklymakjklymak closed thisOct 5, 2020
@jklymakjklymak reopened thisOct 5, 2020
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Passing a URL to `~.pyplot.imread()` is deprecated. Please open the URL before
reading using ``urllib.request.urlopen()``.
Copy link
Member

Choose a reason for hiding this comment

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

As part of the standard library, shouldn't this be link-able?

@tacaswell
Copy link
Member

The user also has to do a bit more jiggery-pokery than justurlopen as pillow expects to be able to seek on the buffer and what comes back from urlopen does not support seek (see discussion in#18129).

The documented incantation needs to beimage.imread(io.BytesIO(urllib.request.urlopen(url).read())) orimage.imread(io.BytesIO(requests.get(url).content)).

I suspect we should also abandon most of the png guessing code and just let pillow infer as much as it wants to. I think this would make our code simpler (as it is almost a completed drop-through to pillow) and make it more functional (it will open things other than png from a url).

I am 👍 on deprecating this, but we need to provide more guidance about what to replace it with.

Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

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

Needs better docs on path away from imread.

Should probably also have, "UsePIL.image.open(urlopen(url))" as an option too.

@timhoffm
Copy link
MemberAuthor

👍 on the suggestions.

Anybody, feel free to amend. I'm not in word-picking mood right now.

tacaswell reacted with thumbs up emoji

@anntzeranntzer mentioned this pull requestJan 26, 2021
7 tasks
@jklymak
Copy link
Member

close in favour of#19367

@timhoffmtimhoffm deleted the deprecate-imread-url branchJanuary 27, 2021 23:02
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@tacaswelltacaswelltacaswell requested changes

@dopplershiftdopplershiftdopplershift approved these changes

@jklymakjklymakjklymak approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.4.0
Development

Successfully merging this pull request may close these issues.

Drop support for directly imread()ing urls.
5 participants
@timhoffm@jklymak@tacaswell@dopplershift@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp