Aspose.Imaging for .NET 22.12 - Release notes

Competitive features:

  • Speed up create method in Aspose.Imaging
KeySummaryCategory
IMAGINGNET-4036Speed up create method in Aspose.ImagingFeature
IMAGINGNET-5865SVG to PNG, output image distortedEnhancement
IMAGINGNET-5819Fix memory leak when save tiffframes to MemoryStreamEnhancement
IMAGINGNET-5818Dynamic loading not works for conversion to dicomEnhancement
IMAGINGNET-5764Incorrect convertion from svg to pngEnhancement
IMAGINGNET-5710Specific tiff image to pdf conversionEnhancement
IMAGINGNET-5709Cannot load the CDR imageEnhancement
IMAGINGNET-5707Specific cdr image to pdf conversionEnhancement
IMAGINGNET-5672WebP export failureEnhancement
IMAGINGNET-4920Fix partial Pdf processing on exportEnhancement

Public API changes:

Added APIs:

Removed APIs:

Usage Examples:

IMAGINGNET-5865 SVG to PNG, output image distorted

string fileName = "D:\\Input.svg";
using (var image = Image.Load(fileName))
{
    image.Save(fileName + ".png");
}

IMAGINGNET-5819 Fix non-permanent bug

using (var image = (TiffImage)Image.Load("input.tiff"))
{
    foreach (TiffFrame f in image.Frames)
    {
        var ms = new MemoryStream();
        f.Save(ms, f.FrameOptions);
    }
}

IMAGINGNET-5818 Dynamic loading not works for conversion to dicom

using (var image = Image.Load("input.tiff")
{
    image.Save("dicom.dcm", new DicomOptions());
}

IMAGINGNET-5764 Incorrect convertion from svg to png

string fileName = "D:\\1.svg";
using (var image = Image.Load(fileName))
{
    image.Save(fileName + ".png");
}

IMAGINGNET-5710 Cannot convert the TIFF image to PDF

using (Image image = Image.Load("103_1.tif"))
{
    image.Save("103_1.tif.pdf", new PdfOptions());
}

IMAGINGNET-5709 Cannot load the CDR image

using (var image = Image.Load("D:\\03-08-2022 ADVERTISEMENT FINAL.cdr"))
{
    image.Save("D:\\03-08-2022 ADVERTISEMENT FINAL.cdr.png");
}

IMAGINGNET-5707 Cannot conver the CDR image to PDF format

using (var image = Image.Load("D:\\100 kva  GR JAMMU.cdr"))
{
    image.Save("D:\\100 kva  GR JAMMU.cdr.png");
}

IMAGINGNET-5672 WebP export failure

using (var image= Image.Load("input.webp"))
{
    image.Save("output.webp");
}

IMAGINGNET-4920 Fix partial Pdf processing on export

//Please, run this example on x86 mode.

const float mb = 1024 * 1024;
var workingSet64 = Process.GetCurrentProcess().WorkingSet64;
using (var image = Image.Load("D:\\151.tif"))
{
    image.Save("D:\\151.pdf");
}

var peak = (Process.GetCurrentProcess().PeakWorkingSet64 - workingSet64) / mb;

Assert.Less(peak, 300);
Console.WriteLine("The maximum amount of memory used is {0:0.00} mb", peak);

IMAGINGNET-4036 Speed up create method in Aspose.Imaging

var imageSize = new Size(1000, 1000);
var colors = CreateColors();
var options = new BmpOptions();
Stopwatch s = new Stopwatch();
s.Start();
for (var i = 0; i < 500; i++)
{
    using (var ms = new MemoryStream())
    {
        options.Source = new StreamSource(ms);
        using (var image = (RasterImage) Image.Create(options, imageSize.Width, imageSize.Height))
        {
            image.SaveArgb32Pixels(image.Bounds, colors);
            image.Save();
        }
    }
}

s.Stop();    
Console.WriteLine("{0:0.0000}sec", s.Elapsed.TotalSeconds);



private int[] CreateColors()
{
    var inputFile = @"D:\tiger.bmp";
    using (RasterImage image = (RasterImage)Image.Load(inputFile))
    {
        var colors = image.LoadArgb32Pixels(image.Bounds);
        return colors;
    }
}