Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Deprecate imread() reading from URLs#19367
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
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
``imread()`` reading from URLs | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Passing a URL to `~.pyplot.imread()` is deprecated. Please open the URL for | ||
reading and directly use the Pillow API | ||
(``PIL.Image.open(urllib.request.urlopen(url))``, or | ||
``PIL.Image.open(io.BytesIO(requests.get(url).content))``) instead. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -12,7 +12,7 @@ | ||
from PIL import Image | ||
from matplotlib import ( | ||
_api,colors, image as mimage, patches, pyplot as plt, style, rcParams) | ||
from matplotlib.image import (AxesImage, BboxImage, FigureImage, | ||
NonUniformImage, PcolorImage) | ||
from matplotlib.testing.decorators import check_figures_equal, image_comparison | ||
@@ -714,7 +714,8 @@ def test_load_from_url(): | ||
url = ('file:' | ||
+ ('///' if sys.platform == 'win32' else '') | ||
+ path.resolve().as_posix()) | ||
with _api.suppress_matplotlib_deprecation_warning(): | ||
plt.imread(url) | ||
with urllib.request.urlopen(url) as file: | ||
plt.imread(file) | ||
@@ -1128,7 +1129,8 @@ def test_exact_vmin(): | ||
@pytest.mark.network | ||
@pytest.mark.flaky | ||
def test_https_imread_smoketest(): | ||
with _api.suppress_matplotlib_deprecation_warning(): | ||
v = mimage.imread('https://matplotlib.org/1.5.0/_static/logo2.png') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Shouldn't you properly fix this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. The point is that after the removal, reading this just won't involve matplotlib at all (it'll be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. oops sorry - I missed what the test was for.... | ||
# A basic ndarray subclass that implements a quantity | ||