Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-10507

TASImage::CopyArea() limits destination index and crops picture when copying into bigger image

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 6.18/04
    • Fix Version/s: None
    • Component/s: Graphics
    • Labels:
      None
    • Environment:

      Ubuntu 18.04

    • Development:

      Description

      When copying from a smaller to a bigger TASImage with CopyArea(), idx2, index in destination array is clamped to smallImage->GetWidth() * smallImage->GetHeight() (line 5057 in TASImage.cxx) even though destination picture is bigger. As a result, bigger image contains only a cropped portion of the smaller one.

      MWE:

      #include <TASImage.h>

      void CopyAreaMWE() {
         TASImage *smallImage = new TASImage("small.png");
         TASImage* bigImage = new TASImage(2 * smallImage->GetWidth(), 2 * smallImage->GetHeight());
         smallImage->CopyArea(bigImage, 0, 0, smallImage->GetWidth(), smallImage->GetHeight(), 0, 0);
         bigImage->WriteImage("big.png");
      }

        Attachments

          Activity

            People

            • Assignee:
              couet Olivier Couet
              Reporter:
              mkabus Maja Jadwiga Kabus
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: