There are some Jpg images which Delphi doesn\'t seem to like. It appears to be specific with the files I\'m loading. And the procedure is simple - a) load Jpg image to
WIC (available for XP and up) can handle this image. This component is wrapped up nicely in Delphi 2010 and up. For earlier Delphi versions it is easy enough to call WIC using the COM interfaces.
Here's my proof of concept code:
var
Image: TWICImage;
Bitmap: TBitmap;
begin
Image := TWICImage.Create;
Image.LoadFromFile('C:\desktop\ABrownImage.jpg');
Bitmap := TBitmap.Create;
Bitmap.Assign(Image);
Bitmap.SaveToFile('C:\desktop\ABrownImage.bmp');
end;
Note 1: WIC is delivered with Vista but has to be re-distributed for XP. One obvious option would be to use WIC if available, but fall back to the Delphi JPEG decoder otherwise.
Note 2: I can't find a re-distributable package for WIC. I suspect it may require end-user download for XP. That said I would not be at all surprised if the vast majority of XP machines had it installed by now.