C++ opening corrupt tif file
Posted: 2011-06-14T07:39:31-07:00
Hi,
I have a corrupt tif file that I would like to open with Magick++ and save it to the same tif format. I need to do this because I have a Scanner application that needs to set lenght parameter of the paper. If I set longer than in real it generates a corrupted tif file. (I have no clue why ) The other problem is that I can not publish these pictures but I generated one. If I use the following code and ignoring exceptions when I'm reading the file it generates a tif file that can be opened with any viewer program. If I want to perform this on a bigger tif file in this case 11124 * 7187 sizes about 22 MB can not generate the output file.
Version: ImageMagick-6.7.0-6-Q16-windows-dll.exe
Unhandled exceptions:
http://dl.dropbox.com/u/5179477/ImageMagicktest/ex1.tif
http://dl.dropbox.com/u/5179477/ImageMagicktest/ex2.tif
A simulated corrupt image can be downloaded here: http://dl.dropbox.com/u/5179477/ImageMa ... t/test.tif
It's sure all exception appears because of the corrupt tif file. If I perform this operation on another pic it works fine.
The problem is that we process the images in Labview and if we have a corrupt file we can't read it. If you could help me to find a solution I would be really happy!
Regards,
Adam
I have a corrupt tif file that I would like to open with Magick++ and save it to the same tif format. I need to do this because I have a Scanner application that needs to set lenght parameter of the paper. If I set longer than in real it generates a corrupted tif file. (I have no clue why ) The other problem is that I can not publish these pictures but I generated one. If I use the following code and ignoring exceptions when I'm reading the file it generates a tif file that can be opened with any viewer program. If I want to perform this on a bigger tif file in this case 11124 * 7187 sizes about 22 MB can not generate the output file.
Version: ImageMagick-6.7.0-6-Q16-windows-dll.exe
Code: Select all
img.read("test_in.tif");
img.write("test_out.tif");
http://dl.dropbox.com/u/5179477/ImageMagicktest/ex1.tif
http://dl.dropbox.com/u/5179477/ImageMagicktest/ex2.tif
A simulated corrupt image can be downloaded here: http://dl.dropbox.com/u/5179477/ImageMa ... t/test.tif
It's sure all exception appears because of the corrupt tif file. If I perform this operation on another pic it works fine.
The problem is that we process the images in Labview and if we have a corrupt file we can't read it. If you could help me to find a solution I would be really happy!
Regards,
Adam