c/c++语言开发共享使用Cimg库读取jpeg图像时出现堆栈溢出错误

当我尝试使用Cimg库读取jpg文件而其他格式bmp正在工作文件时,我收到堆栈溢出错误。

我该如何解决?

  #include"CImg.h" #include using namespace cimg_library; int main() { CImg src("d:\sidimg.jpg"); int width = src.width(); int height = src.height(); unsigned char* ptr = src.data(0,0); int count=0; while(count!= width*height) { printf("%d",*ptr); ptr++; count++; } } 

    对于迟到的答案很抱歉,但是您必须将ImageMagick包中的convert.exe放在与执行程序相同的目录中才能读/写jpeg图像。

      以上就是c/c++开发分享使用Cimg库读取jpeg图像时出现堆栈溢出错误相关内容,想了解更多C/C++开发(异常处理)及C/C++游戏开发关注计算机技术网(www.ctvol.com)!)。

      本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

      ctvol管理联系方式QQ:251552304

      本文章地址:https://www.ctvol.com/c-cdevelopment/549816.html

      (0)
      上一篇 2021年1月14日
      下一篇 2021年1月14日

      精彩推荐