Aspose.Imaging for Java 3.6.0 Release Notes

KeySummaryCategory
IMAGING-35315Support merging PSD layers when converting to a JPGFeature
IMAGING-35301Support export Emf/Emf+ files to raster formatsFeature
IMAGING-35078Support for Metafile (EMF) in .NetFeature
IMAGING-35317Converting PSD to TIFF is producing incorrect TIFF imageEnhancement
IMAGING-35302Improve memory usage while rendering emf/emf+ filesEnhancement
IMAGING-35198Aspose.Imaging drawing engine stage by stage introduction in part of enabling of own drawing engine usageEnhancement
IMAGING-34796Verify all raster image operations so that watermarks are not duplicatedEnhancement

Usage examples:

IMAGING-35301 Support export Emf/Emf+ files to raster formats

 public void Run()

{

        String filePath = "TestEmfBezier.emf";

        EmfRasterizationOptions emfRasterizationOptions = new EmfRasterizationOptions();

        emfRasterizationOptions.setBackgroundColor(Color.getPapayaWhip());

        emfRasterizationOptions.setPageWidth(300);

        emfRasterizationOptions.setPageHeight(300);

        ExportImage(filePath,new BmpOptions(),emfRasterizationOptions);



        ExportImage(filePath,new GifOptions(),emfRasterizationOptions);



        ExportImage(filePath,new JpegOptions(),emfRasterizationOptions);



        ExportImage(filePath,new Jpeg2000Options(),emfRasterizationOptions);



        ExportImage(filePath,new PngOptions(),emfRasterizationOptions);



        ExportImage(filePath,new PsdOptions(),emfRasterizationOptions);



        TiffOptions tiffOptions= new TiffOptions(TiffExpectedFormat.TiffLzwRgb);

        tiffOptions.setVectorRasterizationOptions(emfRasterizationOptions);

        ExportImage(filePath,tiffOptions,emfRasterizationOptions);



        ExportImage(filePath,new WebPOptions(),emfRasterizationOptions);

}



private void ExportImage(String srcFileName,ImageOptionsBase toOptions,EmfRasterizationOptions emfRasterizationOptions)

{

        EmfImage image = EmfImage.load(srcFileName);

        try

        {

          if (!image.getHeader().getEmfHeader().getValid())

          {

            throw new ImageLoadException("The file " + srcFileName +" is not valid");

          }

          toOptions.setVectorRasterizationOptions(emfRasterizationOptions);  

          String ext = toOptions.getClass().getName().replace("Options", "");

          image.save(srcFileName + "."+ext, toOptions);

        }

        finally

        {

          image.dispose();    

        }

}

IMAGING-35078 Support for Metafile (EMF) in .Net

 string filePath = "TestEmfBezier.emf";

EmfRasterizationOptions emfRasterizationOptions = new EmfRasterizationOptions();

emfRasterizationOptions.BackgroundColor = Color.PapayaWhip;

emfRasterizationOptions.PageWidth = 300;

emfRasterizationOptions.PageHeight = 300;

using (var image = (EmfImage)Image.Load(filePath))

{

    if (!image.Header.EmfHeader.Valid)

    {

        throw new ImageLoadException(string.Format("The file {0} is not valid", filePath));

    }

    image.Save(filePath + ".png", new PngOptions() { VectorRasterizationOptions = emfRasterizationOptions });

}

IMAGING-34796 Verify all raster image operations so that watermarks are not duplicated

 string outputPath = "result.jpg";

using (RasterImage image = (RasterImage)Image.Load("im-resolution-150.jpg"))

{

    image.AdjustBrightness(200);

    image.RotateFlip(RotateFlipType.Rotate180FlipX);

    image.Save(outputPath);

}
 string outputPath = "result.jpg";

using (RasterImage image = (RasterImage)Image.Load("im-resolution-150.jpg"))

{

    image.AdjustGamma(5);

    image.RotateFlip(RotateFlipType.Rotate180FlipX);

    image.Save(outputPath);

}

IMAGING-35198 Aspose.Imaging drawing engine stage by stage introduction in part of enabling of own drawing engine usage

 public void DoSomeDrawing(Aspose.Imaging.Image image)

{

    Aspose.Imaging.Graphics.UseOwnDrawingEngine = true;

    Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);

    // Do some drawing with 'graphics' here...

}
 public void DoSomeDrawing(Aspose.Imaging.Image image)

{

    Aspose.Imaging.Graphics.UseOwnDrawingEngine = false;

    Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);

    // Draw with old drawing engine

}