tif bit depth incorrect on 64 bit linux

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
moe_at_core

tif bit depth incorrect on 64 bit linux

Post 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");
}
moe_at_core

Re: tif bit depth incorrect on 64 bit linux

Post 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.
Post Reply