Forum Discussion

dablackgoku1234's avatar
dablackgoku1234
Occasional Contributor
9 years ago

Check Image size

I have a HTTP request step that checks the link of an image.  I am wondering if there is a way to check the resolution of the image based on that response?
  • KarelHusa's avatar
    9 years ago

    You can check with a Groovy script test step:

     

    import javax.imageio.*
    
    def image = ImageIO.read('http://YourImageURL'.toURL())
    log.info "Width:"+ image.getWidth()+ " Height:" + image.getHeight()
    
    

    Karel