Query Format of Image Uniforms?


Suppose I have an image uniform declared in my shader:

 layout(R32I) uniform iimage2D myImage;  

Is it possible to query the format of this uniform? In other words, before setting the value of this uniform, I want to know the format specified, in this case R32I.

I know it is possible to query the format of an image unit after it has a texture bound to it. But this does not help me. My goal is to prevent mismatch between the uniform format specified in my shader and the texture bound to the image unit.