Browse our Products

Aspose.OCR for Java 25.3.0 - Release Notes

What was changed

KeySummaryCategory
OCRJAVA‑413Added automatic detection of image language, supporting: English (Latin), Cyrillic, Arabic, Chinese, Japanese, Korean, Hindi, Tamil, Telugu, and Kannada.New feature

Public API changes and backwards compatibility

This section lists all public API changes introduced in Aspose.OCR for Java 25.3.0 that may affect the code of existing applications.

Added public APIs:

LanguageDetectionOutput class

This class stores the results of language detection.

PropertyTypeDescription
sourcestringThe full path or URL of the source file. If the file is provided as a BufferedImage, InputStream, an array of pixels, or a Base64 string, this value will be empty.
pageintPage number. When working with single-page images, this value is always 0.
LanguagesList<Map.Entry<Language, Float>>Lists the languages detected in the image along with their probabilities.

DetectLanguages method

Identify languages on the images provided in OcrInput object and return them as a list of LanguageDetectionOutput objects.

Updated public APIs:

No changes.

Removed public APIs:

No changes.

Examples

The code samples below illustrate the changes introduced in this release:

Detect languages on the image

OcrInput input = new OcrInput(InputType.SingleImage);
input.add("source.png");
LanguageDetectionOutput result = api.DetectLanguages(input).get(0);
out.println("File: " + result.source);
out.println("Page: " + result.page);
for(Map.Entry<Language, Float> l : result.languages)
out.println("Language: " + l.getKey()+ " : " + l.getValue());