gdcm::String does not keep padding in mind when comparing to char* and std::string
Cross-platform DICOM implementation
Brought to you by:
malat
I have discovered that in GDCM exist places, where strings are compared with raw strings (const char*) without applying padding (which always results in GDCM believing that strings are different even when they are not).
For instance, this code (gdcmPixmapWriter.cxx:789):
Attribute<0x0002,0x0010> at;
at.SetFromDataSet( fmi );
const char *tsuid = TransferSyntax::GetTSString( ts );
UIComp tsui = at.GetValue();
if( tsui != tsuid )
{
gdcmErrorMacro( "Incompatible TransferSyntax." );
return false;
}
Tries to compare gdcm::String with const char* and fails if length of tsuid is odd.
This very example is not so important as it is in the undocumented section, but I thought this issue might arise somewhere else and is worth some attention.
String::Trim()needs to be used explicitely