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

Posted on 2012-03-16
Last Modified: 2012-03-18
I can load a 72dpi jpeg file into TImage using  


but not a 96dpi jpeg file.

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

      jpeg:= TJpegImage.Create;
      Image.Picture.Graphic := jpeg;

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

I use Delphi XE. Thanks
Question by:Dennis_Treacy
LVL 26

Expert Comment

by:Sinisa Vuk
ID: 37729035
LVL 37

Expert Comment

by:Geert Gruwez
ID: 37729246
or attach the jpeg so we can do some troubleshooting

Author Comment

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


Google search indicates #53 may be a memory issue - not much help really.
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 37732416
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.

Author Comment

ID: 37733821
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?

Author Comment

ID: 37733826
File attached
LVL 22

Accepted Solution

Ferruccio Accalai earned 500 total points
ID: 37734224
Well, that's a PNG file renamed to JPG. In fact also Photoshop CS have matters trying to open it. It says "Invalid JPEG marker type is found". Reading the header of the file you can see a PNG marker. That's why the TImage.Picture fails loading it as a JPEG.

Author Closing Comment

ID: 37734284
Many thanks.

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Sending a Secure fax is easy with eFax Corporate ( First, just open a new email message. In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now