Comments (5)
Hi again,
Still sorry about the state of the documentation. :-/
You should be able to use it just like normal ImageIO. No changes required. You do however need all of the dependencies of the imageio-jpeg plugin in classpath as well.
You probably need all these (update: fixed some typos):
twelvemonkeys-common-lang-3.0-SNAPSHOT.jar
twelvemonkeys-common-io-3.0-SNAPSHOT.jar
twelvemonkeys-common-image-3.0-SNAPSHOT.jar
twelvemonkeys-imageio-core-3.0-SNAPSHOT.jar
twelvemonkeys-imageio-metadata-3.0-SNAPSHOT.jar
twelvemonkeys-imageio-jpeg-3.0-SNAPSHOT.jar
Hope that helps.
If not, let me know how/in what way it does not work, and I'll look into it.
Regards,
Harald K
from twelvemonkeys.
Hello Harald,
that helped me thanks, but I'm still not sure how to call the read() method, what do I need to import and where do I get my object, or is there a static method somewhere that I overlooked?
Maybe a very simple example would help me.
Thanks
from twelvemonkeys.
When you have everything set up on class path, it really is as simple as:
BufferedImage image = ImageIO.read(jpegFile);
No special imports, no special method. The reason this works, is that ImageIO is plugin-based, and the plugin is automatically registered using SPI (service provider interface). If you want to learn more about how this works, I suggest you read http://docs.oracle.com/javase/7/docs/api/javax/imageio/spi/IIORegistry.html and http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#Service_Provider :-)
The only exception (of course there's one) I know of, is if you add the plugins to the class path after ImageIO has been initialized (like in a web app), then you might have to add the line:
ImageIO.scanForPlugins();
Make sure you do this only once. If you are indeed doing this from a web app, you should also read http://stackoverflow.com/a/17365294/1428606 to avoid adding a memory leak to your application.
Ok, long answer, but I think that covers most of it. :-)
Best regards,
Harald K
from twelvemonkeys.
Woho it works now!
thanks, yeah I always made the mistake and didn't import the ImageIO.
Thanks as well for the background info that looks really interesting.
from twelvemonkeys.
Cool. Happy coding! :-)
from twelvemonkeys.
Related Issues (20)
- Troubleshooting with ImageIO plugin registry issue (NoClassDefFoundErrors) without web.xml file HOT 1
- YCCK JPEG from a PDF with wrong colors HOT 5
- TIFF: Support SAMPLEFORMAT_COMPLEXINT (5) HOT 3
- WebP plugin stops working when other plugins are enabled too HOT 2
- PSD: Get layer kind (type) to metadata HOT 1
- Twelvemonkeys Servlet should support Jakarta HOT 6
- JPEGImageReader read invalid image without throwing exception HOT 4
- PSD: When make PNG from PSD using TwelveMonkeys, it's different from Photoshop. HOT 4
- Change Maven GPG plugin to use Bouncy Castle signer
- Unsupported BitsPerSample for SampleFormat 3/Floating Point (expected 16/32): 64 HOT 4
- PSD: BufferOverflowException if encoder adds garbage to the end of rows
- Dynamic images in WebP format, and even ordinary GIF images, cannot read delays after using this plugin. HOT 2
- Warning system custom messages HOT 3
- Unable to read dynamic webp using javax.imageio.ImageIO#read(java.io.InputStream) on aws lambda HOT 1
- TIFF: ArrayIndexOutOfBoundsException in HorizontalDeDifferencingFloatingPointStream.decodeDeltaBytes HOT 3
- JPEG 2000 format support HOT 1
- TIFF: Decoding chunky gray + extra samples is broken HOT 1
- heic-image HOT 1
- WebP: "Coordinate out of bounds!" exception thrown when reading certain files HOT 2
- Please make BufferedChannelImageInputStream public HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twelvemonkeys.