显示JPG图片的时候出现了问题,请教高手~~

九个太阳2023 2008-11-17 03:22:28
我用JpegLib.lib库来实现jpg到bmp格式的转换,编译通过了,可是在运行的时候,出现了下面这种异常:
JPEG parameter struct mismatch:library thinks size is 464,caller expects 424.

我跟踪了程序是在下面一条语句出错的:
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_decompress(&cinfo);//运行到这一句就出现错误!!!!



请教高手!
...全文
462 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ilovedrv 2008-11-22
  • 打赏
  • 举报
回复
跟到程序里面去,找到弹出异常的地方,然后修改jpeg源代码
xsc2001 2008-11-21
  • 打赏
  • 举报
回复
那你还不如直接用CImage类呢,包含头文件<atlimage.h>
用Load方法加载一个jpg文件,再用Save保存成一个bmp文件即可。
如:
CImage img;
img.Load("d:\\abc.jpg");
img.Save("d:\\abc.bmp");
这样就行了,方便简单。不过得在VS2003以上才支持。
九个太阳2023 2008-11-17
  • 打赏
  • 举报
回复
没有看明白网上怎么改的~
。。。。
一条晚起的虫 2008-11-17
  • 打赏
  • 举报
回复
http://trac.imagemagick.org/browser/tiff/trunk/libtiff/tif_jpeg.c?rev=10116

/*
67 The windows RPCNDR.H file defines boolean, but defines it with the
68 unsigned char size. You should compile JPEG library using appropriate
69 definitions in jconfig.h header, but many users compile library in wrong
70 way. That causes errors of the following type:
71
72 "JPEGLib: JPEG parameter struct mismatch: library thinks size is 432,
73 caller expects 464"
74
75 For such users we wil fix the problem here. See install.doc file from
76 the JPEG library distribution for details.
77 */
laolaoliu2002 2008-11-17
  • 打赏
  • 举报
回复
http://www.vckbase.com/document/viewdoc/?id=1790
laolaoliu2002 2008-11-17
  • 打赏
  • 举报
回复
记得原来有人问过这个问题,是jpeg库的bug.

19,464

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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