AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2003.09.30 14:38 "[Tiff] how can i show the different TIFF tile image on the computer screen?", by Zuyuan Wang
2003.09.30 15:27 "[Tiff] how can i show the different TIFF tile image on the computer screen?", by Kai-Uwe Behrmann
2003.09.30 17:21 "[Tiff] how can i show the different TIFF tile image on the computer screen?", by Andrey Kiselev
2003.10.31 00:45 "ask for suggestions....", by
2003.10.31 00:51 "Re: ask for suggestions....", by
2003.10.31 10:41 "[Tiff] Re: ask for suggestions....", by Zuyuan Wang
2003.10.31 11:35 "[Tiff] Re: ask for suggestions....", by Andrey Kiselev
2003.11.03 15:23 "[Tiff] Re: ask for suggestions....", by Zuyuan Wang
2003.11.03 16:14 "[Tiff] Re: ask for suggestions....", by Andrey Kiselev
2003.11.04 09:52 "[Tiff] Re: ask for suggestions....", by Zuyuan Wang
2003.12.26 11:37 "Re: [Tiff] Reading and writing out TIFFTAG_CLIPPATH", by Andrey Kiselev
2003.12.26 23:29 "Re: [Tiff] Reading and writing out TIFFTAG_CLIPPATH", by Jae Ho Lee
2003.12.28 21:43 "Re: [Tiff] Reading and writing out TIFFTAG_CLIPPATH", by Andrey Kiselev
2003.10.31 16:40 "[Tiff] Re: ask for suggestions....", by
2003.10.31 16:45 "[Tiff] Re: ask for suggestions....", by
2003.11.03 15:36 "[Tiff] Re: ask for suggestions....", by Zuyuan Wang
2003.11.03 16:01 "[Tiff] Re: ask for suggestions....", by Frank Warmerdam
2003.11.03 16:58 "[Tiff] Re: ask for suggestions....", by Andrey Kiselev

2003.12.26 11:37 "Re: [Tiff] Reading and writing out TIFFTAG_CLIPPATH", by Andrey Kiselev

Hello,

On Fri, Dec 26, 2003 at 11:02:47AM +0900, Jae Ho Lee wrote:
> But I still could not write PHOTOSHOP tag data to newly created tiff
> image until I made below changes to TIFFWriteNormalTag() fuction in
> tif_dirwrite.c file.

I can't reproduce your problem with the file you sent to me. Attached
sample program works well and Photoshop tag is properly copied to the
output image.

--
Andrey V. Kiselev

Home phone: +7 812 5274898 ICQ# 26871517

#include <stdio.h>

#include <stdlib.h>

#include "tiffio.h"

int main (int argc, char **argv)
{

unsigned int i, count;
TIFF *in, *out;
uint16 spp, bpp, photo;

uint32 image_width, image_height;

    char *buf, *photoshop;

in = TIFFOpen(argv[1], "r");
if (!in)
        {
        fprintf (stderr, "Can't open %s for reading\n", argv[1]);
        return 2;
        }

TIFFGetField(in, TIFFTAG_IMAGELENGTH, &image_height);

TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bpp);

TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &spp);

TIFFGetField(in, TIFFTAG_PHOTOMETRIC, &photo);

TIFFGetField(in, TIFFTAG_PHOTOSHOP, &count, &photoshop); fprintf(stdout, "Photoshop tag length: %d\n", count);

image_width = TIFFScanlineSize(in);
buf = malloc(image_width * image_height);
for (i = 0; i < image_height; i++)
    TIFFReadScanline(in, &buf[i * image_width], i, 0);

out = TIFFOpen("out.in", "w");

TIFFSetField(out, TIFFTAG_IMAGEWIDTH, image_width / spp);

TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, bpp);

TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, spp);

TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);

TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photo);

TIFFSetField(out, TIFFTAG_PHOTOSHOP, count, photoshop);

TIFFDefaultStripSize(out, 0)); TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,

for (i = 0; i < image_height; i++)
    TIFFWriteScanline(out, &buf[i * image_width], i, 0);

TIFFClose(out);

TIFFClose(in);

    return 0;
}