From: jpr Date: Tue, 26 Apr 2005 16:21:54 +0000 (+0000) Subject: Some checking added X-Git-Tag: Version1.2.bp~750 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c3094723404202f691d827ca89cca24bbd8921e7;p=gdcm.git Some checking added --- diff --git a/Example/PrintDicomDir.cxx b/Example/PrintDicomDir.cxx index 329e47c8..8d3f714e 100644 --- a/Example/PrintDicomDir.cxx +++ b/Example/PrintDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/04/14 15:13:39 $ - Version: $Revision: 1.20 $ + Date: $Date: 2005/04/26 16:21:54 $ + Version: $Revision: 1.21 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -50,11 +50,11 @@ int main(int argc, char* argv[]) if (argc > 3) gdcm::Debug::DebugOn(); - e1 = new gdcm::DicomDir( fileName ); - - // new style id useless, since it has no effect fore *reading* a DICOMDIR + // new style is useless, since it has no effect fore *reading* a DICOMDIR // (only meaningfull when *creating* a DICOMDIR) + e1 = new gdcm::DicomDir( fileName ); + //e1 = new gdcm::DicomDir(); //e1->SetParseDir(false); //e1->Load( fileName ); diff --git a/Example/PrintDocument.cxx b/Example/PrintDocument.cxx index d94d8112..412134fe 100644 --- a/Example/PrintDocument.cxx +++ b/Example/PrintDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintDocument.cxx,v $ Language: C++ - Date: $Date: 2005/04/25 14:07:05 $ - Version: $Revision: 1.13 $ + Date: $Date: 2005/04/26 16:21:54 $ + Version: $Revision: 1.14 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -54,9 +54,14 @@ int main(int argc, char *argv[]) if (argc > 4) e1->SetLoadMode(NO_SEQ | NO_SHADOW); - e1->Load( fileName.c_str() ); + if ( !e1->IsReadable() ) + { + delete e1; + return 0; + } + e1->Print(); std::cout << "\n\n" << std::endl; diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index 6135c783..91c2ff42 100644 --- a/Example/PrintFile.cxx +++ b/Example/PrintFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintFile.cxx,v $ Language: C++ - Date: $Date: 2005/04/05 10:28:59 $ - Version: $Revision: 1.31 $ + Date: $Date: 2005/04/26 16:21:55 $ + Version: $Revision: 1.32 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -46,10 +46,15 @@ int main(int argc, char *argv[]) gdcm::Debug::DebugOn(); if (argc > 4) - e1->SetLoadMode(NO_SEQ | NO_SHADOW); - + e1->SetLoadMode(NO_SEQ | NO_SHADOW); e1->Load( fileName.c_str() ); + if ( !e1->IsReadable() ) + { + delete e1; + return 0; + } + f1 = new gdcm::FileHelper(e1); if (argc > 2) // keep it here (f1 needs to be constructed !) diff --git a/Example/exAnonymizeNoLoad.cxx b/Example/exAnonymizeNoLoad.cxx index 4335a85a..2b55850c 100644 --- a/Example/exAnonymizeNoLoad.cxx +++ b/Example/exAnonymizeNoLoad.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: exAnonymizeNoLoad.cxx,v $ Language: C++ - Date: $Date: 2005/03/09 19:16:33 $ - Version: $Revision: 1.2 $ + Date: $Date: 2005/04/26 16:21:55 $ + Version: $Revision: 1.3 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -32,7 +32,7 @@ int main(int argc, char *argv[]) std::cout << "even if pixels are not gdcm readable (JPEG2000)" << std::endl; std::cout << "Warning : the image is overwritten" << std::endl; std::cout << " : to preserve image integrity " - << " use exAnonymize " << std::endl; + << " use exAnonymize " << std::endl; if( argc < 3 ) {