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

QPixmap save function size overflow

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Fixed
    • Affects Version/s: 5.12
    • Fix Version/s: 6.0
    • Component/s: GUI: Painting
    • Labels:
      None
    • Platform/s:
      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

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

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes