I have a TIFF file with the Orientation tag set to TOPLEFT (The 0th row represents the visual top of the image, and the 0th column represents the visual left-hand side). I create a new TIFF and set its Orientation tag to RIGHTTOP (The 0th row represents the visual right-hand side of the image, and the 0th column represents the visual top) and fill it with the original data using code looking something like this:
byte[] scanline = new byte[original_img.ScanlineSize()];
for (int i = 0; i < height; i++)
{
original_img.ReadScanline(scanline, i);
rotated_img.WriteScanline(scanline, i);
}
That imo would create a rotation by 90° clockwise and that's what I want in the end. The problem is, simply setting the Orientation tag doesn't do the trick, I just get a copy of the original image. Extracting the data of the original image and manipulating it, then filling the new picture up with that rotated data seems unnecessarily complicated and I would like to avoid that and find a simple way. Is there a way as simple as my approach, and if so, please explain, or will I have to manually rotate the image data?
edit: The code I use for setting the orientation tag is:
rotated_img.SetField(TiffTag.ORIENTATION, BitMiracle.LibTiff.Classic.Orientiation.RIGHTTOP);
Also probably worth mentioning that for now I'm only using BitMiracle.LibTiff.Classic in that context.