Page MenuHomePhabricator

Second version of mitk::ImageWriter::SetExtension() sets filename
Closed, ResolvedPublic

Description

mitk::ImageWriter has two methods SetExtension(), one with const char* as parameter, one with std::string as parameter.

The std::string version overwrites the filename (instead of the extension, as should be expected):

void mitk::ImageWriter::SetExtension(const std::string & extension)
{

this->SetFileName( extension.c_str() );

}

Instead, the method should probably look like this:

void mitk::ImageWriter::SetExtension(const std::string & extension)
{

this->SetExtension( extension.c_str() );

}

Event Timeline

Obvious error, trivial change. Will extend test as well

New remote branch pushed: bug-15898-imagewriter-extension-handling

Not so obvious to fix, wrote ChangeRequest

With the new reader / writer framework, the interfaces will have a clear semantic for file name, path, and extension arguments. The new ImageWriter implementation within that framework will be much simpler and will avoid the current complex handling of extensions and file names.