fix bitmap decoder with more efficent way