3
votes

I'm trying to load a jpg file which is 604KB big into a TImage component on a vanilla TForm but the load causes it to fail with an access violation:

Access violation at address 402372AD in module vcljpg60.bpl. Write of address 0904000

I just tried it in Delphi 7 and the same is true except the vcl is 70 instead of 60 and the address is slightly different

Does anyone know of a bug in Delphi around jpg files?

Many thanks for any input on this cheers Colin

1
If I'm not wrong, JPG is exploded as bitmap before beeing loaded into TImage: do you have enough memory? Did you reference JPEGxxx class (I don't remeber corrent name) to use JPG files?Marco
please can you read the faq and learn how to accept answersDavid Heffernan
Are you sure the JPG itself is not corrupted? Try opening it with Paint and saving it again (make sure you change something).Cosmin Prund
@David, "TImage design time load" probably means he's clicking on the ... button in Object Inspector and selecting a JPG file to load.Cosmin Prund
@Cosmin Yes, I missed "design time"David Heffernan

1 Answers

4
votes

maybe you problem is due to the colorspace of your JPEG file. Delphi has issues displaying JPEG images that have been encoded using CMYK instead of RGBencoding.

Check this Enhanced JPEG implementation which fix the problem with the CMYK colorspace. also you can check this similar question Problem with showing some JPG files in Delphi.