mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 12:17:14 +03:00
ad784eb808
This is Christoph Gohlke's test suite from his personal PIL package found at http://www.lfd.uci.edu/~gohlke/pythonlibs/. This is just to bring it in as a separate commit. Future commits will align it with Pillow.
29 lines
517 B
Python
29 lines
517 B
Python
import sys
|
|
sys.path.insert(0, ".")
|
|
|
|
from PIL import Image
|
|
from PIL import ImageCms
|
|
|
|
try:
|
|
filename = sys.argv[1]
|
|
except IndexError:
|
|
filename = "../pil-archive/cmyk.jpg"
|
|
|
|
i = Image.open(filename)
|
|
|
|
print(i.format)
|
|
print(i.mode)
|
|
print(i.size)
|
|
print(i.tile)
|
|
|
|
p = ImageCms.getMemoryProfile(i.info["icc_profile"])
|
|
|
|
print(repr(p.product_name))
|
|
print(repr(p.product_info))
|
|
|
|
o = ImageCms.createProfile("sRGB")
|
|
t = ImageCms.buildTransformFromOpenProfiles(p, o, i.mode, "RGB")
|
|
i = ImageCms.applyTransform(i, t)
|
|
|
|
i.show()
|