LEADTOOLS Support
Imaging
Imaging SDK Questions
Java, leadtools.RasterException: User has aborted operation
#1
Posted
:
Thursday, October 13, 2016 7:53:44 AM(UTC)
Groups: Registered
Posts: 4
I am simply trying to load an image using the Java API for Windows, but i always get the exception: leadtools.RasterException: User has aborted operation.
I try something like this:
codecs = new RasterCodecs();
RasterImage image = codecs.load(filePath,0, CodecsLoadByteOrder.BGR,1,1);
Whereas the filePath is a simple String representing the path to my file. My problem is, that i don't fully understand what the exception is and how to fix it.
Thanks in advance.
EDIT: I just forgot to set the license. Thanks to Nick from tech support!
#2
Posted
:
Thursday, October 13, 2016 9:57:04 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 163
Was thanked: 9 time(s) in 9 post(s)
Glad I was able to assist you with this error in chat, Karim. Here's how to set license in code to resolve the issue.
It will be necessary to call RasterSupport.SetLicense() prior to making any calls which use LEADTOOLS components.
https://www.leadtools.co...rsupport~setlicense.html Here is sample code on how to call it in a Java Application:
Code: public static boolean setLicense() {
/* TODO: Change this to use your license file and developer key */
String licenseFile = "Replace this with the path to the LEADTOOLS license file";
String developerKey = "Replace this with your developer key";
try {
leadtools.RasterSupport.setLicense(licenseFile,developerKey);
} catch (Exception e) {
System.out.println(e.getMessage());
return false;
}
return !leadtools.RasterSupport.getKernelExpired();
}
For an example on how to do this in code for the other support languages, see this post on our forums:
https://www.leadtools.co...untime-License#post41429Edited by user Friday, October 14, 2016 8:01:00 AM(UTC)
| Reason: Not specified
Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEADTOOLS Support
Imaging
Imaging SDK Questions
Java, leadtools.RasterException: User has aborted operation
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.