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

    • Bug
    • Status: Open (View Workflow)
    • Medium
    • Resolution: Unresolved
    • 6.18/04
    • None
    • Graphics
    • None
    • Ubuntu 18.04

    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

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

            Dates

              Created:
              Updated: