Changeset 4253


Ignore:
Timestamp:
07/24/08 11:45:10 (12 years ago)
Author:
melissa
Message:

Throw a more informative exception when vector data is encountered.

File:
1 edited

Legend:

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

    r4205 r4253  
    111111    } 
    112112 
     113    if (start == 0) { 
     114      throw new FormatException("Vector data not supported."); 
     115    } 
     116 
    113117    in.seek(0); 
    114118    for (int line=0; line<=start; line++) { 
     
    220224    line = in.readLine().trim(); 
    221225 
    222     while (line != null) { 
     226    while (line != null && !line.equals("%%EOF")) { 
    223227      if (line.endsWith(image)) { 
    224228        if (!line.startsWith(image)) { 
     
    243247          line = line.substring(14); 
    244248          StringTokenizer t = new StringTokenizer(line, " "); 
    245           int originX = Integer.parseInt(t.nextToken()); 
    246           int originY = Integer.parseInt(t.nextToken()); 
    247           core.sizeX[0] = Integer.parseInt(t.nextToken()) - originX; 
    248           core.sizeY[0] = Integer.parseInt(t.nextToken()) - originY; 
     249          int originX = Integer.parseInt(t.nextToken().trim()); 
     250          int originY = Integer.parseInt(t.nextToken().trim()); 
     251          core.sizeX[0] = Integer.parseInt(t.nextToken().trim()) - originX; 
     252          core.sizeY[0] = Integer.parseInt(t.nextToken().trim()) - originY; 
    249253 
    250254          addMeta("X-coordinate of origin", new Integer(originX)); 
     
    280284      } 
    281285      lineNum++; 
    282       line = in.readLine(); 
     286      line = in.readLine().trim(); 
    283287    } 
    284288 
Note: See TracChangeset for help on using the changeset viewer.