mirror of
https://git.planet-casio.com/Lephenixnoir/fxsdk.git
synced 2024-12-29 13:03:37 +01:00
Merge pull request 'fxconv API accepts PIL.Image.Image' (#4) from Darks/fxsdk:master into master
This commit is contained in:
commit
f11f6929b4
1 changed files with 20 additions and 5 deletions
|
@ -247,6 +247,9 @@ def convert_binary(input, output, params, target):
|
||||||
#
|
#
|
||||||
|
|
||||||
def convert_bopti_fx(input, output, params, target):
|
def convert_bopti_fx(input, output, params, target):
|
||||||
|
if isinstance(input, Image.Image):
|
||||||
|
img = input.copy()
|
||||||
|
else:
|
||||||
img = Image.open(input)
|
img = Image.open(input)
|
||||||
if img.width >= 4096 or img.height >= 4096:
|
if img.width >= 4096 or img.height >= 4096:
|
||||||
raise FxconvError(f"'{input}' is too large (max. 4095x4095)")
|
raise FxconvError(f"'{input}' is too large (max. 4095x4095)")
|
||||||
|
@ -322,6 +325,9 @@ def _image_project(img, f):
|
||||||
#
|
#
|
||||||
|
|
||||||
def convert_bopti_cg(input, output, params, target):
|
def convert_bopti_cg(input, output, params, target):
|
||||||
|
if isinstance(input, Image.Image):
|
||||||
|
img = input.copy()
|
||||||
|
else:
|
||||||
img = Image.open(input)
|
img = Image.open(input)
|
||||||
if img.width >= 65536 or img.height >= 65536:
|
if img.width >= 65536 or img.height >= 65536:
|
||||||
raise FxconvError(f"'{input}' is too large (max. 65535x65535)")
|
raise FxconvError(f"'{input}' is too large (max. 65535x65535)")
|
||||||
|
@ -399,6 +405,9 @@ def convert_topti(input, output, params, target):
|
||||||
# Image area and grid
|
# Image area and grid
|
||||||
#--
|
#--
|
||||||
|
|
||||||
|
if isinstance(input, Image.Image):
|
||||||
|
img = input.copy()
|
||||||
|
else:
|
||||||
img = Image.open(input)
|
img = Image.open(input)
|
||||||
area = Area(params.get("area", {}), img)
|
area = Area(params.get("area", {}), img)
|
||||||
img = img.crop(area.tuple())
|
img = img.crop(area.tuple())
|
||||||
|
@ -512,6 +521,9 @@ def convert_topti(input, output, params, target):
|
||||||
#
|
#
|
||||||
|
|
||||||
def convert_libimg_fx(input, output, params, target):
|
def convert_libimg_fx(input, output, params, target):
|
||||||
|
if isinstance(input, Image.Image):
|
||||||
|
img = input.copy()
|
||||||
|
else:
|
||||||
img = Image.open(input)
|
img = Image.open(input)
|
||||||
if img.width >= 65536 or img.height >= 65536:
|
if img.width >= 65536 or img.height >= 65536:
|
||||||
raise FxconvError(f"'{input}' is too large (max. 65535x65535)")
|
raise FxconvError(f"'{input}' is too large (max. 65535x65535)")
|
||||||
|
@ -557,6 +569,9 @@ def convert_libimg_fx(input, output, params, target):
|
||||||
#
|
#
|
||||||
|
|
||||||
def convert_libimg_cg(input, output, params, target):
|
def convert_libimg_cg(input, output, params, target):
|
||||||
|
if isinstance(input, Image.Image):
|
||||||
|
img = input.copy()
|
||||||
|
else:
|
||||||
img = Image.open(input)
|
img = Image.open(input)
|
||||||
if img.width >= 65536 or img.height >= 65536:
|
if img.width >= 65536 or img.height >= 65536:
|
||||||
raise FxconvError(f"'{input}' is too large (max. 65535x65535)")
|
raise FxconvError(f"'{input}' is too large (max. 65535x65535)")
|
||||||
|
|
Loading…
Reference in a new issue