请问如何使用libtiff读取使用jpeg压缩过的tiff文件?

ztedxj 2004-08-29 08:38:08
会出现如下提示
old-style jpeg compression support is not configured.
...全文
394 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
ztedxj 2004-08-31
  • 打赏
  • 举报
回复
问题找到了,解码后的文件R B顺序反了
奇怪的是其他编码方式都没有问题,只有OJPEG有问题
ztedxj 2004-08-31
  • 打赏
  • 举报
回复
谢谢,但是现在还有一点问题:
我把tiff库用在我的项目中,发现压缩出来的图像有点问题
在使用jpeg压缩方法以及其他编码方式压缩的tiff文件,我解开后是正常的
但是使用ojpeg压缩方法压缩的tiff文件,我解开后图像颜色不对,这边不能贴图
要不你给我个联系方式,我想请您帮忙看看解开的图像。
wuyapu 2004-08-31
  • 打赏
  • 举报
回复
当你在tiffconf.h中定义 JPEG_SURPPORT或OJPEG_SUPPORT后就需要IJG的libjpeg库,就是你说的"把jpeglib.lib库加入编译tifflib工程"

因为修改了libjpeg库所以需要重新编译libjpeg库

你在libtiff的目录下可以看到上面的说明 contrib\ojpeg\目录下

如果只定义JPEG_SUPPORT就不需要看上面的帮助
ztedxj 2004-08-30
  • 打赏
  • 举报
回复
首先表示我的谢意,但是还是有些不明白的地方,望指点:


o Ensure you are able to build with JPEG support (see config.site).
----------------------------------?上面这句话什么意思?重新编译jpeglib?还是要把jpeglib.lib库加入编译tifflib工程?

o #define OJPEG_SUPPORT somewhere. This can be put in tiffconf.h for
instance.

o Append the jdhuff_add.c code to the end of jdhuff.c within the IJG JPEG
---------这个就是下面附的jpeg_reset_huff_decode 代码?
libraries jdhuff.c file and recompile libjpeg (jpeg-6b tested).

o Rebuild cleanly.


再次表示感谢!
wuyapu 2004-08-30
  • 打赏
  • 举报
回复
在配置文件tiffconf.h中加入,OJPEG_SUPPORT JPEG_SUPPORT

For the broadest possible support for OJPEG files the following steps are
necessary:

o Ensure you are able to build with JPEG support (see config.site).

o #define OJPEG_SUPPORT somewhere. This can be put in tiffconf.h for
instance.

o Append the jdhuff_add.c code to the end of jdhuff.c within the IJG JPEG
libraries jdhuff.c file and recompile libjpeg (jpeg-6b tested).

o Rebuild cleanly.



GLOBAL(void)
jpeg_reset_huff_decode (register j_decompress_ptr cinfo,register float *refbw)
{ register huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
register int ci = 0;

/* Re-initialize DC predictions */
do entropy->saved.last_dc_val[ci] = -refbw[ci << 1];
while (++ci < cinfo->comps_in_scan);
/* Discard encoded input bits, up to the next Byte boundary */
entropy->bitstate.bits_left &= ~7;
}

4,446

社区成员

发帖
与我相关
我的任务
社区描述
图形图像/机器视觉
社区管理员
  • 机器视觉
  • 迪菲赫尔曼
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧