Commit 4c323863 authored by Jérome Perrin's avatar Jérome Perrin Committed by Arnaud Fontaine

fixup! py2/py3: Make Products code compatible with both python2 and python3 (nexedi/erp5!1751).

parent afd17ece
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
############################################################################## ##############################################################################
import six
import os, sys, shutil, tempfile import os, sys, shutil, tempfile
import io import io
from zLOG import LOG,ERROR,INFO,WARNING from zLOG import LOG,ERROR,INFO,WARNING
...@@ -256,8 +257,10 @@ class ZoomifyBase: ...@@ -256,8 +257,10 @@ class ZoomifyBase:
# a bug was discovered when a row was exactly 1 pixel in height # a bug was discovered when a row was exactly 1 pixel in height
# this extra checking accounts for that # this extra checking accounts for that
if imageHeight > 1: if imageHeight > 1:
tempImage = imageRow.resize((imageWidth/2, imageHeight/2), tempImage = imageRow.resize(
PIL_Image.ANTIALIAS) (imageWidth//2, imageHeight//2),
PIL_Image.LANCZOS if six.PY3 else PIL_Image.ANTIALIAS,
)
tempImage.save(os.path.join(tempfile.gettempdir(), root + str(tier) tempImage.save(os.path.join(tempfile.gettempdir(), root + str(tier)
+ '-' + str(row) + ext)) + '-' + str(row) + ext))
tempImage = None tempImage = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment