Changeset 5978


Ignore:
Timestamp:
03/01/10 13:23:39 (10 years ago)
Author:
melissa
Message:

Fixed two more QuickTime padding bugs.

Location:
trunk/components/bio-formats/src/loci/formats
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/NativeQTReader.java

    r5517 r5978  
    201201    // determine whether we need to strip out any padding bytes 
    202202 
     203    int bytes = bitsPerPixel < 40 ? bitsPerPixel / 8 : (bitsPerPixel - 32) / 8; 
    203204    int pad = (4 - (getSizeX() % 4)) % 4; 
    204205    if (codec.equals("mjpb")) pad = 0; 
     
    213214 
    214215    if (pad > 0) { 
    215       int bytes = bitsPerPixel < 40 ? bitsPerPixel / 8 : 
    216         (bitsPerPixel - 32) / 8; 
    217       t = new byte[prevPixels.length - getSizeY()*pad*bytes]; 
     216      t = new byte[prevPixels.length - getSizeY()*pad]; 
    218217 
    219218      for (int row=0; row<getSizeY(); row++) { 
    220         System.arraycopy(prevPixels, bytes * row * (getSizeX() + pad), t, 
     219        System.arraycopy(prevPixels, row * (bytes * getSizeX() + pad), t, 
    221220          row * getSizeX() * bytes, getSizeX() * bytes); 
    222221      } 
  • trunk/components/bio-formats/src/loci/formats/out/QTWriter.java

    r5976 r5978  
    189189    int bytesPerPixel = 
    190190      FormatTools.pixelTypeFromString(r.getPixelsPixelType(series, 0)); 
    191     int pad = ((4 - (width % 4)) % 4) * bytesPerPixel; 
    192191    Integer samples = r.getLogicalChannelSamplesPerPixel(series, 0); 
    193192    if (samples == null) { 
     
    195194    } 
    196195    int nChannels = samples == null ? 1 : samples.intValue(); 
     196    int pad = (4 - (width % 4)) % 4; 
    197197 
    198198    if (!initialized) { 
Note: See TracChangeset for help on using the changeset viewer.