X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=src%2FgdcmJPEGFragment.cxx;h=3a50c996bbceac1474a271afba6cc4c04b95a17d;hb=df1540af8230b8ca5e3cba23e9127e2a2428df78;hp=2dc8c121034324a13ac1750fb81a4975a17b2440;hpb=6d79b5e185867ef00629f1ccb279c32daa6357d2;p=gdcm.git diff --git a/src/gdcmJPEGFragment.cxx b/src/gdcmJPEGFragment.cxx index 2dc8c121..3a50c996 100644 --- a/src/gdcmJPEGFragment.cxx +++ b/src/gdcmJPEGFragment.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmJPEGFragment.cxx,v $ Language: C++ - Date: $Date: 2005/11/28 16:50:32 $ - Version: $Revision: 1.16 $ + Date: $Date: 2008/01/02 10:48:52 $ + Version: $Revision: 1.20 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -19,7 +19,7 @@ #include "gdcmJPEGFragment.h" #include "gdcmDebug.h" -namespace gdcm +namespace GDCM_NAME_SPACE { //------------------------------------------------------------------------- // For JPEG 2000, body in file gdcmJpeg2000.cxx @@ -67,11 +67,13 @@ void JPEGFragment::DecompressJPEGFramesFromFile(std::ifstream *fp, } else if ( nBits <= 12 ) { + assert( nBits >= 8 ); // JPEG Lossy : call to IJG 6b - 12 bits ReadJPEGFile12 ( fp, buffer, statesuspension); } else if ( nBits <= 16 ) { + assert( nBits >= 12 ); // JPEG Lossy : call to IJG 6b - 16 bits ReadJPEGFile16 ( fp, buffer, statesuspension); //gdcmAssertMacro( IsJPEGLossless ); @@ -99,11 +101,13 @@ void JPEGFragment::DecompressJPEGFramesFromFile(std::ifstream *fp, * @param os Stream to print to. * @param indent Indentation string to be prepended during printing. */ -void JPEGFragment::Print( std::ostream &os, std::string indent ) +void JPEGFragment::Print( std::ostream &os, std::string const &indent ) { os << indent - << "JPEG fragment: offset : " << Offset - << " length : " << Length + << "JPEG fragment: offset : " << std::dec << Offset + << " 0x(" << std::hex << Offset << ") " + << std::dec << " length : " << Length + << " 0x(" << std::hex << Length << ") " << std::endl; }