I am trying to open a .ras image in GIMP that was created in my program. I am able to open the file and view it in Photoshop as a .raw file, but the teacher requires that the grader/teacher view the file in GIMP. (go figure)
The error message I get is " Can't open file as SUN raster file"
I'm not sure what is causing the error.
Here is the code that saves the file. Any hints would be appreciated.
The "new image" is the same as the old when I open it in Photoshop, so I'm pretty sure its saving it. But I don't know how to force a format that GIMP can read.
is2.open("newimage.ras", ios:: out); //the extra space was to eliminate :o
struct rasterfile header;
size = header.ras_width*header.ras_height;
is2.write(reinterpret_cast<char *>(&header),sizeof(struct rasterfile));
cout << "Size: " << sizeof(size); //prints out 4
cout<< "header: " << sizeof(struct rasterfile); //prints out 32
Any help would be greatly appreciated. Thanks in advance