Changeset 6808


Ignore:
Timestamp:
08/18/10 13:15:12 (9 years ago)
Author:
melissa
Message:

If a negative width or height is stored, use the absolute value instead (and print an appropriate debugging message).

Files:
2 edited

Legend:

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

    r6663 r6808  
    183183    core[0].sizeY = in.readInt(); 
    184184 
    185     if (getSizeX() < 1 || getSizeY() < 1) { 
    186       throw new FormatException("Invalid image dimensions: " + 
    187         getSizeX() + " x " + getSizeY()); 
     185    if (getSizeX() < 1) { 
     186      LOGGER.trace("Invalid width: {}; using the absolute value", getSizeX()); 
     187      core[0].sizeX = Math.abs(getSizeX()); 
     188    } 
     189    if (getSizeY() < 1) { 
     190      LOGGER.trace("Invalid height: {}; using the absolute value", getSizeY()); 
     191      core[0].sizeY = Math.abs(getSizeY()); 
    188192    } 
    189193 
  • trunk/components/bio-formats/src/loci/formats/in/BMPReader.java

    r6655 r6808  
    183183    core[0].sizeY = in.readInt(); 
    184184 
    185     if (getSizeX() < 1 || getSizeY() < 1) { 
    186       throw new FormatException("Invalid image dimensions: " + 
    187         getSizeX() + " x " + getSizeY()); 
     185    if (getSizeX() < 1) { 
     186      LOGGER.trace("Invalid width: {}; using the absolute value", getSizeX()); 
     187      core[0].sizeX = Math.abs(getSizeX()); 
     188    } 
     189    if (getSizeY() < 1) { 
     190      LOGGER.trace("Invalid height: {}; using the absolute value", getSizeY()); 
     191      core[0].sizeY = Math.abs(getSizeY()); 
    188192    } 
    189193 
Note: See TracChangeset for help on using the changeset viewer.