Return-Path: <tiff-admin@remotesensing.org>
Received: from cee.skynet.be (cee.skynet.be [195.238.2.101])
        by twentyeight.skynet.be (8.12.9/8.12.9/Skynet-MAILSTORE-2.14) with ESMTP id hBQBmZxI013174
        for <joris.at.lebbeke@skynet.be>; Fri, 26 Dec 2003 12:48:35 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com ([208.24.120.42])
        by cee.skynet.be (8.12.9/8.12.9/Skynet-IN-2.32) with ESMTP id hBQBltap014722
        for <joris.at.lebbeke@skynet.be>; Fri, 26 Dec 2003 12:47:56 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com (localhost.localdomain [127.0.0.1])
	by yoda.imagelinks.com (8.11.6/8.11.2) with ESMTP id hBQBlBl06043;
	Fri, 26 Dec 2003 06:47:11 -0500
Received: from ahk.pu.ru (ahk.pu.ru [193.124.85.198])
	by yoda.imagelinks.com (8.11.6/8.11.2) with ESMTP id hBQBk9l06021
	for <tiff@remotesensing.org>; Fri, 26 Dec 2003 06:46:09 -0500
Received: from wg.pu.ru (wg.pu.ru [193.124.85.219])
	by ahk.pu.ru (8.12.9p2/8.12.9) with ESMTP id hBQBk7E7098990
	for <tiff@remotesensing.org>; Fri, 26 Dec 2003 14:46:07 +0300 (MSK)
	(envelope-from dron@ak4719.spb.edu)
Received: (from uucp@localhost)
	by wg.pu.ru (8.9.1a/8.9.1) with UUCP id LAA12207
	for tiff@remotesensing.org; Fri, 26 Dec 2003 11:46:07 GMT
Received: from ak4719.spb.edu (localhost [127.0.0.1])
	by ak4719.spb.edu (8.12.1/8.12.1/Debian -5) with ESMTP id hBQBbcmY003230
	for <tiff@remotesensing.org>; Fri, 26 Dec 2003 14:37:38 +0300
Received: (from dron@localhost)
	by ak4719.spb.edu (8.12.1/8.12.1/Debian -5) id hBQBbc67003227
	for tiff@remotesensing.org; Fri, 26 Dec 2003 14:37:38 +0300
From: Andrey Kiselev <dron@ak4719.spb.edu>
To: tiff@remotesensing.org
Subject: Re: [Tiff] Reading and writing out TIFFTAG_CLIPPATH
Message-ID: <20031226113738.GA2726@ak4719.spb.edu>
Mail-Followup-To: tiff@remotesensing.org
References: <01184AF4-31F3-11D8-8901-003065B8A0EC@softmagic.com> <p06020442bc08a8e4e1a3@[192.168.1.101]> <F8012545-3288-11D8-BE21-003065B8A0EC@softmagic.com> <99DE10C1-3747-11D8-B3F1-003065B8A0EC@softmagic.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="IS0zKkzwUGydFO0o"
Content-Disposition: inline
In-Reply-To: <99DE10C1-3747-11D8-B3F1-003065B8A0EC@softmagic.com>
X-GnuPG-Key: http://www.srces.spb.org/dron/export.home.key
X-Face: "t+se9s~+y~[XUH]L|pmeO3Pt/Q@DNv**S,d@_1-C=}/,c%<3Qp]eu!ok<"2lYJm$!9qVcg
 F?7o*L;|$`6|Q|>Rt-cU%2_y@6tQ|`!Li}TsvZvEKx;>fuY=fc(=sX^`7Wmw8%SsR`AvM$a;0U/eN\
 P?B\FTyqD,0np$U2!*'z_4D,VPlFf?bN0&zYf"zF0s!7Tl7?$we)xD0@lL>[h|8bhys0i.g|zLnu@C
 Ti@d]i=[!:j1CB\5/TF[m]`lfHfaqSN[0qn@T3zeosV/[LAss{@p_?],x*j8P_9t[}uHD^X-;j~\M!
 gyTly;fj`}&Y~i{<#bN.#QmkE}#T`dxP.I1\.)_MEN{@#W
User-Agent: Mutt/1.5.3i
Sender: tiff-admin@remotesensing.org
Errors-To: tiff-admin@remotesensing.org
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.0.11
Precedence: bulk
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Post: <mailto:tiff@remotesensing.org>
List-Subscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
List-Id: TIFF and libtiff discussion <tiff.remotesensing.org>
List-Unsubscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://remotesensing.org/pipermail/tiff/>
Date: Fri, 26 Dec 2003 14:37:38 +0300
X-UIDL: 2268bc947da51a716350dc0fe7336b67


--IS0zKkzwUGydFO0o
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--IS0zKkzwUGydFO0o
Content-Type: text/x-csrc; charset=us-ascii
Content-Disposition: attachment; filename="photoshop.c"

#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);
    TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, TIFFDefaultStripSize(out, 0));
    for (i = 0; i < image_height; i++)
        TIFFWriteScanline(out, &buf[i * image_width], i, 0);

    TIFFClose(out);
    TIFFClose(in);

    return 0;
}



--IS0zKkzwUGydFO0o--
_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://remotesensing.org/mailman/listinfo/tiff
