Error with Jpeg image
I am using RB 6.03 and D6/win2000.
I have a TppImage in my report and I have a table with jpeg images.
I configured TppImage to JPEG and I include ppJPEG in the uses clause.
When I start to print the report, it works well untill it finds a corrupt
Jpeg image. In this moment it aborts with a error message 'Invalid Image'
and nothing is printed.
How do I can rid of this message so as RB ignore this corrupt image and
continues to print?
I think the correct is ignore a corrupt image instead of abort the report
with a error message.
Thanks in advance,
Luiz.
I have a TppImage in my report and I have a table with jpeg images.
I configured TppImage to JPEG and I include ppJPEG in the uses clause.
When I start to print the report, it works well untill it finds a corrupt
Jpeg image. In this moment it aborts with a error message 'Invalid Image'
and nothing is printed.
How do I can rid of this message so as RB ignore this corrupt image and
continues to print?
I think the correct is ignore a corrupt image instead of abort the report
with a error message.
Thanks in advance,
Luiz.
This discussion has been closed.
Comments
when an exception is rasied.
try
ppImage1.Picture.LoadFromFile(plReportData['ImagePath']);
except
on EFOpenError do
ppImage1.Picture.LoadFromFile('C:\Program
Files\myApplication\Data\NoImage.jpg');
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
imagepath from the db, not the blob, sorry. So, you can still place a try
accept to catch the exception. Don't use a TppDBImage, and use the
datapipeline to get the blob image, and then assign it to a TppImage in
code.
plJPEG is my datapipeline and JPEGImage is my field name for the blob:
DetailBand.BeforePrint:
try
ppImage1.Picture.Graphic.Assign(plJPEG.GetFieldAsPicture('JPEGImage'));
except
on EFOpenError do
ppImage1.Picture.LoadFromFile('C:\error.jpg');
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com