Results 1 to 3 of 3

Thread: X and YRESOLUTION in TIFF

  1. #1
    Join Date
    Jan 2009
    Posts
    5

    Question X and YRESOLUTION in TIFF

    Okay, I'm new to TIFF but I get that you're supposed to be able to set XResolution to some number like 300/1.
    The cast shown is a double, which I thought would be something like:

    BYTE buff[] = { 2c 01 00 00 01 00 00 00 }
    int rtx = IS40_SetTIFFTag_TW(hTIFF, 282, 0, (double)*buff);

    (rtx always returns 0, even on things that do work)

    It seems to ignore every byte but the 2c.

    So clearly I'm missing something obvious.
    I would like to set the resolution to 300pix per cm.

    Please help!
    Thanks in advance,
    Brian

  2. #2
    Join Date
    Mar 2006
    Posts
    805

    Default Re: X and YRESOLUTION in TIFF

    try it like this:

    Code:
    double dpi = 3.1415925;
    int rtx = IS40_SetTIFFTag_TW(hTIFF, 282, 0, dpi);
    if the tag is expecting a double, it's going to try to pop a double off the argument stack.

  3. #3
    Join Date
    Jan 2009
    Posts
    5

    Default Re: X and YRESOLUTION in TIFF

    Thanks, it works as you say. That should have been obvious, but the LibTIFF docs on the tag appear to say it requires two integers, which led me into a dark alley. Appreciate the help!
    -brian

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •