I a trying to create a series of thumbnail images from a multpage TIFF
file. The sample code is below. When it executes, we get the
following error;
FreeImagePy.con stants.FreeImag ePy_ColorWrong: 'Wrong color 1 in
function: FreeImage_MakeT humbnail. I can use: (8, 24, 32)'
Any suggestions?
fname = "01-PJ2306.tif"
img = FIPY.Image()
img.load(fname)
#NOTE: the follow method results"
#getFormat: ((18, 0), ('TIFF', 'MINISWHITE'), (200, 200))
#getColorUsed: 2
#getNumPages: 8
for pg in range(img.getNu mPages()):
print 'page;',pg
bmp = FIPY.Image()
bmp.new((300,30 0),fileType=FIF _TIFF)
bmp.setBitmap(i mg)
bmp.thumbnail(3 00,convert=True )
bmp.save("first _thumb_"+str(pg ), FIF_PNG)
img.setCurrentP age(pg+1)
del bmp
Using the above "img" we were able to successfully create the seperate
pages as PNG files in a working directory, however, our goal is to use
to display a series of thumbnails in a wxpython application. The app
will stored references back to the orginal document with the
correspondng page number. Essentially we want to avoid having to
"cleanup" a working directory of the PNG pages.
.... but if someone has suggestions on this, we are interested too !
Thanks in avance.
file. The sample code is below. When it executes, we get the
following error;
FreeImagePy.con stants.FreeImag ePy_ColorWrong: 'Wrong color 1 in
function: FreeImage_MakeT humbnail. I can use: (8, 24, 32)'
Any suggestions?
fname = "01-PJ2306.tif"
img = FIPY.Image()
img.load(fname)
#NOTE: the follow method results"
#getFormat: ((18, 0), ('TIFF', 'MINISWHITE'), (200, 200))
#getColorUsed: 2
#getNumPages: 8
for pg in range(img.getNu mPages()):
print 'page;',pg
bmp = FIPY.Image()
bmp.new((300,30 0),fileType=FIF _TIFF)
bmp.setBitmap(i mg)
bmp.thumbnail(3 00,convert=True )
bmp.save("first _thumb_"+str(pg ), FIF_PNG)
img.setCurrentP age(pg+1)
del bmp
Using the above "img" we were able to successfully create the seperate
pages as PNG files in a working directory, however, our goal is to use
to display a series of thumbnails in a wxpython application. The app
will stored references back to the orginal document with the
correspondng page number. Essentially we want to avoid having to
"cleanup" a working directory of the PNG pages.
.... but if someone has suggestions on this, we are interested too !
Thanks in avance.
Comment