Trying to access image files over internet

hi Guys,

I’m trying to read in image files from the internet, which is kinda tricky when the OcrEngine.setImage(File file) method takes a File object as an arguement. The best configuration I could come up with was:

String source = "http://www.someplace.com/images/logo.gif";
URI uri = new URI(source);
File image = new File(uri); //<<<This is where she stalls*
ocr.setImage(image);

What I get is an exception:

java.lang.IllegalArgumentException: URI scheme is not "file"

Is there a workaround for this? This obviously not working the way I had hoped. I was hoping there would be a setImage(BufferedImage image) or setImage(ImageIO image) method.

If there is a way to read in image files from the internet, please advise.

Alan

Hi Alan,

The reason for this issue is that URI object does not support HTTP scheme. URI format should be like the following:

URI fileUri = new URI(file:///FileName.bmp);

At the moment, Aspose.OCR for Java does not support GIF format. Two new issues to support GIF format and load image from URL have been logged into our issue tracking system as OCR-33149 and OCR-33150 respectively. We will keep you updated on these issues in this thread.

Best Regards,

The issues you have found earlier (filed as OCR-33149) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as OCR-33150) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.