[DEV] remove resize image when no PIL is found (for TRAVIS building)
This commit is contained in:
parent
92c552fd59
commit
dd46d2d7b4
@ -5,11 +5,15 @@ import platform
|
|||||||
import os
|
import os
|
||||||
import lutinMultiprocess
|
import lutinMultiprocess
|
||||||
import lutinDepend as dependency
|
import lutinDepend as dependency
|
||||||
|
enableResizeImage = True
|
||||||
if platform.system() == "Darwin":
|
try:
|
||||||
import CoreGraphics
|
if platform.system() == "Darwin":
|
||||||
else:
|
import CoreGraphics
|
||||||
from PIL import Image
|
else:
|
||||||
|
from PIL import Image
|
||||||
|
except:
|
||||||
|
enableResizeImage = False
|
||||||
|
debug.warning("Missing python tools : CoreGraphics (MacOs) or PIL")
|
||||||
|
|
||||||
def get_pow_2_multiple(size):
|
def get_pow_2_multiple(size):
|
||||||
base = 2
|
base = 2
|
||||||
@ -22,6 +26,8 @@ def get_pow_2_multiple(size):
|
|||||||
# check if time change
|
# check if time change
|
||||||
# check if command line change
|
# check if command line change
|
||||||
def resize(srcFile, destFile, x, y, cmd_file=None):
|
def resize(srcFile, destFile, x, y, cmd_file=None):
|
||||||
|
if enableResizeImage == False:
|
||||||
|
return
|
||||||
if os.path.exists(srcFile) == False:
|
if os.path.exists(srcFile) == False:
|
||||||
debug.error("Request a resize an image that does not existed : '" + srcFile + "'")
|
debug.error("Request a resize an image that does not existed : '" + srcFile + "'")
|
||||||
cmd_line = "resize Image : " + srcFile + " ==> " + destFile + " newSize=(" + str(x) + "x" + str(y) + ")"
|
cmd_line = "resize Image : " + srcFile + " ==> " + destFile + " newSize=(" + str(x) + "x" + str(y) + ")"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user