Changeset 2179


Ignore:
Timestamp:
01/29/07 15:44:26 (13 years ago)
Author:
curtis
Message:

Only check for a JPEG-2000 reader once.

File:
1 edited

Legend:

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

    r2178 r2179  
    5252 
    5353  private static ReflectedUniverse createReflectedUniverse() { 
    54     System.setProperty("com.sun.media.imageio.disableCodecLib", "true"); 
    5554    r = null; 
    5655    try { 
     
    5958      r.exec("import jj2000.j2k.io.BEBufferedRandomAccessFile"); 
    6059      r.exec("import jj2000.j2k.util.ISRandomAccessIO"); 
     60 
     61      // make sure that a JPEG-2000 reader is available 
     62      String[] fnames = ImageIO.getReaderFormatNames(); 
     63      boolean foundReader = false; 
     64      for (int i=0; i<fnames.length; i++) { 
     65        if (fnames[i].equals("JPEG 2000")) { 
     66          foundReader = true; 
     67          break; 
     68        } 
     69      } 
     70      if (!foundReader) { 
     71        if (debug) System.err.println("No JPEG-2000 reader found."); 
     72        noJAI = true; 
     73      } 
    6174    } 
    6275    catch (Throwable exc) { 
     
    209222    super.initFile(id); 
    210223 
    211     // make sure that a JPEG 2000 reader is available 
    212     String[] fnames = ImageIO.getReaderFormatNames(); 
    213     boolean foundReader = false; 
    214     for (int i=0; i<fnames.length; i++) { 
    215       if (fnames[i].equals("JPEG 2000")) { 
    216         foundReader = true; 
    217         break; 
    218       } 
    219     } 
    220     //if (!foundReader) throw new FormatException(NO_JAI_MSG); 
    221  
    222224    in = new RandomAccessStream(id); 
    223225 
Note: See TracChangeset for help on using the changeset viewer.