Avatar of Dennis_Treacy
Dennis_Treacy
Flag for Australia asked on

Delphi - Error when loading 96dpi jpeg file into Image.Picture

I can load a 72dpi jpeg file into TImage using  

Image.Picture.LoadFromFile(FileName);

but not a 96dpi jpeg file.

If I change the code to the following, I get the same result  

      jpeg:= TJpegImage.Create;
      jpeg.LoadFromFile(filename);
      Image.Picture.Graphic := jpeg;

What changes do I need to make for 96 dpi images?

I use Delphi XE. Thanks
Delphi

Avatar of undefined
Last Comment
Dennis_Treacy

8/22/2022 - Mon
Sinisa Vuk

Geert G

or attach the jpeg so we can do some troubleshooting
Dennis_Treacy

ASKER
I have attached one of the offending jpeg files. An exception error, JPEG Error #53, occurs at

    jpeg.LoadFromFile(filename);

Google search indicates #53 may be a memory issue - not much help really.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Ferruccio Accalai

I can't see any attached file here.
Anyway #53 usually means that the jpeg file is corrupted. Have you downloaded it from internet? If so it could be not 100% downloaded, so there's not a correct file end that generates the out of memory error on reading it.

Someone tells that he solved this issue using TADVPicture from TMS Software (I don't have it installed, so I don't know if it's true).

Try reopening the file in Photoshop or some other Image tool and re-save it, Or if you have downloaded it just try downloading it again.
Dennis_Treacy

ASKER
The file was emailed to me by a client (student photos from a school). I can load them into Excel so I don't believe they are corrupted. Once I submit this comment I will try attaching again. Having some trouble doing that - getting a request for file description?
Dennis_Treacy

ASKER
File attached
ABB0054.jpg
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Ferruccio Accalai

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dennis_Treacy

ASKER
Many thanks.