Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active March 27, 2023 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aspose-com-gists/39471f525d4b5ea8567ac5bb7bbc8457 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/39471f525d4b5ea8567ac5bb7bbc8457 to your computer and use it in GitHub Desktop.

Aspose.Imaging Java API allows to easy save your images aware on extension in your Java application or Web service.

You can:

  • be sure that image extension corresponds image type.

Interested ?

You may go further at : https://products.aspose.com/imaging/java/

import com.aspose.imaging.Image;
String templatesFolder = "c:\\Users\\USER\\Downloads\\";
String inputFile = templatesFolder + "template.jpg";
String outputFile = templatesFolder + "saveImageExtensionAware.png";
try (Image image = Image.load(inputFile))
{
image.save(outputFile);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment