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

QPixmap save function size overflow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.0
    • 5.12
    • GUI: Painting
    • None
    • Linux/Wayland

    Description

      There is an overflow during creation of jpeg if size exceed 32767 in one of directions.

      Reproduction: create big enough jpeg.

       

      Code example:

      scene - is custom struct

       

      auto b_r = scene.BoundingRect();

      auto target_rect = QRectF(0,0,b_r.width() * 600.0 / 25.4, b_r.height() * 600.0 / 25.4);

      QPixmap pm(target_rect.toRect().size());

      pm.fill(Qt::white);

      QPainter painter(&pm);

      ............

      scene.sc->render(&painter, target_rect, b_r);  // scene.sc is a QGraphicsScene

      pm.save(fn,"JPG"); 

      Attachments

        Activity

          People

            vgt Eirik Aavitsland
            wknight Andrey Karpenko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: