Changeset 6573


Ignore:
Timestamp:
06/28/10 10:09:37 (9 years ago)
Author:
melissa
Message:

Fixed GZIP pixel data detection for ICS files.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/in/ICSReader.java

    r6495 r6573  
    716716    offset = in.getFilePointer(); 
    717717 
    718     // extra check is because some of our datasets are labeled as 'gzip', and 
    719     // have a valid GZIP header, but are actually uncompressed 
    720     long pixelDataSize = getSizeX() * getSizeY() * (bitsPerPixel / 8) * 
    721       getImageCount() * getRGBChannelCount(); 
    722     if (gzip && ((in.length() - in.getFilePointer()) < pixelDataSize)) { 
     718    if (gzip) { 
    723719      data = new byte[(int) (in.length() - in.getFilePointer())]; 
    724720      LOGGER.info("Decompressing pixel data"); 
     
    735731        r.close(); 
    736732        data = v.getBytes(); 
    737         Location.mapFile("data.gz", null); 
    738733      } 
    739734      catch (IOException dfe) { 
     
    741736      } 
    742737    } 
    743     else gzip = false; 
    744738 
    745739    if (bitsPerPixel < 32) core[0].littleEndian = !isLittleEndian(); 
  • trunk/components/bio-formats/src/loci/formats/in/ICSReader.java

    r6495 r6573  
    716716    offset = in.getFilePointer(); 
    717717 
    718     // extra check is because some of our datasets are labeled as 'gzip', and 
    719     // have a valid GZIP header, but are actually uncompressed 
    720     long pixelDataSize = getSizeX() * getSizeY() * (bitsPerPixel / 8) * 
    721       getImageCount() * getRGBChannelCount(); 
    722     if (gzip && ((in.length() - in.getFilePointer()) < pixelDataSize)) { 
     718    if (gzip) { 
    723719      data = new byte[(int) (in.length() - in.getFilePointer())]; 
    724720      LOGGER.info("Decompressing pixel data"); 
     
    735731        r.close(); 
    736732        data = v.getBytes(); 
    737         Location.mapFile("data.gz", null); 
    738733      } 
    739734      catch (IOException dfe) { 
     
    741736      } 
    742737    } 
    743     else gzip = false; 
    744738 
    745739    if (bitsPerPixel < 32) core[0].littleEndian = !isLittleEndian(); 
Note: See TracChangeset for help on using the changeset viewer.