Libjasper version mismatch?

The file /usr/include/jasper/jas_config.h has #define JAS_VERSION "4.0.0". However the library major version is 7:

ls /lib64/libjasper*      
/lib64/libjasper.so  /lib64/libjasper.so.7  /lib64/libjasper.so.7.0.0

Is this a packaging mistake or there is some logic behind it?

No.

I’m sure there is, but I’m not sure of the reason.