Details
-
Bug
-
Status: Open (View Workflow)
-
Medium
-
Resolution: Unresolved
-
6.18/04
-
None
-
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");
}