Skip to main content

[JAI-IMAGEIO] Detecting registered plug-ins

2 replies [Last post]
Anonymous

This might be fairly straight forward but for some reason cannot find a
class, if it exists, that will help me. What I need to do is to detect
if a ImageIO plug-in successfully registered, just incase for the rare
occurence that something fails to register my imaging library will still
work properly. What I am currently doing now is grabbing all of the
format names

String[] formatNames = ImageIO.getReaderFormatNames();

and searching for mine. If its in there I continue if not I use a
default one. Is there an easier way to do this with the ServiceRegistry
or something along those lines?

Thanks,

Tyler

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bpb
Offline
Joined: 2004-06-23

As you are working with your own class perhaps this method

http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/spi/ServiceRegistry.html#getServiceProviderByClass(java.lang.Class)

might be of use?

> This might be fairly straight forward but for some
> reason cannot find a
> class, if it exists, that will help me. What I need
> to do is to detect
> if a ImageIO plug-in successfully registered, just
> incase for the rare
> occurence that something fails to register my imaging
> library will still
> work properly. What I am currently doing now is
> grabbing all of the
> format names
>
> String[] formatNames =
> ImageIO.getReaderFormatNames();
>
> and searching for mine. If its in there I continue
> if not I use a
> default one. Is there an easier way to do this with
> the ServiceRegistry
> or something along those lines?
>
> Thanks,
>
> Tyler
>
> ------------------------------------------------------
> ---------------
> To unsubscribe, e-mail:
> interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail:
> interest-help@jai-imageio.dev.java.net

tyler_c
Offline
Joined: 2006-09-28

Thanks for the heads up. I tried using that before but I realized what I was doing wrong. Thank you much.