When you load a JPEG image in Delphi (both VCL and FMX), the image might appear rotated or even mirrored. This is often the case, when the image is a photo taken with a smartphone in portrait mode.
The reason is that the JPEG contains an additional "Exif" header, which specifies the orientation of the image. In order to display the image correctly, you must read the Exif header and rotate, flip or mirror the image after loading, according to the orientation information in the Exif header.
This small unit does it for you: it is the smallest and fastest JPEG Exif reader currently available for Delphi and automatically applies the necessary transformations to a TBitmap object after loading.
Useage:
procedure JPEGLoadBitmap(ABitmap: TBitmap; AFileName: String); overload;
procedure JPEGLoadBitmap(ABitmap: TBitmap; AStream: TStream); overload;
Features
- JPEG loader honoring Exif information