Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-3618

QImage bug: QImage DPI problem with JPG

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.4.2
    • Image formats
    • None

    Description

      The DPI functions for QImage (and QPaintDevice) are returning incorrect values for a JPG image that was taken with a Nikon D2Xs camera.
      Both Photoshop CS3 and the Windows file properties dialog box correctly show the DPI as 300.

      You can download the JPG from here: http://jack.fxhome.com/problemImage.JPG

      #include <QtGui/QImage>
      #include <iostream>

      int main(int argc, char *argv[])
      {
      using namespace std;

      if (argc != 2)

      { cout << "Usage: " << argv[0] << " <image filename>" << endl; return 0; }

      QImage image(argv[1]);

      cout << "dotsPerMeter:\t" << image.dotsPerMeterX() << " " <<
      image.dotsPerMeterY() << endl;
      cout << "logicalDpi:\t" << image.logicalDpiX() << " " <<
      image.logicalDpiY() << endl;
      cout << "physicalDpi:\t" << image.physicalDpiX() << " " <<
      image.physicalDpiY() << endl;

      return 0;
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sletta Gunnar Sletta
            engvolds Morten Engvoldsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes