Skip to main content

[JAI] Where is com.sun.media.jai.codecimpl ?

4 replies [Last post]
Anonymous

Hi,

I'm brand new to JAI and spent yesterday evening trying to get a first test app running, based on Brian Burkhalter's SimpleJAITest (1).

Therefore, I installed the latest JAI-release jai-1_1_3 (took the generic package "Java (no native acceleration)"). I'm working on Linux Fedora.

Some of the calls in SimpleJAITest were deprecated, as javac told me, so I started a rewrite into JAITest, mainly replacing the ScrollingImagePanel by JAIDisplay and the set method on ParameterBlockJAI by setParameter.

After this operation, the class is generated without errors. To compile, I give the commandline:

javac -cp jai-1_1_3/lib/jai_core.jar:jai-1_1_3/lib/jai_codec.jar:. JAITest.java

When running the program like this:

java -cp jai-1_1_3/lib/jai_core.jar:jai-1_1_3/lib/jai_codec.jar:. JAITest test.tif test2.tif

this error is generated:
Error: One factory fails for the operation "tiff"
Occurs in: javax.media.jai.ThreadSafeOperationRegistry
java.lang.reflect.InvocationTargetException
Caused by: java.lang.NoClassDefFoundError: while resolving class: com.sun.media.jai.codecimpl.TIFFImage

Obviously, my problem is one of CLASSPATH settings, right? Please don't shoot me now! Am I just missing or misreferencing the package containing com.sun.media.jai.codecimpl? But where should it be?

I also tried other file formats and testfiles, but without success.

Now, I have some more general questions to this:

A) what is the relationship between jai (1.1.3) and jai_imageio (1.1) ?? does the former require the latter? Is the latter an extension (if so, adding what?)?... I read very confusing things about packages not being officially part of jai, being shifted to other projects etc...

My basic question: what do I have to install in order to read, process and write 16 bit TIFF-images into 8-bit JPEG-images?

B) I tried to install jai_imageio-1_1, but at first sight this didn't change anything... basically, because I didn't trust it to be the right solution: looking at the javadoc of both jai and jai_imageio, I can't find any reference to the package com.sun.media.jai.codecimpl !!

My basic question: if java tells me that com.sun.media.jai.codecimpl.TIFFImage is missing, how can I find out *which* package I should install?

C) and yet another question, assuming jai_imageio-1_1 is required: I notice that it only comes in platform-specific distributions... why is that? Is it not 100% java?

By the way: looking at all the information did not solve my questions, but it did raise my appetite to get this thing running! So please, if someone could prevent me from frustration!?

Groeten,

Vic

(1) http://archives.java.sun.com/cgi-bin/wa?A2=ind9910&L=jai-interest&P=R5520

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

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Brian Burkhalter

On Fri, 27 Oct 2006, vic.mortelmans@telenet.be wrote:

> I'm brand new to JAI and spent yesterday evening trying to get a first test app running, based on Brian Burkhalter's SimpleJAITest (1).
>
> Therefore, I installed the latest JAI-release jai-1_1_3 (took the generic package "Java (no native acceleration)"). I'm working on Linux Fedora.
>
> Some of the calls in SimpleJAITest were deprecated, as javac told me, so I started a rewrite into JAITest, mainly replacing the ScrollingImagePanel by JAIDisplay and the set method on ParameterBlockJAI by setParameter.
>
> After this operation, the class is generated without errors. To compile, I give the commandline:
>
> javac -cp jai-1_1_3/lib/jai_core.jar:jai-1_1_3/lib/jai_codec.jar:. JAITest.java
>
> When running the program like this:
>
> java -cp jai-1_1_3/lib/jai_core.jar:jai-1_1_3/lib/jai_codec.jar:. JAITest test.tif test2.tif
>
> this error is generated:
> Error: One factory fails for the operation "tiff"
> Occurs in: javax.media.jai.ThreadSafeOperationRegistry
> java.lang.reflect.InvocationTargetException
> Caused by: java.lang.NoClassDefFoundError: while resolving class: com.sun.media.jai.codecimpl.TIFFImage
>
> Obviously, my problem is one of CLASSPATH settings, right? Please don't shoot me now! Am I just missing or misreferencing the package containing com.sun.media.jai.codecimpl? But where should it be?
>
> I also tried other file formats and testfiles, but without success.

Sounds like an installation problem of some kind. Please review

http://download.java.net/media/jai/builds/release/1_1_3/INSTALL.html

> Now, I have some more general questions to this:
>
> A) what is the relationship between jai (1.1.3) and jai_imageio (1.1) ?? does the former require the latter? Is the latter an extension (if so, adding what?)?... I read very confusing things about packages not being officially part of jai, being shifted to other projects etc...

JAI and JAI Image I/O Tools are separate entities. The latter provides Image
I/O (javax.imageio) support for some formats not handled by the Java SE Image
I/O plugins. It also adds two operations ImageRead and ImageWrite which use
Java Image I/O to read and write images, respectively. JAI Image I/O Tools
does *not* require JAI unless one uses ImageRead or ImageWrite.

JAI Image I/O Tools is the migration path forward for the codecs supplied with
JAI in the com.sun.media.jai.codec[impl] packages. The operations ImageRead
and ImageWrite were not added to JAI itself because JAI to date has only
required J2SE 1.3 and javax.imageio was added only in J2SE 1.4. I expect that
in the next release of JAI these operations will be added and in the next
release of JAI Image I/O Tools they will be deprecated.

> My basic question: what do I have to install in order to read, process and write 16 bit TIFF-images into 8-bit JPEG-images?

You should be able to use JAI alone but we recommend you use JAI Image I/O
Tools for image I/O if possible. It might be all you need if you are not doing
any other processing.

> B) I tried to install jai_imageio-1_1, but at first sight this didn't change anything... basically, because I didn't trust it to be the right solution: looking at the javadoc of both jai and jai_imageio, I can't find any reference to the package com.sun.media.jai.codecimpl !!

The Stream, FileLoad, URL, Encode, and FileStore operations in JAI use
com.sun.media.codec[impl]. The ImageRead and ImageWrite operations above use
javax.imageio.

> My basic question: if java tells me that com.sun.media.jai.codecimpl.TIFFImage is missing, how can I find out *which* package I should install?

That would be JAI and as mentioned by Mike that would be in jai_codec.jar.

> C) and yet another question, assuming jai_imageio-1_1 is required: I notice that it only comes in platform-specific distributions... why is that? Is it not 100% java?

Both JAI and JAI Image I/O come in platform specific distributions. JAI 1.1.3
also has a generic distribution.

In JAI the native libraries are used for acceleration. They are not absolutely
required technically however as all operations have fully functional Java
implementations.

In JAI Image I/O the native libraries provide the implementations of the JPEG
and PNG plugins, an alternate implementation the JPEG2000 plugins (there are
also Java plugins for JPEG2000), and acceleration for the TIFF bilevel
encodings (which also have Java implementations). If you do not use the native
libraries of JAI Image I/O you will in effect lose support for lossless JPEG
and JPEG-LS and acceleration for JPEG, PNG, JPEG2000, and TIFF bilevel
encodings.

> By the way: looking at all the information did not solve my questions, but it did raise my appetite to get this thing running! So please, if someone could prevent me from frustration!?

A la prochaine,

Brian

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Vic Mortelmans

Hi Brian and Mike,

thanks for the feedback! I finally got things going. My problem was that
I had no SUN jdk installed, but the GNU-java that comes with Fedora...
I also switched to the platform-specific jai-package. This means that
I'm not sure which change actually solved the problem... Anyway, JAITest
is running.

Now let's start programming!

Groeten,

Vic

Brian Burkhalter wrote:
> On Fri, 27 Oct 2006, vic.mortelmans@telenet.be wrote:
>
>> I'm brand new to JAI and spent yesterday evening trying to get a first
>> test app running, based on Brian Burkhalter's SimpleJAITest (1).
>>

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

Brian Burkhalter

Thanks for posting this message thereby closing the topic discussion!

Brian

On Sun, 29 Oct 2006, Vic Mortelmans wrote:

> Hi Brian and Mike,
>
> thanks for the feedback! I finally got things going. My problem was that I
> had no SUN jdk installed, but the GNU-java that comes with Fedora... I also
> switched to the platform-specific jai-package. This means that I'm not sure
> which change actually solved the problem... Anyway, JAITest is running.
>
> Now let's start programming!
>
> Groeten,
>
> Vic
>
> Brian Burkhalter wrote:
>> On Fri, 27 Oct 2006, vic.mortelmans@telenet.be wrote:
>>
>>> I'm brand new to JAI and spent yesterday evening trying to get a first
>>> test app running, based on Brian Burkhalter's SimpleJAITest (1).
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Nidel, Mike

make sure you have jai_codec.jar on your classpath, that should
help you get the TIFF codec.

this jar contains the com.sun.media.jai.codecimpl code.
you can also get TIFF image support from JAI ImageIO tools,
but I'm guessing that the SimpleJAITest doesn't use ImageIO.

> -----Original Message-----
> From: vic.mortelmans@telenet.be [mailto:vic.mortelmans@telenet.be]
> Sent: Friday, October 27, 2006 7:04 AM
> To: interest@jai.dev.java.net
> Cc: vic.mortelmans@telenet.be
> Subject: [JAI] Where is com.sun.media.jai.codecimpl ?
>
>
> Hi,
>
> I'm brand new to JAI and spent yesterday evening trying to
> get a first test app running, based on Brian Burkhalter's
> SimpleJAITest (1).
>
> Therefore, I installed the latest JAI-release jai-1_1_3 (took
> the generic package "Java (no native acceleration)"). I'm
> working on Linux Fedora.
>
> Some of the calls in SimpleJAITest were deprecated, as javac
> told me, so I started a rewrite into JAITest, mainly
> replacing the ScrollingImagePanel by JAIDisplay and the set
> method on ParameterBlockJAI by setParameter.
>
> After this operation, the class is generated without errors.
> To compile, I give the commandline:
>
> javac -cp
> jai-1_1_3/lib/jai_core.jar:jai-1_1_3/lib/jai_codec.jar:. JAITest.java
>
> When running the program like this:
>
> java -cp
> jai-1_1_3/lib/jai_core.jar:jai-1_1_3/lib/jai_codec.jar:.
> JAITest test.tif test2.tif
>
> this error is generated:
> Error: One factory fails for the operation "tiff"
> Occurs in: javax.media.jai.ThreadSafeOperationRegistry
> java.lang.reflect.InvocationTargetException
> Caused by: java.lang.NoClassDefFoundError: while resolving
> class: com.sun.media.jai.codecimpl.TIFFImage
>
> Obviously, my problem is one of CLASSPATH settings, right?
> Please don't shoot me now! Am I just missing or
> misreferencing the package containing
> com.sun.media.jai.codecimpl? But where should it be?
>
> I also tried other file formats and testfiles, but without success.
>
>
> Now, I have some more general questions to this:
>
> A) what is the relationship between jai (1.1.3) and
> jai_imageio (1.1) ?? does the former require the latter? Is
> the latter an extension (if so, adding what?)?... I read very
> confusing things about packages not being officially part of
> jai, being shifted to other projects etc...
>
> My basic question: what do I have to install in order to
> read, process and write 16 bit TIFF-images into 8-bit JPEG-images?
>
>
> B) I tried to install jai_imageio-1_1, but at first sight
> this didn't change anything... basically, because I didn't
> trust it to be the right solution: looking at the javadoc of
> both jai and jai_imageio, I can't find any reference to the
> package com.sun.media.jai.codecimpl !!
>
> My basic question: if java tells me that
> com.sun.media.jai.codecimpl.TIFFImage is missing, how can I
> find out *which* package I should install?
>
>
> C) and yet another question, assuming jai_imageio-1_1 is
> required: I notice that it only comes in platform-specific
> distributions... why is that? Is it not 100% java?
>
>
> By the way: looking at all the information did not solve my
> questions, but it did raise my appetite to get this thing
> running! So please, if someone could prevent me from frustration!?
>
> Groeten,
>
> Vic
>
>
> (1)
> http://archives.java.sun.com/cgi-bin/wa?A2=ind9910&L=jai-inter
est&P=R5520

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

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