wasError
String wasError ( )
Description
Returns true if there was an error, false otherwise. Also returns false if the image has not been resolved yet
Parameters
This method takes no parameters
Return Value
True if there was an error, false otherwise
Change Log
Version | Description |
---|---|
5.5.29a | Available in all editions. |
Examples
Convert and image to text
import com.screenscraper.util.images.*;
// Assuming an ImageDecoder was created in a different location and saved in "IMAGE_DECODER"
ImageDecoder decoder = session.getVariable("IMAGE_DECODER");
DecodedImage result = decoder.decodeFile("someFile.jpg");
if(result.wasError())
{
session.logWarn("Error converting image to text: " + result.getError());
}
else
{
session.log("Decoded Text: " + result.getResult());
}
// If the result was bad
result.reportAsBad();
// Assuming an ImageDecoder was created in a different location and saved in "IMAGE_DECODER"
ImageDecoder decoder = session.getVariable("IMAGE_DECODER");
DecodedImage result = decoder.decodeFile("someFile.jpg");
if(result.wasError())
{
session.logWarn("Error converting image to text: " + result.getError());
}
else
{
session.log("Decoded Text: " + result.getResult());
}
// If the result was bad
result.reportAsBad();
mikes on 11/21/2011 at 4:29 pm
- Printer-friendly version
- Login or register to post comments