AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
November 2005

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2005.11.10 10:44 "Calculate Offset and can't read ASCII", by Thomas Oldenkott
2005.11.13 16:49 "Re: Calculate Offset and can't read ASCII", by Andrey Kiselev
2005.11.18 11:58 "Re: Calculate Offset and can't read ASCII", by Thomas Oldenkott
2005.11.23 21:55 "Re: Calculate Offset and can't read ASCII", by Andrey Kiselev
2005.12.04 17:32 "Re: Calculate Offset and can't read ASCII", by Joris Van Damme

2005.11.13 16:49 "Re: Calculate Offset and can't read ASCII", by Andrey Kiselev

On 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