View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003917VTK(No Category)public2006-10-10 17:002013-04-05 20:34
ReporterCory Quammen 
Assigned ToAndinet 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003917: vtkTIFFWriter crashes when saving image sequence
DescriptionWhen trying to save a vtkImageData object as a set of TIFF images, vtkTIFFWriter crashes. This example (in Java) will cause the crash:

--

vtkTIFFWriter writer = new vtkTIFFWriter();
writer.SetCompressionToNoCompression();
writer.SetFilePrefix(fileName);
writer.SetFilePattern("%s%04d.tif");
writer.SetFileDimensionality(2);

// Gets 3D volume of unsigned shorts
vtkImageData stack = generateStack();
writer.SetInput(stack);
writer.Write();

--

The problem is that the TIFF writer always tries to use the file name passed through SetFileName() when opening the file for writing. If you don't specify a name through SetFileName(), then the file name is a null pointer, causing a crash. If you do call SetFileName("file.tif"), then you will wind up with on saved file with the name "file.tif", so that is not a solution.

I fixed the crash by modifying the file vtkTIFFWriter.cxx on line 124. It uses the member variable InternalFileName as the source of the file name instead of calling GetFileName() and works correctly. This is the same way vtkPNGWriter and vtkJPGWriter get the file name. The modified file is attached.
TagsNo tags attached.
Project
Type
Attached Filescxx file icon vtkTIFFWriter.cxx [^] (9,105 bytes) 1969-12-31 19:00

 Relationships

  Notes
(0011260)
Andinet (developer)
2008-04-10 12:14

The fix is committed to CVS.
(0028688)
Cory Quammen (developer)
2012-06-11 23:14

This can be marked closed as the fix has been in the repository for a long time now.

 Issue History
Date Modified Username Field Change
2008-02-06 10:44 Jeff Baumes Assigned To Mathieu Malaterre => Andinet
2008-04-10 12:14 Andinet Status tabled => @80@
2008-04-10 12:14 Andinet Resolution open => fixed
2008-04-10 12:14 Andinet Note Added: 0011260
2011-06-16 13:11 Zack Galbreath Category => (No Category)
2012-06-11 23:14 Cory Quammen Note Added: 0028688
2013-04-05 20:34 Berk Geveci Status customer review => closed


Copyright © 2000 - 2018 MantisBT Team