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

Appearance settings

Commit 15c59d3

Browse filesBrowse files
authored
Update dependency scipy to v1.4.1 (GoogleCloudPlatform#3197)
1 parent 01fa9da commit 15c59d3
Copy full SHA for 15c59d3

File tree

Expand file treeCollapse file tree

2 files changed

+9
-6
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-6
lines changed

‎appengine/flexible/scipy/main.py

Copy file name to clipboardExpand all lines: appengine/flexible/scipy/main.py
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,24 @@
1616
import os
1717

1818
from flask import Flask
19-
import scipy.misc
19+
from PIL import Image
20+
import imageio
2021

2122
app = Flask(__name__)
2223

2324

2425
@app.route('/')
2526
def resize():
26-
"""Demonstrates using scipy to resize an image."""
27+
"""Demonstrates using Pillow to resize an image."""
2728
app_path = os.path.dirname(os.path.realpath(__file__))
2829
image_path = os.path.join(app_path, 'assets/google_logo.jpg')
29-
img = scipy.misc.imread(image_path)
30-
img_tinted = scipy.misc.imresize(img, (300, 300))
30+
img = Image.fromarray(imageio.imread(image_path))
31+
img_tinted = img.resize((300, 300))
32+
3133
output_image_path = os.path.join(
3234
app_path, 'assets/resized_google_logo.jpg')
3335
# Write the tinted image back to disk
34-
scipy.misc.imsave(output_image_path, img_tinted)
36+
imageio.imwrite(output_image_path, img_tinted)
3537
return "Image resized."
3638

3739

+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Flask==1.1.1
22
gunicorn==20.0.4
3+
imageio==2.8.0
34
numpy==1.18.2
4-
scipy==1.2.0
55
pillow==7.1.0
6+
scipy==1.4.1

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.