Board index » delphi » Valid JPEG image

Valid JPEG image


2006-07-06 10:49:55 PM
delphi264
I have a program which includes adding images to certain records using the
TOpenPictureDialog box.
However, a client has has a problem and when I have tried to import his
image with the program running from the IDE, I get an error message 'project
raised exception class EJPEG with message 'JPEG error #53'. Process
stopped.' simply by highlighting the file in theOpenPictureDialog box.
I have then tried to open the image in Paint Shop Pro and got a 'This is not
a valid JPEG-JFIF file' error. However, the file opens OK in IrfanView and
in Internet Explorer.
Apparently this image came straight out of his camera.
The problem is that I don't know enough about image formats to know where
the error lies. Can anyone suggest how I might tackle this?
Thanks.
 
 

Re:Valid JPEG image

Tim writes:
[]
Quote
However, a client has has a problem and when I have tried to import
his image with the program running from the IDE, I get an error
message 'project raised exception class EJPEG with message 'JPEG
error #53'. Process stopped.' simply by highlighting the file in
theOpenPictureDialog box.
[]
Thanks.
See:
homepages.borland.com/efg2lab/Library/Delphi/Graphics/JpegErrors.txt
It may tell you what the error means, although quite how to find where
it's happening may be another issue althogether.
David
 

Re:Valid JPEG image

"Tim" <XXXX@XXXXX.COM>skrev i en meddelelse
Quote
I have then tried to open the image in Paint Shop Pro and got a 'This is
not
a valid JPEG-JFIF file' error. However, the file opens OK in IrfanView and
in Internet Explorer.
That might indicate that the jpeg is corrupt in some way.
Can you put it in b.p.attachments for us to see?
--
Finn Tolderlund
www.tolderlund.eu/delphi/
 

Re:Valid JPEG image

"Tim" <XXXX@XXXXX.COM>writes
Quote
I have a program which includes adding images to certain records using the
TOpenPictureDialog box.

However, a client has has a problem and when I have tried to import his
image with the program running from the IDE, I get an error message
'project
raised exception class EJPEG with message 'JPEG error #53'. Process
stopped.' simply by highlighting the file in theOpenPictureDialog box.

I have then tried to open the image in Paint Shop Pro and got a 'This is
not
a valid JPEG-JFIF file' error. However, the file opens OK in IrfanView and
in Internet Explorer.

Apparently this image came straight out of his camera.

The problem is that I don't know enough about image formats to know where
the error lies. Can anyone suggest how I might tackle this?

Thanks.
When you open the image in Irfanview, have you looked at the
properties/image information about it? We had a problem once where we had a
CMYK-encoded JPEG, and the native jpeg.pas unit doesn't handle that. There's
a revised jpeg.pas unit on the CodeCentral site that _does_ work, and I
needed that to work with the CMYK JPEG. Our source wasn't a camera, though.
Does it only happen with images from his camera? Does it happen with all
images from his camera? If not, sound like you have a bad JPEG that some
programs can cope with better than others. If all images from his camera are
problematic, then try and figure out what the image properties are and see
whether your JPEG handling components/code are capable of that format.
 

Re:Valid JPEG image

Thanks for the comments. Without going to the site to see for myself where
the images come from, I am going to assume that the problem images did not
come his camera since someone else has taken some photos and they load fine.
I will, however, look at the revised jpeg.pas unit and see if that works.
However, if I can be sure that it was an image from a one off source and was
corrupt in some way, then I will leave it at that.
Tim
 

Re:Valid JPEG image

Quote
I will, however, look at the revised jpeg.pas unit and see if that
works. However, if I can be sure that it was an image from a one off
source and was corrupt in some way, then I will leave it at that.
Can any one share the link to this updated version of jpeg.pas?
I found one related (?) file at CodeCentral,
"19723_enhanced_jpeg_implementation.ZIP", but it only contained .dcu
files, no .pas files :|
Is this the correct one to use?
Thanks,
Mikael
 

Re:Valid JPEG image

Mikael,
If you look in the zip file, there is a test.exe. I have just tried using it
to load the image that was causing me a problem and it comes up with an
error, so assuming that you were interested in it for the same reason as me,
then don't bother!
Tim
"Mikael Stalvik" <XXXX@XXXXX.COM>writes
Quote
>I will, however, look at the revised jpeg.pas unit and see if that
>works. However, if I can be sure that it was an image from a one off
>source and was corrupt in some way, then I will leave it at that.

Can any one share the link to this updated version of jpeg.pas?
I found one related (?) file at CodeCentral,
"19723_enhanced_jpeg_implementation.ZIP", but it only contained .dcu
files, no .pas files :|

Is this the correct one to use?

Thanks,
Mikael
 

Re:Valid JPEG image

Thanks for the tip Tim.
Strange though, the test application works fine for me :)
Regards,
Mikael
Quote
If you look in the zip file, there is a test.exe. I have just tried
using it to load the image that was causing me a problem and it comes
up with an error, so assuming that you were interested in it for the
same reason as me, then don't bother!