Converting some bitmaps fail with a truncation error. This change allows to successfully convert the bitmap files. Fixes #5400. Cherry-pick of #5401. (cherry picked from commit f519c244)