Program:   gdcm
   Module:    $RCSfile: gdcmPixelWriteConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/08/27 16:14:47 $
-  Version:   $Revision: 1.18 $
+  Date:      $Date: 2007/08/28 16:47:48 $
+  Version:   $Revision: 1.19 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
     int bitsallocated = image->GetBitsAllocated();
     int sign = image->IsSignedPixelData();
    unsigned int fragment_size = xsize*ysize*samplesPerPixel * (bitsallocated / 8);
-    assert( fragment_size*zsize == size );
-
+    //assert( fragment_size*zsize == size );
+    gdcmDebugMacro("fragment_size " << fragment_size << " zsize " << zsize << " size " << size);    
+    assert( abs(fragment_size*zsize-size) <=1 );
    JpegVector JpegFragmentSize;
 #if WITHOFFSETTABLE
    size_t bots; //basic offset table start
    //std::cout << "Sample: " << samplesPerPixel << std::endl;
     int bitsallocated = image->GetBitsAllocated();
    unsigned int fragment_size = xsize*ysize*samplesPerPixel * (bitsallocated / 8);
-    assert( fragment_size*zsize == size );
+    gdcmDebugMacro("fragment_size " << fragment_size << " zsize " << zsize << " size " << size);
+    assert( abs(fragment_size*zsize-size) <=1 );
 
    JpegVector JpegFragmentSize;
 #if WITHOFFSETTABLE