Professional Web Applications Themes

GraphicportSetResolution error - Mac Programming

Hey Has anyone tried setting the output dpi (resolution) using GraphicportSetResolution? If i call it as such: Fixed dpi = Long2Fix(96); GraphicportSetResolution(compInst, dpi, dpi); and then open the file in Photoshop (or get info under XP), it shows up as 95.987 and 95 respectively. Is this normal behaviour for Quicktime? I tried saving an image out using Quicktime Pro but it doesn't seem to let you set the DPI in the configuration dialog. TIA...

  1. #1

    Default GraphicportSetResolution error

    Hey

    Has anyone tried setting the output dpi (resolution) using
    GraphicportSetResolution? If i call it as such:

    Fixed dpi = Long2Fix(96);
    GraphicportSetResolution(compInst, dpi, dpi);

    and then open the file in Photoshop (or get info under XP), it shows
    up as 95.987 and 95 respectively.

    Is this normal behaviour for Quicktime? I tried saving an image out
    using Quicktime Pro but it doesn't seem to let you set the DPI in the
    configuration dialog.

    TIA
    Jedidja Bourgeois Guest

  2. #2

    Default Re: GraphicportSetResolution error

    In Article [email]b4b8c5a0.0308080659.3e1d8a38posting.google.com[/email], Jedidja
    Bourgeois wrote:
    > Has anyone tried setting the output dpi (resolution) using
    > GraphicportSetResolution? If i call it as such:
    >
    > Fixed dpi = Long2Fix(96);
    > GraphicportSetResolution(compInst, dpi, dpi);
    >
    > and then open the file in Photoshop (or get info under XP), it shows
    > up as 95.987 and 95 respectively.
    >
    > Is this normal behaviour for Quicktime? I tried saving an image out
    > using Quicktime Pro but it doesn't seem to let you set the DPI in the
    > configuration dialog.
    What are dimensions of image in pixels? I guess they are too small,
    and this is triggered by some rounding error. Try your code with
    large image (like 1000 by 1000 pixels).

    --
    Mike Kluev

    PS. Remove "-DELETE-." part of my e-mail address to reply.

    Mike Kluev Guest

  3. #3

    Default Re: GraphicportSetResolution error

    > What are dimensions of image in pixels? I guess they are too small,
    > and this is triggered by some rounding error. Try your code with
    > large image (like 1000 by 1000 pixels).
    Why would dpi have any relation to the size of the image? It has no
    real bearing on the pixel data, just a flag for programs that need to
    size the image for output (eg print) right? It does appear to be
    rounding problems, yes, if I pass in 96.2 for instance, it shows up at
    96.012 in Photoshop. Very odd...
    Jedidja Bourgeois Guest

  4. #4

    Default Re: GraphicportSetResolution error

    In article <b4b8c5a0.0308090723.3a366a58posting.google.com >,
    [email]jedidjab79hotmail.com[/email] (Jedidja Bourgeois) wrote:
    > > What are dimensions of image in pixels? I guess they are too small,
    > > and this is triggered by some rounding error. Try your code with
    > > large image (like 1000 by 1000 pixels).
    >
    > Why would dpi have any relation to the size of the image? It has no
    > real bearing on the pixel data, just a flag for programs that need to
    > size the image for output (eg print) right? It does appear to be
    > rounding problems, yes, if I pass in 96.2 for instance, it shows up at
    > 96.012 in Photoshop. Very odd...
    In order to display 10 pixels of 96 dpi data (=.104166666... inch) on an
    72 dpi system you need (7 or) 8 pixels = .111111... inch.

    10 (original) pixels displayed within .111111... (real screen space)
    inch give an resolution of 90.000 +- rounding dpi.

    Ditto, if you convert an .104166666 inch wide 72 dpi image to 96 dpi
    ("preserving" dimensions), you will get the rounding error and an scaled
    image..

    Regards,
    Tom_E
    Thomas Engelmeier Guest

  5. #5

    Default Re: GraphicportSetResolution error

    In Article bh37j8$tqtdb$1ID-2640.news.uni-berlin.de, Thomas Engelmeier
    wrote:
    > In article <b4b8c5a0.0308090723.3a366a58posting.google.com >,
    > [email]jedidjab79hotmail.com[/email] (Jedidja Bourgeois) wrote:
    >
    >>> What are dimensions of image in pixels? I guess they are too small,
    >>> and this is triggered by some rounding error. Try your code with
    >>> large image (like 1000 by 1000 pixels).
    >>
    >> Why would dpi have any relation to the size of the image? It has no
    >> real bearing on the pixel data, just a flag for programs that need to
    >> size the image for output (eg print) right? It does appear to be
    >> rounding problems, yes, if I pass in 96.2 for instance, it shows up at
    >> 96.012 in Photoshop. Very odd...
    >
    > In order to display 10 pixels of 96 dpi data (=.104166666... inch) on an
    > 72 dpi system you need (7 or) 8 pixels = .111111... inch.
    >
    > 10 (original) pixels displayed within .111111... (real screen space)
    > inch give an resolution of 90.000 +- rounding dpi.
    >
    > Ditto, if you convert an .104166666 inch wide 72 dpi image to 96 dpi
    > ("preserving" dimensions), you will get the rounding error and an scaled
    > image..
    I would add to what Thomas said. The problem might be that Photoshop
    might not show dpi stored in the image. Instead it might recalculate
    it using pixelCount/imageSizeInInches formula. And it might round
    imageSizeInInches to be representable in whole points (1/72 inches).
    That's why I suggested you to try your code with big image and see
    if the problem disappears.

    --
    Mike Kluev

    PS. Remove "-DELETE-." part of my e-mail address to reply.

    Mike Kluev Guest

  6. #6

    Default Re: GraphicportSetResolution error

    Unfortunately I've tried 500x500, 1000x1000, 1500x1500 and nothing
    seems to change. The QT docs specifically mention that when you
    convert 72 (long) to a Fixed, it should be 0x00480000, which is the
    value i'm passing GraphicportSetResolution(). I find it a bit
    strange that both Photoshop and Explorer XP would then go ahead and
    disregard this value, but it seems to be what's happening. Exporting a
    picture from Photoshop produces a file with the correct DPI in both
    Photoshop and XP, so perhaps there's an extra tag or something that
    Quicktime doesn't fill in?
    Jedidja Bourgeois Guest

  7. #7

    Default Re: GraphicportSetResolution error

    Allright we figured it out. It's only with PNG files exported using
    Quicktime that there is an issue. Using the reference library fixes
    the problem. If you export TIFF or something else, the numbers come
    out correctly. It has to do with the way PNG stores dpi internally.
    Jedidja Bourgeois Guest

  8. #8

    Default Re: GraphicportSetResolution error

    In Article [email]b4b8c5a0.0308110835.fc55f7cposting.google.com[/email], Jedidja Bourgeois
    wrote:
    > Allright we figured it out. It's only with PNG files exported using
    > Quicktime that there is an issue. Using the reference library fixes
    > the problem. If you export TIFF or something else, the numbers come
    > out correctly. It has to do with the way PNG stores dpi internally.
    What is "reference library" and what was the fix? The rest of us will
    appreciate to know.

    --
    Mike Kluev

    PS. Remove "-DELETE-." part of my e-mail address to reply.

    Mike Kluev Guest

  9. #9

    Default Re: GraphicportSetResolution error

    In article <b4b8c5a0.0308110835.fc55f7cposting.google.com> ,
    [email]jedidjab79hotmail.com[/email] (Jedidja Bourgeois) wrote:
    > It's only with PNG files exported using
    > Quicktime that there is an issue. Using the reference library fixes
    > the problem.
    File an bug report ;)

    Regards,
    Tom"news:microsoft.test in the FUp´ removed"E
    Thomas Engelmeier Guest

  10. #10

    Default Re: GraphicportSetResolution error

    In article <BB5E06C9.15302%mikeobjc-source.-DELETE-.org>,
    Mike Kluev <mikeobjc-source.-DELETE-.org> wrote:
    > > Allright we figured it out. It's only with PNG files exported using
    > > Quicktime that there is an issue. Using the reference library fixes
    > > the problem. If you export TIFF or something else, the numbers come
    > > out correctly. It has to do with the way PNG stores dpi internally.
    >
    > What is "reference library" and what was the fix? The rest of us will
    > appreciate to know.
    <http://www.libpng.org/>

    Regards,
    Tom_E
    Thomas Engelmeier Guest

Similar Threads

  1. Error Message "A drawing error ocurrred which is probably due to an out-of-memory condition. Try qu
    By wendy_matarazzo@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 2
    Last Post: May 11th, 06:12 PM
  2. Replies: 0
    Last Post: March 29th, 09:49 PM
  3. Replies: 0
    Last Post: November 10th, 05:24 PM
  4. Postscript Print error (ERROR: rangecheck; OFFENDING COMMAND: filter)
    By Darrell_J_Brown@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 1
    Last Post: May 13th, 11:24 AM
  5. Replies: 1
    Last Post: August 7th, 07:13 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139