Changeset 2143


Ignore:
Timestamp:
01/19/07 16:37:27 (13 years ago)
Author:
curtis
Message:

Update handling of null sizeC (if Leica TIFF is given as id);
add more debugging stack traces in exception handling blocks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/LeicaReader.java

    r2142 r2143  
    232232        super.initMetadata(); 
    233233      } 
    234       catch (NullPointerException n) { } 
     234      catch (NullPointerException n) { 
     235        if (debug) n.printStackTrace(); 
     236      } 
    235237 
    236238      if (ifds == null) throw new FormatException("No IFDs found"); 
     
    587589      return false; 
    588590    } 
    589     catch (IOException exc) { } 
    590     catch (NullPointerException exc) { } 
     591    catch (IOException exc) { 
     592      if (debug) exc.printStackTrace(); 
     593    } 
     594    catch (NullPointerException exc) { 
     595      if (debug) exc.printStackTrace(); 
     596    } 
    591597    return false; 
    592598  } 
     
    960966    Arrays.fill(orderCertain, true); 
    961967 
    962     try { 
    963       int oldSeries = getSeries(currentId); 
    964       for (int i=0; i<sizeC.length; i++) { 
    965         setSeries(currentId, i); 
    966         if (isRGB(currentId)) sizeC[i] = 3; 
    967         else sizeC[i] = 1; 
    968       } 
    969       setSeries(currentId, oldSeries); 
    970     } 
    971     catch (Exception e) { 
    972       // NullPointerException caught here if the file we opened was a TIFF. 
    973       // However, the sizeC field will be adjusted anyway by a later call to 
    974       // BaseTiffReader.initMetadata 
    975  
    976       // CTR TODO - eliminate catch-all exception handling 
    977       if (debug) e.printStackTrace(); 
     968    // sizeC is null here if the file we opened was a TIFF. 
     969    // However, the sizeC field will be adjusted anyway by 
     970    // a later call to BaseTiffReader.initMetadata. 
     971    if (sizeC != null) { 
     972      try { 
     973        int oldSeries = getSeries(currentId); 
     974        for (int i=0; i<sizeC.length; i++) { 
     975          setSeries(currentId, i); 
     976          if (isRGB(currentId)) sizeC[i] = 3; 
     977          else sizeC[i] = 1; 
     978        } 
     979        setSeries(currentId, oldSeries); 
     980      } 
     981      catch (FormatException exc) { 
     982        exc.printStackTrace(); 
     983      } 
     984      catch (IOException exc) { 
     985        exc.printStackTrace(); 
     986      } 
    978987    } 
    979988 
     
    10491058          description, new Integer(i)); 
    10501059      } 
    1051       catch (NullPointerException n) { } 
     1060      catch (NullPointerException n) { 
     1061        if (debug) n.printStackTrace(); 
     1062      } 
    10521063    } 
    10531064  } 
Note: See TracChangeset for help on using the changeset viewer.