我用ImageInfo处理上传的图片
但是在
ImageInfo info = new ImageInfo(newPath);
的时候就出错了,但是也捕捉不到异常,有哪位朋友碰到过这种问题啊?
希望能帮我看一下是什么原因啊!!急~!

解决方案 »

  1.   

    你看看他的源码或者api说明把,根本就没有带参数的构造函数,你这样写当然是错误的
      

  2.   

    Imageinfo这个类在哪里定义的啊?
      

  3.   

    不知道你说的是不是这个
    ImageInfo ii = new ImageInfo();
    // in can be InputStream or RandomAccessFile (or DataInput)
    ii.setInput(in);
    /* if you want to know how many images there are in a file,
       uncomment the following line; will slow down ImageInfo
       with animated GIFs */
    //ii.setDetermineImageNumber(true);// check does the actual work, you won't get results before
    // you have called it
    if (!ii.check())
    {
      System.err.println("Not a supported image file format.");
    }
    else
    {
     System.out.println(
      ii.getFormatName() + ", " + 
      ii.getMimeType() + ", " + 
      ii.getWidth() + " x " + ii.getHeight() + " pixels, " + 
      ii.getBitsPerPixel() + " bits per pixel, " + 
      ii.getNumberOfImages() + " image(s).");
      // there are other properties, check out the API documentation
    }
    http://www.jahia.org/javadoc-dev_5/org/jahia/tools/imageprocess/ImageInfo.html
    http://schmidt.devlib.org/image-info/
      

  4.   

    单步调试,trace到JDK内去,看看在哪里抛了