libtiff

TiffLib leaks handles to invalid files

If I try to open an invalid TIFF file with TIFFOpen(), the function returns NULL. For some reason, the error handler isn't called. However, the file remains open, so I can't delete/overwrite it from the same process. I tried using TIFFFdOpen(), so that I can close the handle myself, but for some reason it gives me this error on valid TI...

efficient TIFF tile extraction C++

I am working with 1gb large tiff images of around 20000 x 20000 pixels. I need to extract several tiles (of about 300x300 pixels) out of the images, in random positions. I tried the following solutions: Libtiff (the only low level library I could find) offers TIFFReadline() but that means reading in around 19700 unnecesary pixels. I i...

LibTIFF: Extract all tags from a TIFF image

I'm currently working on a project which requires me to split a TIFF image into a file containing all tags and a file containing all image data and to reconstruct a TIFF image from these files. The only problem is that it seems that LibTIFF provides no easy way to grab all tags from an image. I've tried using TIFFGetTagListCount and th...

Using LibTiff from C# (to access tiled TIFF images)

Hi, I'd like to use LibTiff to access very large TIFF files. I need functions like multiple pages and tiles, and so LibTiff seems to be the right way to go. Can anyone help me on how to use LibTiff from C#? I've found some links (like blog.bee-ee which contained partial code. But I couln't get beyond getting a version. I've looked at Fr...

downscale large 1 bit tiff to 8 bit grayscale / 24 bit

Hi, Let's say i have a 100000x100000 1 bit (K channel) tiff with a dpi of 2000 and i want to downscale this to a dpi of 200. My resulting image would be 10000x10000 image. Does this mean that every 10 bits in the 1 bit image correspond to 1 pixel in the new image? By the way, i am using libtiff and reading the 1 bit tiff with tiffreadsc...

Getting libjpeg/libTIFF.dylib error after recompiling php in OS X 10.6.3 Server

I've recompiled php 5.3.0 under OS X Server (10.6.3) in order to gain Freetype support in GD. As part of the process, I recompiled libjpeg-8a (and before that I tried libjpeg-7). But when I run apachectcl configtest, I get the following error: httpd: Syntax error on line 155 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/...

Use LibTIff in C# to convert from one tiff format to another

I have a Tiff using JPEG format the WPF / C# can not handle via TiffBitmapDecoder. Our clients use the file format and our current C++ and Java code handles it. I need to convert this to a format I can display using TiffBitmapDecoder or standard BitmapImage. It looks like the C# version of LibTiff is the way to go but I am not having any...

Getting error when trying to apply "ExtraSamples" tag to a TIFF file to be written

I have a program that takes an image and writes that out to a TIFF file. The image can be grey scale (8 bit), grey scale with alpha channel (16 bit), RGB (24 bit), or ARGB (32 bit). I don't have any problems writing out the images without an alpha channel, but for the images with alpha, when I try to set the extra samples tag, I get se...

Can't write TIFF files using Libtiff on Mac

I use libtiff3.9.4 for reading and writing TIFF files in c++ on my mac. My project is written to be portable and runs without any issues on both Windows 32-bit og Ubuntu 64-bit. But on the mac the Libtiff function TIFFWriteScanline always fails (it returns != 1). The TIFF file is created, but it does not have any contents. I have tried ...

SSE enhanced libtiff/CCITT Fax4 encoder

Does anyone know of an SSE ehanced version of libtiff? Even just an SSE enhanced version of a CCITT Group4 encoder would do, I could do the work of sliding that one in libtiff myself. I only need to work with bitonal images. Thank you ...

tiffcp.exe merging a results file with a results file in a loop

I am building a web app that takes several tiff image files and merges them together into one single tiff image file using GNUWin32 tiffcp.exe from command line. The way I was doing it was to loop through the file list and build a string of file names to merge into one single variable. strfileList = "c:folder\folder\folder\aased98-de...

iTextSharp CCITTFAX3 CCITTFAX4

Hi, Given a fax image embedded in a pdf. I have used the code below to successfully extract an image. My particular image uses CCITTFAX3 and not CCITTFAX4. Does anyone know what property I can read in the PDF or infer using LibTiff.NET to obtain the correct compression depending on how the image was encoded. case "/CCITTFaxDecode": ...

Detecting bits per pixel in a TIFF image

Handling monochrome tiff image using LibTiff, I can read "Bits per sample" parameter: TIFFTAG_BITSPERSAMPLE. When it returns 16, actual "Bits per pixel" value for such image may be any value from 9 to 16, in most cases this is 10, 12, 14 or 16. Is there any tiff image tag that keeps this value? ...

LIBTIFF C# color image conversion

Hi, I am using BitMiracle LibTIFF. I cannot find any sample code to take a 32bpp argb colour image and write the bitmap to a tiff using this library. Has anyone else attempted this? Here is my sample code. It produces a file, but it cannot be viewed by any software that I have. EDIT: The code now works, but the colors are wrong! ...