fallenrelics
11-27-2008, 07:23 AM
Hey everyone I'm having some difficulty integrating the PIL python module to generate thumbnails of my rendered frames.
I've set up my maya.env to use the activepython 2.5 interpreter.
MAYA_LOCATION = C:\Program Files\Autodesk\Maya8.5;
PYTHONPATH = C:\Python25\Lib\site-packages;
My python code is:
import os
import glob
from PIL import Image
os.chdir("C:/Users/Paul/Documents/maya/projects/default/images");
for infile in glob.glob("*.jpg"):
print infile;
im = Image.open(infile)
im.thumbnail((128, 128), Image.ANTIALIAS);
print im.format
If I remove the thumbnail() function I still get the format so it seems like PIL is functioning correctly however once i add the thumbnail function i get long error:
# Error: The _imaging C module is not installed
# Traceback (most recent call last):
# File "<maya console>", line 10, in ?
# File "C:\Python25\Lib\site-packages\PIL\Image.py", line 1522, in thumbnail
# self.load()
# File "C:\Python25\Lib\site-packages\PIL\ImageFile.py", line 155, in load
# self.load_prepare()
# File "C:\Python25\Lib\site-packages\PIL\ImageFile.py", line 223, in load_prepare
# self.im = Image.core.new(self.mode, self.size)
# File "C:\Python25\Lib\site-packages\PIL\Image.py", line 36, in __getattr__
# raise ImportError("The _imaging C module is not installed")
# ImportError: The _imaging C module is not installed #
If anyone has any experience with maya and PIL or have any other method of producing thumbnails from maya please let me know.
I've set up my maya.env to use the activepython 2.5 interpreter.
MAYA_LOCATION = C:\Program Files\Autodesk\Maya8.5;
PYTHONPATH = C:\Python25\Lib\site-packages;
My python code is:
import os
import glob
from PIL import Image
os.chdir("C:/Users/Paul/Documents/maya/projects/default/images");
for infile in glob.glob("*.jpg"):
print infile;
im = Image.open(infile)
im.thumbnail((128, 128), Image.ANTIALIAS);
print im.format
If I remove the thumbnail() function I still get the format so it seems like PIL is functioning correctly however once i add the thumbnail function i get long error:
# Error: The _imaging C module is not installed
# Traceback (most recent call last):
# File "<maya console>", line 10, in ?
# File "C:\Python25\Lib\site-packages\PIL\Image.py", line 1522, in thumbnail
# self.load()
# File "C:\Python25\Lib\site-packages\PIL\ImageFile.py", line 155, in load
# self.load_prepare()
# File "C:\Python25\Lib\site-packages\PIL\ImageFile.py", line 223, in load_prepare
# self.im = Image.core.new(self.mode, self.size)
# File "C:\Python25\Lib\site-packages\PIL\Image.py", line 36, in __getattr__
# raise ImportError("The _imaging C module is not installed")
# ImportError: The _imaging C module is not installed #
If anyone has any experience with maya and PIL or have any other method of producing thumbnails from maya please let me know.
