I am trying to rotate various frames of a multi-paged TIFF file using the TiffFrame.rotateFlip() method (aspose-imaging-1.8-jdk15) and have encountered an OutOfMemoryError.
The rotateFlip() method appears to take about 35 seconds to apply (which is too slow) and if two rotations are called back to back it throws the OutOfMemoryError about 15 seconds into the second rotation. Please advice if there is a different\quicker approach for these rotations.
// Load the 3 multipaged TIFF
TiffImage tiffImage = (TiffImage) Image.load("C:/Temp/TestTIFF.tif");
// Rotate the first page 90 degrees
tiffImage.getFrames()[0].rotateFlip(RotateFlipType.Rotate90FlipNone);
// Rotate the second page 180 degrees
tiffImage.getFrames()[1].rotateFlip(RotateFlipType.Rotate180FlipNone);
// Rotate the third page 270 degrees
tiffImage.getFrames()[2].rotateFlip(RotateFlipType.Rotate270FlipNone);
// Save the TIFF
tiffImage.save("C:/Temp/TestTIFF_Rotated.tif");
java.lang.OutOfMemoryError: Java heap space
at com.aspose.imaging.internal.r.g.(Unknown Source)
at com.aspose.imaging.internal.s.b.a(Unknown Source)
at com.aspose.imaging.V.a(Unknown Source)
at com.aspose.imaging.V.a(Unknown Source)
at com.aspose.imaging.internal.s.a.a(Unknown Source)
at com.aspose.imaging.fileformats.tiff.u.a(Unknown Source)
at com.aspose.imaging.fileformats.tiff.TiffFrame.a(Unknown Source)
at com.aspose.imaging.RasterCachedImage.b(Unknown Source)
at com.aspose.imaging.RasterImage.a(Unknown Source)
at com.aspose.imaging.RasterImage.a(Unknown Source)
at com.aspose.imaging.RasterImage.loadPartialPixels(Unknown Source)
at com.aspose.imaging.RasterCachedImage.rotateFlip(Unknown Source)
TestTiff.tif detials: