1

i get this message when i run this output of Cimg program

#include "CImg.h"
using namespace cimg_library;

int main(int argc, char * argv[]) {

    const char * input_file = "Lenna.jpg";

    CImg<unsigned char> * input = new CImg<unsigned char>(input_file);

    CImgList<unsigned char> fft = input->get_FFT();
    CImg<unsigned char>::FFT(fft[0], fft[1], false);
    fft[0].save("fft.jpg");

    return 1;
}

I initially got a blank image. but then I installed ImageMagick. After that when I run the output I get this message:

convert: no decode delegate for this image format `JPG' @ error/constitute.c/ReadImage/572.
convert: no images defined `pnm:-' @ error/convert.c/ConvertImageCommand/3304.
convert: no decode delegate for this image format `JPG' @ error/constitute.c/ReadImage/572.
convert: no images defined `pnm:-' @ error/convert.c/ConvertImageCommand/3304.
convert: no decode delegate for this image format `JPG' @ error/constitute.c/ReadImage/572.
convert: no images defined `pnm:-' @ error/convert.c/ConvertImageCommand/3304.

[CImg] *** CImgIOException *** [instance(0,0,0,0,(nil),non-shared)] CImg<unsigned char>::load(): Failed to recognize format of file 'Lenna.jpg'.
terminate called after throwing an instance of 'cimg_library::CImgIOException'
  what():  [instance(0,0,0,0,(nil),non-shared)] CImg<unsigned char>::load(): Failed to recognize format of file 'Lenna.jpg'.
Aborted (core dumped)

Not sure what this is.

Useless
  • 64,155
  • 6
  • 88
  • 132
SVJ
  • 51
  • 5
  • This may be obvious, but is `Lenna.jpg` a valid jpeg? Can you open it with an image viewer? What happens when you run `file Lenna.jpg`? – Useless Mar 02 '21 at 15:15
  • How did you install ImageMagick? It looks like you are missing delegates for JPG and PNM. What do you get from `convert -version`? Does it list Delegates? – fmw42 Mar 02 '21 at 16:38
  • Yes, Lenna.jpg is valid. I downloaded the image from google. – SVJ Mar 02 '21 at 18:00
  • i get this Version: ImageMagick 7.0.11-1 Q16 x86_64 2021-02-21 https://imagemagick.org Copyright: (C) 1999-2021 ImageMagick Studio LLC License: https://imagemagick.org/script/license.php Features: Cipher DPC HDRI OpenMP(4.5) Delegates (built-in): x .............. I followed this link to install ImageMagick https://www.tecmint.com/install-imagemagick-on-debian-ubuntu/ – SVJ Mar 02 '21 at 18:04
  • What are the list of Delegates? If none are listed, then the install failed – fmw42 Mar 02 '21 at 20:58
  • https://stackoverflow.com/questions/32390318/cimg-failed-to-recognize-the-jpg-format – Dion Mar 05 '21 at 06:37
  • @Dion i went through the link earlier but it didn't solve the issue. – SVJ Mar 17 '21 at 11:10

0 Answers0