Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
27d9e30c
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
27d9e30c
编写于
3月 17, 2017
作者:
P
prr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8169209: Improved image post-processing steps
Reviewed-by: serb, vadim, mschoene
上级
c05a9733
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
7 deletion
+37
-7
src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java
...classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java
+15
-2
src/share/native/sun/awt/image/jpeg/imageioJPEG.c
src/share/native/sun/awt/image/jpeg/imageioJPEG.c
+22
-5
未找到文件。
src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java
浏览文件 @
27d9e30c
...
...
@@ -392,6 +392,17 @@ public class JPEGImageReader extends ImageReader {
}
}
private
void
skipPastImage
(
int
imageIndex
)
{
cbLock
.
lock
();
try
{
gotoImage
(
imageIndex
);
skipImage
();
}
catch
(
IOException
|
IndexOutOfBoundsException
e
)
{
}
finally
{
cbLock
.
unlock
();
}
}
private
int
getNumImagesOnThread
(
boolean
allowSearch
)
throws
IOException
{
if
(
numImages
!=
0
)
{
...
...
@@ -1233,7 +1244,8 @@ public class JPEGImageReader extends ImageReader {
// Note that getData disables acceleration on buffer, but it is
// just a 1-line intermediate data transfer buffer that will not
// affect the acceleration of the resulting image.
aborted
=
readImage
(
structPointer
,
aborted
=
readImage
(
imageIndex
,
structPointer
,
buffer
.
getData
(),
numRasterBands
,
srcBands
,
...
...
@@ -1395,7 +1407,8 @@ public class JPEGImageReader extends ImageReader {
/**
* Returns <code>true</code> if the read was aborted.
*/
private
native
boolean
readImage
(
long
structPointer
,
private
native
boolean
readImage
(
int
imageIndex
,
long
structPointer
,
byte
[]
buffer
,
int
numRasterBands
,
int
[]
srcBands
,
...
...
src/share/native/sun/awt/image/jpeg/imageioJPEG.c
浏览文件 @
27d9e30c
...
...
@@ -72,6 +72,7 @@ static jmethodID JPEGImageReader_acceptPixelsID;
static
jmethodID
JPEGImageReader_pushBackID
;
static
jmethodID
JPEGImageReader_passStartedID
;
static
jmethodID
JPEGImageReader_passCompleteID
;
static
jmethodID
JPEGImageReader_skipPastImageID
;
static
jmethodID
JPEGImageWriter_writeOutputDataID
;
static
jmethodID
JPEGImageWriter_warningOccurredID
;
static
jmethodID
JPEGImageWriter_warningWithMessageID
;
...
...
@@ -1472,6 +1473,10 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initReaderIDs
cls
,
"pushBack"
,
"(I)V"
));
CHECK_NULL
(
JPEGImageReader_skipPastImageID
=
(
*
env
)
->
GetMethodID
(
env
,
cls
,
"skipPastImage"
,
"(I)V"
));
CHECK_NULL
(
JPEGQTable_tableID
=
(
*
env
)
->
GetFieldID
(
env
,
qTableClass
,
"qTable"
,
...
...
@@ -1853,6 +1858,7 @@ JNIEXPORT jboolean JNICALL
Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
(
JNIEnv
*
env
,
jobject
this
,
jint
imageIndex
,
jlong
ptr
,
jbyteArray
buffer
,
jint
numBands
,
...
...
@@ -2182,12 +2188,23 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
* We are done, but we might not have read all the lines, or all
* the passes, so use jpeg_abort instead of jpeg_finish_decompress.
*/
if
(
cinfo
->
output_scanline
==
cinfo
->
output_height
)
{
// if ((cinfo->output_scanline == cinfo->output_height) &&
//(jpeg_input_complete(cinfo))) { // We read the whole file
jpeg_finish_decompress
(
cinfo
);
}
else
{
if
((
cinfo
->
output_scanline
!=
cinfo
->
output_height
)
||
data
->
abortFlag
==
JNI_TRUE
)
{
jpeg_abort_decompress
(
cinfo
);
}
else
if
((
!
jpeg_input_complete
(
cinfo
))
&&
(
progressive
&&
(
cinfo
->
input_scan_number
>
maxProgressivePass
)))
{
/* We haven't reached EOI, but we need to skip to there */
(
*
cinfo
->
src
->
term_source
)
(
cinfo
);
/* We can use jpeg_abort to release memory and reset global_state */
jpeg_abort
((
j_common_ptr
)
cinfo
);
(
*
env
)
->
CallVoidMethod
(
env
,
this
,
JPEGImageReader_skipPastImageID
,
imageIndex
);
}
else
{
jpeg_finish_decompress
(
cinfo
);
}
free
(
scanLinePtr
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录