]> Creatis software - gdcm.git/blobdiff - src/gdcmFileHelper.cxx
ENH: Refactorize code, from PrintFile into the class, to allow user to reuse the...
[gdcm.git] / src / gdcmFileHelper.cxx
index 7e0a018cff474bb4091997d8a5e89615610d8876..e91570e2833ee4a2ee654470002d92259bea5621 100644 (file)
@@ -4,8 +4,8 @@
   Module:    $RCSfile: gdcmFileHelper.cxx,v $
   Language:  C++
 
-  Date:      $Date: 2005/08/30 15:36:18 $
-  Version:   $Revision: 1.56 $
+  Date:      $Date: 2005/09/07 08:55:23 $
+  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
@@ -100,7 +100,7 @@ fh1->Write(newFileName);
       (checks user given pixels length)
    FileInternal->Write(fileName,WriteType)
    fp = opens file(fileName);
-   ComputeGroup0002Length(writetype);
+   ComputeGroup0002Length( );
    BitsAllocated 12->16
       RemoveEntryNoDestroy(palettes, etc)
       Document::WriteContent(fp, writetype);
@@ -1591,8 +1591,11 @@ void FileHelper::Print(std::ostream &os, std::string const &)
    FileInternal->SetPrintLevel(PrintLevel);
    FileInternal->Print(os);
 
-   PixelReadConverter->SetPrintLevel(PrintLevel);
-   PixelReadConverter->Print(os);
+   if ( FileInternal->IsReadable() )
+   {
+      PixelReadConverter->SetPrintLevel(PrintLevel);
+      PixelReadConverter->Print(os);
+   }
 }
 
 //-----------------------------------------------------------------------------