How to get TiffCP to combine images with higher bit depth than 1

238 views Asked by At

I am writing an application in C# that takes single page tiffs and combines them into a multi-page tiff. It works great except it fails on tiffs with a bit depth over 1. EG: 8 and 24 bit.

    private void CombineMulti_LibTiff(string pathToCombine, string newFilePath)
    {
            string[] dir = Directory.GetFiles(pathToCombine);

            string[] args = new string[dir.Length + 1];

            for (int i = 0; i < args.Length; i++)
            {
                if (i == dir.Length)
                {
                    args[i] = newFilePath;
                }
                else
                {
                    args[i] = dir[i];
                }
            }

            BitMiracle.TiffCP.Program.Main(args);
    }

Expect to see multi-page tiffs. With higher bit depths, the tiffs are all 16 bytes, and cannot be opened. Any assistance would be greatly appreciated.

I also confirmed it doesn't work from the command line.

1

There are 1 answers

0
SAW On

As it turns out, the files were stored as TIFFs, but were JPEG with the wrong extension.