Passing unrecognized formats to gdImageGd2 results in corrupted files
The code to write GD2 images checks for unrecognized fmts and adjusts them to reasonable values. However, for truecolor images the then correct value would be further increased by 2, resulting in an incorrect format being written to the file header.