| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2005.11.13 16:49 "Re: Calculate Offset and can't read ASCII", by Andrey KiselevOn Thu, Nov 10, 2005 at 11:44:49AM +0100, Thomas Oldenkott wrote:
> 1) I need a way to calculate the offset of an image. I want to export
> it in a csv-File. Is there a tag? How do I make this?
Yes, it is a tag called StripOffsets (273) and it contains an array of
image chunks offsets. I some cases (ususally when the file is small)
the whole data will be paced in the single chunk, but much more often
there will be several chunks. Corrsponding tag StripByteCounts contains
array of chunks sizes.
> 2) By reading tags in an ASCII format (for example TIFFTAG_DATETIME)
> to an char array I get crazy values.
> Where is the problem?
>
> Example:
> char IMAGEDATETIME[50];
> TIFFGetField(tif,306,&IMAGEDATETIME);
> printf("\nIMAGEDATETIME= %s", IMAGEDATETIME);
> TIFFSetField(out,306,IMAGEDATETIME);
Hmm, this should work with one except: you don't need to allocate array
for the string, you will get a pointer to already allocated buffer which
you shouldn't free. So it should look like that:
char *IMAGEDATETIME;
TIFFGetField(tif,306,&IMAGEDATETIME);
printf("\nIMAGEDATETIME= %s", IMAGEDATETIME);
TIFFSetField(out,306,IMAGEDATETIME);
// If we need to copy data for further needs
char *NEWDATETIME[20];
strncmp(NEWDATETIME, IMAGEDATETIME, 20);
NEWDATETIME[19] = '\0';
Regards,
Andrey
--
Andrey V. Kiselev
Home phone: +7 812 5970603 ICQ# 26871517
|
|||||||