java 用于 64 位 Windows 的 JAI 和 ImageIO

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5207145/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 09:57:57  来源:igfitidea点击:

JAI and ImageIO for 64 bit Windows

javajavax.imageiojai

提问by Furkan

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.

我在 JAI 和 ImageIO 库中搜索了 64 位窗口,但没有找到任何版本。6-7 年前 Java 错误跟踪系统上的最后 64 位 win 版本请求。

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

我认为,jai 的开发人员不会发布任何适用于 win64 的版本。:(

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

我的问题是,我们可以从 64 位 Windows 的源代码构建 jai 和 imageio,这可能吗?如何?

thanks a lot...

多谢...

回答by David Oliván Ubieto

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).

JAI 和 JAI Image I/O 从源语言的角度来看有两个部分,java 和 C/C++。java部分是免费的(作为免费啤酒),您可以从java.net下载和编译,但这是java源代码,无论架构(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.

C/C++ 源代码不是由 SUN 发布的,因此您只能获得 Win32 和其他平台的编译后的 .dll。本源代码未发布的原因有多种,一是SUN使用第三方源代码并有权使用,不得(自由)重新分发。

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.

三年前,我们就 JAI Image I/O JPEG 12 位编解码器中存在的几个错误与 SUN 联系,他们提供了一些选项。如果这些bug对我们来说是紧急的,我们可以提供C/C++程序员来解决它们,如果我们签署了NDA(保密协议),SUN会为我们提供codecLib的源代码。另一种选择是等待SUN解决问题。我们为分配给错误的 SUN 工程师提供帮助,他在不到一周的时间内解决了问题。

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).

现在情况似乎不同了,因为 JAI 和相关项目(Image I/O)似乎不再活跃,即没有人在处理它们(新版本,错误修复)。

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

所以如果你需要新版本,你最终会在 JAI 上遇到很多问题。

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

您可以使用 32 位 JRE 在 64 位操作系统(如 Windows 7 x64)中执行使用 JAI 的程序。

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.

不幸的是,您不能在 64 位 JRE 中使用 JAI 或 Image I/O,因为您只能使用纯 Java 中可用的功能,并且在 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.

另一个问题是您真正需要 JAI 提供什么。JAI 可以使用 100% 纯 Java 实现(软件版本),速度较慢但解决了 x64 的问题。JAI Image I/O 也有一些功能可以由 100% 纯 Java 实现,但其中大多数,如编解码器,需要像 codedLib 这样的本机 dll。

回答by Sygsky

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.

试图在 Windows 7 上使用其本机 MediaLib Windows DLL 来检查 32 位 Java 的生产力。它表明单独使用 64 位纯 Java 代码会稍微慢一些 (5-10%)。

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.

我对相当大的 1 位黑白图像(大小为 9000 x 2500 像素)使用中值滤波测试了 JAI。使用中值滤波器 7 x 7,处理 32 位本机 Windows 库 (DLL) 需要 17 秒,处理没有 DLL 的纯 64 位 Java 需要 15 秒。测试重复 3-4 次,计时结果非常相似。

Debug output for 32-bit Java + native MediaLib:

32 位 Java + 本机 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:

64 位纯 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

回答by Conny Krey?el

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

抱歉,但在 jai/imageio 代码库中,它不存在任何适用于 win64 的代码。

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

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

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.

但它确实存在于 jai/imageio 错误跟踪系统中的问题。

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

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

Sorry for that.

对不起。