2009-04-03 10:19:17 UTC
I'm using scientific linux 4.7.
The g++ version is
> g++ -v
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-10
This code
#include <time.h>
#include <iostream>
#include "CImg.h"
using namespace cimg_library;
using namespace std;
int main(int argc,char **argv)
{
//To use parameters
//const unsigned int tipo = cimg_option("-t",0,"loquesea");
const char* filename_i = cimg_option("-i","image.gif","Input image file");
//const char* filename_o = cimg_option("-o","image_o.gif","Output image file");
//const char* filter_file = cimg_option("-filter","loquesea.txt","To load the filter to apply from a txt file.");
//const bool a_grises = cimg_option("-2gray",false,"To convert the image to graylevel.");
//const bool normalize = cimg_option("-norm",false,"To normalize the image after filtering.");
//var declaration
CImg<double> img = filename_i;
img.save("original.tiff");
return 0;
}
Compiled by
g++ -o bug_cimg bug_cimg.cpp -static -Wall -Dcimg_display=0 -Dcimg_use_jpeg -ljpeg -Dcimg_use_png -lpng -Dcimg_use_tiff -ltiff -lz -lm
Returns an image that can't be opened by gimp antd other linux applications. Only irfanview under XP can open it, but the resulting image doesn't look like the original at all.
It seems I can't upload iamges to the forum.
The problem arises with several images and formats, even when the loaded image is a tiff, like for example
http://sampl.ece.ohio-state.edu/data/stills/waterloo-colorset/lena.tiff
Hope this can help. If you need any other info just let me know.