From 74b31fe3c37551778e27346e49c673017eb41c93 Mon Sep 17 00:00:00 2001 From: Jean Bilheux Date: Wed, 4 Aug 2021 13:40:41 -0400 Subject: [PATCH] Revert "Revert "Fix deprecated scipy call in imageslider widget"" --- ipywe/imageslider.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipywe/imageslider.py b/ipywe/imageslider.py index 6b6fca4..d369b5c 100644 --- a/ipywe/imageslider.py +++ b/ipywe/imageslider.py @@ -169,8 +169,8 @@ def getimg_bytes(self): # resample if necessary resample_ratio = view_size/size if resample_ratio != 1.: - import scipy.misc - img = scipy.misc.imresize(img, resample_ratio) + from PIL import Image + img = np.array(Image.fromarray(img).resize((self.width, self.height))) """Allows the correct string IO module to be used based on the version of Python. Once support for Python 2.7 ends, this if-else statement