[many things were solved since the original question. See the comments below. It remains that the final file only contain the first page, I don't see any warning or error messages]
I saw that in recent version of Pillow added support for saving multipage images, esp. TIFF with im_all.save('test.tiff', save_all=True).
Now it is not clear to me how I should proceed to create a multipage .tiff using a list of .tiff pages to be put together. I couldn't find an example or some indication in the documentation. Do I need to resize each image to the size of the final document ? I made a naive test withmy B&W .tiff which have mode "1"
list_im=[]
im_all=Image.new("1", (2500, 3500))
for i in list_file:
print i
im = Image.open(path_tmp+'/'+i)
print im.format, im.size, im.mode
list_im.append(im)
im.close()
im_all.save('test.tiff', save_all=True,append_images=list_im)
but I got the error messages
42526530005_632__0.tiff
TIFF (2445, 3472) 1
42526530005_632__1.tiff
TIFF (2448, 3474) 1
42526530005_632__2.tiff
TIFF (2451, 3471) 1
42526530005_632__3.tiff
TIFF (2454, 3471) 1
42526530005_632__4.tiff
TIFF (2459, 3471) 1
42526530005_632__5.tiff
TIFF (2467, 3472) 1
42526530005_632__6.tiff
TIFF (2452, 3471) 1
Traceback (most recent call last):
File "master_cost_claims_analyser.py", line 1401, in <module>
main()
File "master_cost_claims_analyser.py", line 1398, in main
args.all_steps)
File "master_cost_claims_analyser.py", line 565, in cost_claim_analyser_main
verbose)
File "H:/DATA/Projects and Documents/Projects/ClaimsCostAnalyzer/ClaimsCostAnalyzerCode/ClaimsExtraction/get_claims_functions.py", line 176, in get_claims
im_all.save('test.tiff', save_all=True,append_images=list_im)
File "C:\Program Files\Anaconda2\lib\site-packages\PIL\Image.py", line 1679, in save
save_handler = SAVE_ALL[format.upper()]
KeyError: 'TIFF'
I am using python 2.7.12 pillow 3.2.0
Do somebody know how we save a list of .tiff page in a multipage .tiff documents ? I guess I am doing something wrong.
Thanks
Fabien