Question

Using Visual Studio 2012

I'm writing an adapter class library to make access to LibTiff.Net's TiffCP utility a little cleaner and less dependent on strings (this utility allows, among other things, a user to extract single pages from multipage tiff images).

I've tried using both pre-built LibTiff and building from source, but once I add the BitMiracle.LibTiff.Net reference to my adapter project, I don't have access to the TiffCP namespace. It seems that, of the five projects in the LibTiff solution, only the LibTiff namespace is being built, and the same BitMiracle.LibTiff.Net dll is being placed in all of the five project's bin/debug folder. I have checked the configuration of the LibTiff solution and all projects are set to build... What am I missing here? Am I going to have to add the actual LibTiff and TiffCP project to my class library to access TiffCP, or is there some way to get a dll that will allow me to access the methods of TiffCP?

Here is a sample from LibTiffs website of how to use the TiffCP tool, but again, it simply isn't working for me given the dlls output from the LibTiff build.

using System;
using System.Diagnostics;

using BitMiracle;

namespace BitMiracle.LibTiff.Samples
{
    public static class SplitTiffImage
    {
        public static void Main()
        {
            string[] arguments =
            {
                @"Sample Data\multipage.tif,1",
                "SplitTiffImage_2ndPage.tif"
            };
            TiffCP.Program.Main(arguments); //TiffCP reference not recognized

            Process.Start("SplitTiffImage_2ndPage.tif");
        }
    }
}
Was it helpful?

Solution

You have to add a reference to TiffCP.exe into your project, and it works, TiffCP.exe is in the zip file at http://bitmiracle.com/libtiff/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top