Page 1 of 1

tif bit depth incorrect on 64 bit linux

Posted: 2009-01-06T09:21:53-07:00
by moe_at_core
I am trying to write out a tiff image with byte pixels (using ImageMagick 6.4.5 on fedora 8 64 bit)
using the code below. However, the output image has float pixels. Am I doing something wrong, or is this a bug?


Thanks.

Code: Select all

#include <Magick++.h>

using namespace Magick;

int main(int argc, char *argv[])
{
    void* buf = 0;
    
    Image imgIn("test.jpg");
    buf = new char[imgIn.rows()*imgIn.columns()*3];

    imgIn.write(0, 0, imgIn.columns(), imgIn.rows(), "RGB", CharPixel, buf);
    
    Image imgOut;
    imgOut.read(imgIn.columns(), imgIn.rows(), "RGB", CharPixel, buf);
    imgOut.depth(8);
    imgOut.compressType(LZWCompression);
    imgOut.endian(LSBEndian);
    imgOut.write("out.tif");
}

Re: tif bit depth incorrect on 64 bit linux

Posted: 2009-01-07T14:08:55-07:00
by moe_at_core
I built a 32 bit version of this code on a fedora 8 32 bit machine, and it worked properly. I then took this executable that I built on the 32 bit machine and ran it on the 64 bit machine, and it had the same problem.

I have statically linked ImageMagick, so it is using the exact same ImageMagick code.

Any clues?

Thanks again.