/[navidoc]/navidoc/org/nongnu/navidoc/util/ImageSize.java
ViewVC logotype

Diff of /navidoc/org/nongnu/navidoc/util/ImageSize.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by tjl, Sun Apr 20 08:17:45 2003 UTC revision 1.2 by tjl, Sun Apr 20 08:48:17 2003 UTC
# Line 48  public class ImageSize { Line 48  public class ImageSize {
48                 ub(b[2]) * 256 +                 ub(b[2]) * 256 +
49                 ub(b[3]);                 ub(b[3]);
50      }      }
51    
52      /** Read the size of an image file.      /** Read the size of an image file.
53       */       */
54      static public Dimension readSize(File f) {      static public Dimension readSize(File f) {
55          try {          try {
56              FileInputStream is = new FileInputStream(f);              FileInputStream is = new FileInputStream(f);
57                return readSize(is);
58            } catch(IOException e) {
59                return null;
60            }
61        }
62    
63        /** Read the size of an image given an inputstream.
64         */
65        static public Dimension readSize(InputStream is) {
66            try {
67              byte[] in = new byte[4];              byte[] in = new byte[4];
68              is.read(in);              is.read(in);
69              if(ub(in[0]) == 0x89 &&              if(ub(in[0]) == 0x89 &&

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26