TBitmap save image to file with hardcoded DPI - Follow-up
Original Reporter info from Mantis: wp @wpam
-
Reporter name:
Original Reporter info from Mantis: wp @wpam
- Reporter name:
Description:
This is a follow-up of report #0029852 - the bug is resolved, but I think the solution is not useful practically and I cannot add a comment to it because I am not the author.
In #0029852 Aleksey Lagunov reports that the writer of the bitmap file format hardcodes a pixel density of 100x100 into the BitmapInfoHeader - this is way too small because the units are meters here, not inches as was probably assumed.
Marco's solution leaves the value in place, for reasons of backward compatibility. Instead he adds new properties XPelsPerMeter and YPelsPerMeter to the writer. This, however, is without any practical use because the writer is not accessible to the user of a bitmap who calls the method SaveToStream/SaveToFile - the writer cannot be accessed from the outside.
I think that the XPelsPerMeter/YPelsPerMeter must be introduced also to the TCustomBitmap where they are accessible for the user, and the values must be transferred to the corresponding new writer properties before writing.
Ony the other hand I don't quite understand why Marco insists on backward compatibility here. A pixel densitiy of 100 pixels per meter is riduculously wrong, a tiny 16x16 pixel bitmap icon is imported into Microsoft Office as a 6x6 cm monster. I am absolutely sure that nobody ever has done this (except for Aleksey for his fpspreadsheet test in the forum reference cited in the other report), and nobody will complain about broken backward compatibility.
Mantis conversion info:
- Mantis ID: 29865