Calculate resolution_scale

fix #58