getImageWidth
int sutil.getImageWidth ( String imagePath ) (enterprise edition only)
Description
Get the width of an image.
Parameters
- imagePath File path to the image, as a string.
Return Values
Returns the width in pixels of the image file, as an integer. If the file doesn't exist or is not an image an error will be thrown and -1 will be returned.
Change Log
Version | Description |
---|---|
5.0 | Moved from session to sutil. |
4.5 | Available for enterprise edition. |
Examples
Write Image Width to Log
// Output the width of the image to the log.
session.log( "Image height: " + sutil.getImageWidth( "C:/my_image.jpg" ) );
session.log( "Image height: " + sutil.getImageWidth( "C:/my_image.jpg" ) );
scraper on 07/16/2010 at 4:54 pm
- Printer-friendly version
- Login or register to post comments