Using Jrawio under Tomcat

Source: Internet
Author: User

What is Jrawio. is a pure Java written, used to read the digital camera RAW format file library, support the majority of digital camera manufacturer's format, such as Nikon's NEF and canon of the CR2 format, the specific download and use can refer to the official homepage: http://jrawio.rawdarkroom.org/

The previous jrawio was used as an independent API, and now it's a plug-in, perfect combination with JDK's ImageIO library. As long as you import the Jrawio package into your classpath, you can read raw directly through the Imageio.read ("D:/xx.raw"), and through Imageio.write ("The new file" d:/ Xx.jpg ")) is convenient for converting it to the JPEG format.

Recently using Jrawio in a Java EE project, the project uses Tomcat as the server. The Jrawio jar package has been imported into the project's Lib directory, but the call to Imageio.read returns null and an empty iterator is returned via Imageio.getimagereadersbyformatname ("Nef"). This indicates that the system could not find a jrawio decoder. The magic is that directly write a main function to read RAW files can run normally, so the basic certainty is due to some kind of Java EE operation mechanism caused ImageIO unable to find the appropriate decoder.

View JDK documentation, found that ImageIO has a method: Scanforplugins, can be in the classloader.getresources return path in the scanning plug-in, in the dead horse when the principle of the live horse medical test, incredibly can load into the jrawio. Of course, this process is more resource-intensive and needs to be done once, so it's best to put it in the initialization code for the project.

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.