Problems encountered by tesseract-OCR during Web use

Source: Internet
Author: User

There are many examples on the Internet, and errors are reported during Web operations.

 
Java. util. nosuchelementexception at javax. ImageIO. SPI. filteriterator. Next (unknown source)

Environment:

JDK: jdk_1.6.0_30 used for compiling and running JDK: jdk_1.7.0_11

Web Container: tomcat-6.0.32

After a breakpoint test, it was found that (imageformat is not in the Image Format)

 
Iterator <imagereader> readers =ImageIO. getimagereadersbyformatname (imageformat );

In the iterator, readers shows that next is empty (or zerolist is empty in ITER ). I thought that some classes are not loaded and started to experiment with class. forname ("XX") separately. Later, you can manually register before the iterator.

Iioregistry registry =Iioregistry. getdefaultinstance (); Registry. registerserviceprovider (NewCom. Sun. Media. imageioimpl. plugins. Tiff. Fig (); Registry. registerserviceprovider (NewCom. Sun. Media. imageioimpl. plugins. Tiff. Unzip imagereaderspi ());

And then run it.

Reference: http://bbs.csdn.net/topics/370193992

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.