code: public Image setSizeFromGif(File gif)
      {
          if (gif.canRead())
          {
              FileInputStream in = null;
              try{
                  byte [] buf = new byte[10];
                  in = new FileInputStream(gif);
                  if (in.read(buf,0,10)==10)
                  {
                      if(log.isDebugEnabled())log.debug("Image "+gif.getName()+
                                 " is " +
                                 ((0x00ff&buf[7])*256+(0x00ff&buf[6])) +
                                 " x " +
                                 (((0x00ff&buf[9])*256+(0x00ff&buf[8]))));
                      width((0x00ff&buf[7])*256+(0x00ff&buf[6]));
                      height(((0x00ff&buf[9])*256+(0x00ff&buf[8])));
                  }
              }
              catch (IOException e){
                  LogSupport.ignore(log,e);
              }
              finally {
                  IO.close(in);
              }
          }
          
          return this;
      }
docs: Set the image size from the header of a GIF file.