Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/07/19 05:59:12 $
- Version: $Revision: 1.54 $
+ Date: $Date: 2004/07/28 21:13:03 $
+ Version: $Revision: 1.58 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param SyntaxToCheck The transfert syntax we need to check against.
* @return True when SyntaxToCheck corresponds to the Transfer Syntax of
* the current document. False either when the document contains
- * no Transfer Syntax, or when the Tranfer Syntaxes don't match.
+ * no Transfer Syntax, or when the Tranfer Syntaxes doesn't match.
*/
bool gdcmDocument::IsGivenTransferSyntax(std::string const & syntaxToCheck)
{
}
// The entry might be present but not loaded (parsing and loading
- // happen at differente stages): try loading and proceed with check...
+ // happen at different stages): try loading and proceed with check...
LoadDocEntrySafe(entry);
if (gdcmValEntry* valEntry = dynamic_cast< gdcmValEntry* >(entry) )
{
std::string transfer = valEntry->GetValue();
-
// The actual transfer (as read from disk) might be padded. We
// first need to remove the potential padding. We can make the
// weak assumption that padding was not executed with digits...
+ if ( transfer.length() == 0 ) { // for brain damaged headers
+ return false;
+ }
while ( ! isdigit(transfer[transfer.length()-1]) )
{
transfer.erase(transfer.length()-1, 1);
}
if ( transfer == syntaxToCheck )
- //if( transfer.find( syntaxToCheck ) ) //should be faster
{
- int k =
- abort()
return true;
}
}
" ValEntry (try promotion first).");
return false;
}
- // Non even content must be padded with a space (020H).
+ // Non even content must be padded with a space (020H)...
if( content.length() % 2 )
{
- content += '\0';
+ content += '\0'; // ... therefore we padd with (000H) .!?!
}
valEntry->SetValue(content);
return false;
}
-/* Hope Binaray field length is *never* wrong
+/* Hope Binary field length is *never* wrong
if(lgth%2) // Non even length are padded with a space (020H).
{
lgth++;
// is in explicit VR and try to fix things if it happens not to be
// the case.
- fread (&vr, (size_t)2,(size_t)1, Fp);
+ fread (vr, (size_t)2,(size_t)1, Fp);
vr[2] = 0;
if( !CheckDocEntryVR(entry, vr) )
s << " Read one length: ";
s << std::hex << individualLength << std::endl;
dbg.Verbose(0, "gdcmDocument::Parse7FE0: ", s.str().c_str());
- }
+ }
+ delete[] basicOffsetTableItemValue;
}
if ( ! IsRLELossLessTransferSyntax() )