GraphicsExportSetResolution error

Ask a Question related to Mac Programming, Design and Development.

  1. #1

    Default GraphicsExportSetResolution error

    Hey

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

    Fixed dpi = Long2Fix(96);
    GraphicsExportSetResolution(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. Similar Questions and Discussions

    1. Error Message "A drawing error ocurrred which is probably due to an out-of-memory condition. Try qu
      I am running Acrobat Reader 5.0 on a Mac Powerbook running OS 9.2 and keep getting "A drawing error occurred which is probably due to an out of...
    2. Error 403 Failed to read heders Error for long-runningCFMAIL and CFINDEX command
      I have two different pages with long-running scripts on which I am recieving the following error: Error - 403 Failed to read headers to server:...
    3. Error Creating Control: Parser Error DocHeader does not have a property named 'cc3:MyItems'
      I am having problems getting this webcontrol working properly. Everything else works fine except having items. So here is the low-down on the...
    4. Postscript Print error (ERROR: rangecheck; OFFENDING COMMAND: filter)
      We are attempting to print off some rather large image files on a Xerox 340 and an HP Laserjet 4MV printer via Adobe Acrobat 6. Smaller similar files...
    5. An error occurred while try to load the string resources (GetModuleHandle failed with error -2147023888)
      Hello, on one of our customers servers we get following error on first ASPX-page: An error occurred while try to load the string resources...
  3. #2

    Default Re: GraphicsExportSetResolution error

    In Article [email]b4b8c5a0.0308080659.3e1d8a38@posting.google.com[/email], Jedidja
    Bourgeois wrote:
    > Has anyone tried setting the output dpi (resolution) using
    > GraphicsExportSetResolution? If i call it as such:
    >
    > Fixed dpi = Long2Fix(96);
    > GraphicsExportSetResolution(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

  4. #3

    Default Re: GraphicsExportSetResolution 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

  5. #4

    Default Re: GraphicsExportSetResolution error

    In article <b4b8c5a0.0308090723.3a366a58@posting.google.com >,
    [email]jedidjab79@hotmail.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

  6. #5

    Default Re: GraphicsExportSetResolution error

    In Article bh37j8$tqtdb$1@ID-2640.news.uni-berlin.de, Thomas Engelmeier
    wrote:
    > In article <b4b8c5a0.0308090723.3a366a58@posting.google.com >,
    > [email]jedidjab79@hotmail.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

  7. #6

    Default Re: GraphicsExportSetResolution 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 GraphicsExportSetResolution(). 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

  8. #7

    Default Re: GraphicsExportSetResolution 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

  9. #8

    Default Re: GraphicsExportSetResolution error

    In Article [email]b4b8c5a0.0308110835.fc55f7c@posting.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

  10. #9

    Default Re: GraphicsExportSetResolution error

    In article <b4b8c5a0.0308110835.fc55f7c@posting.google.com> ,
    [email]jedidjab79@hotmail.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

  11. #10

    Default Re: GraphicsExportSetResolution error

    In article <BB5E06C9.15302%mike@objc-source.-DELETE-.org>,
    Mike Kluev <mike@objc-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

Posting Permissions

  • You may not post new threads
  • You may 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