Ignore:
Timestamp:
03/12/14 14:34:37 (11 years ago)
Author:
lyard
Message:
Fixed bug that wrongly calculated the checksum of compressed files. Weird that I did not notice it ealier...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mcore/zfits.h

    r17402 r17607  
    2020    // Basic constructor
    2121    zfits(const std::string& fname, const std::string& tableName="", bool force=false)
    22         : fCatalogInitialized(false), fNumTiles(0), fNumRowsPerTile(0), fCurrentRow(-2), fHeapOff(0), fTileSize(0)
     22        : fCatalogInitialized(false), fNumTiles(0), fNumRowsPerTile(0), fCurrentRow(-1), fHeapOff(0), fTileSize(0)
    2323    {
    2424        open(fname.c_str());
     
    2929    // Alternative contstructor
    3030    zfits(const std::string& fname, const std::string& fout, const std::string& tableName, bool force=false)
    31         : fCatalogInitialized(false), fNumTiles(0), fNumRowsPerTile(0), fCurrentRow(-2), fHeapOff(0), fTileSize(0)
     31        : fCatalogInitialized(false), fNumTiles(0), fNumRowsPerTile(0), fCurrentRow(-1), fHeapOff(0), fTileSize(0)
    3232    {
    3333        open(fname.c_str());
     
    316316            // seek for the sub tile. If we were just reading the previous one
    317317            // we can skip that.
    318             if (!isNextTile)
     318            if (!isNextTile || requestedTile==0)
    319319            {
    320320                // step to the beginnig of the super tile
     
    335335            // this is now the beginning of the sub-tile we want to read
    336336            const int64_t subTileStart = tellg() - fHeapOff;
    337 
    338337            // calculate the 32 bits offset of the current tile.
    339338            const uint32_t offset = (subTileStart + fHeapFromDataStart)%4;
     
    387386            if (isNextTile)
    388387            {
     388//                std::cout << "Updating checksum" << std::endl;
    389389                // Padding for checksum calculation
    390390                memset(fCompressedBuffer.data(),   0, offset);
Note: See TracChangeset for help on using the changeset viewer.