JAI and ImageIO for 64 bit Windows
Asked Answered
D

3

20

i searched JAI and ImageIO library for 64 bit windows, but i didn't find any version of these. Last 64 bit win vesion request on Java Bug tracking system 6-7 years ago.

I think, jai's developers will not release any version for win64. :(

My question is, can we build jai and imageio from their source for 64bit windows, is it possible? How?

thanks a lot...

Dispersoid answered 5/3, 2011 at 22:14 Comment(1)
After many years, I am using opencv and its native libs for reading/writing needed codecs.Dispersoid
B
29

JAI and JAI Image I/O have two parts from source language points of view, java and C/C++. The java part is free (as free beer) and you can download and compile from java.net, but this is java source, no matter architecture (x86, x64).

The C/C++ source code is not released by SUN so you only get the compiled .dll for Win32 and others platforms. This source code is not released due to several reasons, one is SUN uses source from third parties and have the right to use it, not to (freely) redistribute it.

We contact SUN three years ago for several bugs present in JAI Image I/O JPEG 12bit codec and they give some options. If these bugs are urgent for us, we can provide C/C++ programmers for solving them, by SUN providing us the source code of codecLib if we sign a NDA (Non Disclosure Agreement). The other option was wait for SUN to solve the problems. We provide assistance to the SUN engineer assigned to the bugs and he solved in less than a week.

Now the situation seems to be different, as JAI and related projects (Image I/O) seems to be no longer active, i.e. nobody is working on them (new releases, bug fixes).

So you eventually will have lot of problems with JAI if you require new versions.

You can use the 32bit JRE to execute programs that use JAI in 64bit OS like Windows 7 x64.

Unfortunately you can't use JAI or Image I/O in a 64bit JRE, as you only can use the functionality available in pure Java and lost most codecs in Image I/O.

Another question is what you really need from JAI. JAI can be used using the 100% pure Java implementation (software version), slower but solves the problems of x64. JAI Image I/O also have some functionality that can be implemented by 100% pure Java but most of them, like codecs, require native dll like codedLib.

Basipetal answered 13/3, 2011 at 22:55 Comment(2)
Would you know of any other suitable opensource alternative for JAI?Booking
I'm no longer working in Java Image business, so cannot provide any supported suggestion. There are alternatives for imaging in Java, the problem arises when you need to read/write non common formats, such JPEG 12bit (my case), where Image I/O takes place. For such format there are specific packages, like DICOM for medical images. My guess is that any package with "advanced" codecs may requiere native code (DLL in Windows) so you can face problems with some platforms not supported and with server-side execution of the image processing.Ankney
U
2

Was trying to check productivity of 32-bit Java with its native MediaLib Windows DLL on Windows 7. It shows to be slightly slower (5-10 %) that 64-bit pure Java code alone.

I tested JAI with median filtering for rather big 1-bit b/w image (size of 9000 x 2500 pixels). With median filter 7 x 7 it costs 17 seconds to processs with 32-bit native Windows libs (DLLs) and 15 seconds with pure 64-bit Java without DLLs. Test was repeated 3-4 times with very similar timing results.

Debug output for 32-bit Java + native MediaLib:

Raster path is "F:\Projects\Fadeev\listv.bmp"
Median size value set to 7
Output file will be saved to input directory
Data color set to default value java.awt.Color[r=255,g=0,b=0] (RED)
Color distance set to default value 20,00
New color set to default value java.awt.Color[r=255,g=0,b=0] (RED)
Image ( 9000 x 2461 ) read in 00:00:00.038
Image color quantized at 00:00:01.400
**Image filtered by () at 00:00:17.531** (MediaLib works now and here!!!)
Image stored at 00:00:00.356 (storing in PNG!)
Total time is 00:00:19.325

Debug output for 64-bit pure Java:

Raster path is "F:\Projects\Fadeev\listv.bmp"
Median size value set to 7
Output file will be saved to input directory
Data color set to default value java.awt.Color[r=255,g=0,b=0] (RED)
Color distance set to default value 20,00
New color set to default value java.awt.Color[r=255,g=0,b=0] (RED)
Image ( 9000 x 2461 ) read in 00:00:00.038
Image color quantized at 00:00:00.910
Error: Could not load mediaLib accelerator wrapper classes. Continuing in pure Java mode.
Occurs in: com.sun.media.jai.mlib.MediaLibAccessor   com.sun.media.jai.mlib.MediaLibLoadException
**Image filtered by () at 00:00:13.802**
Image stored at 00:00:00.414
Total time is 00:00:15.164
Ultra answered 29/1, 2014 at 7:56 Comment(4)
For JAI ok. But there is no any solution for ImageIO Compress/Decompress operation. i didnt find pure java codec for JPEG compression.Dispersoid
I am having error java.lang.NoClassDefFoundError: Could not initialize class javax.media.jai.JAIMessere
#17108734 - how to set output JPG compression level.Ultra
JAI is not included in std Java libs. So you need to link it in some way.Ultra
L
0

Sorry, but in the jai/imageio code repository it does not exist any code for win64.

http://java.net/projects/jai-core/sources/svn/show/trunk/src/share/mediaLib

http://java.net/projects/jai-imageio-core/sources/svn/show/trunk/src/share/jclib4jai

But it does exist a issues in the jai/imageio bug tracking system.

http://java.net/jira/browse/JAI_IMAGEIO_CORE-62

Sorry for that.

Levity answered 11/3, 2011 at 16:4 Comment(1)
Thanks for your reply, but i want to find lib's source such as mlib_wrapper.dll, clib_jiio.dll, if i find it maybe i will compile it for x64 arch.Dispersoid

© 2022 - 2024 — McMap. All rights reserved.