crash on apply_matrix, QImage out of rang, and image lost quality after scaling