Problem solved. In addition to the little mistakes that were pointed, it appears that the problem came from another part of the code, a WriterFilter to our own image file format. Thanks for evrything. Jeremy