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)
- ClassCastException ImageReadParam BigTIFF reading HOT 2
- jakarta.servlet support HOT 2
- Allow tiff writing to use an explicit photometric interpretation option HOT 7
- Enable a SAST Tool
- CVE-2023-5129 - Vulnerability in libwebp huffman table implementation HOT 2
- Question: compatibility with org.apache.commons:commons-imaging ? HOT 2
- Features stopped working after upgrading to JDK 17 HOT 8
- It would be nice if Twelvemonkeys had support for EXIF tag 0xa436 Title HOT 10
- Problematic inconsistence in JPEG color space detection: TwelveMonkey vs standard Java API HOT 9
- Wrong colors with CMYK JPEG HOT 1
- Webp: cannot decode grayscale images HOT 5
- NPE while read a PSD file HOT 3
- Unable to modify a JPEGImage10Metadata comment value HOT 17
- JPEG: Preserve metadata when writing CMYK HOT 5
- The OSGi support only exports the ImageReaderSpi services and not the ImageWriterSpi services HOT 1
- BMP: Write support for more ARGB types HOT 1
- Some malformed PSD images never return from `ImageIO.read()` using 3.10.0 HOT 2
- WebP: Images decoded with yellow tint HOT 1
- Possible bug in Half.shortBitsToFloat HOT 5
- Troubleshooting with ImageIO plugin registry issue (NoClassDefFoundErrors) without web.xml file 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.