Topics

How to check if current navigator object is an image?


Shubham Jain
 

My code is as follows:
import api
nav = api.getNavigatorObject()

I then check if nav.role is equal to ROLE_GRAPHIC (from controlTypes.py)  to determine if it is an image or not. But in many instances, images do not have a role of graphic. For example, images opened in the default photo viewer app of Windows 10 have the role ROLE_STATICTEXT while some images in the browser have the role ROLE_LINK or ROLE_DOCUMENT.

Is there a definitive way to determine is a navigator object is an image?


Noelia Ruiz
 

Hi Shubham, imo there is not a definitive way. In fact, the OCR
feature in NVDA can be run regardless of the object role and sometimes
it says that there is not visible content. I think that, if we can be
sure that something is not an image, it may prevent or report it in
certain cases.
Not sure. Looking forward to see more about your work.
Thanks

2020-07-16 9:21 GMT+02:00, Shubham Jain <@ShubhamJain>:

My code is as follows:
import api
nav = api.getNavigatorObject()

I then check if nav.role is equal to ROLE_GRAPHIC (from controlTypes.py )
to determine if it is an image or not. But in many instances, images do not
have a role of graphic. For example, images opened in the default photo
viewer app of Windows 10 have the role ROLE_STATICTEXT while some images in
the browser have the role ROLE_LINK or ROLE_DOCUMENT.

Is there a definitive way to determine is a navigator object is an image?