Stack overflow error when reading jpeg image using Cimg library

谁说胖子不能爱 提交于 2019-12-10 11:45:16

问题


I'm getting stack overflow error when I'm trying to read jpg file using Cimg library while other format bmp is working file .

How can i resolve it?

    #include"CImg.h"
    #include<stdio.h>
    using namespace cimg_library;
    int main()
    {
            CImg<unsigned char> 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++;
                }
   }

回答1:


Sorry for the late answer, but you have to have convert.exe from the ImageMagick package in the same directory as where the program is executing in order to read/write jpeg images.



来源:https://stackoverflow.com/questions/16864709/stack-overflow-error-when-reading-jpeg-image-using-cimg-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!