Board index » delphi » How to Trap a JPEG #67 (incomplete JPEG) error

How to Trap a JPEG #67 (incomplete JPEG) error

The delphi JPEG unit raises a 'JPEG Error #67' whenever an incomplete JPEG
is displayed.  

However there seems to be no way i can trap this error and deal with it
myself (at the very least display a more useful message).  Even wrapping
the load in a try except block does not work because it is completely dealt
with my the jpeg unit and the except block is not entered.

Anyone any the wiser?

Thanks

William
NO_SPAM.the_white_ho...@usa.net
(Remove NO_SPAM from my address when e-mailing)

 

Re:How to Trap a JPEG #67 (incomplete JPEG) error


Image1.picture.loadfromfile(FileName);
if Image1.picture.graphic is TJpegImage then begin
    try
      TJPEGImage(Image1.picture.graphic).dibneeded;
    except
      on E:Exception do
        if (E.message='JPEG error #67') then begin
            showmessage('Incomplete JPEG')
        end;
    end;
end;

Re:How to Trap a JPEG #67 (incomplete JPEG) error


Thanks i'll give it a try

Robert <.> wrote in article <756krm$p3...@forums.borland.com>...

Quote
> Image1.picture.loadfromfile(FileName);
> if Image1.picture.graphic is TJpegImage then begin
>     try
>       TJPEGImage(Image1.picture.graphic).dibneeded;
>     except
>       on E:Exception do
>         if (E.message='JPEG error #67') then begin
>             showmessage('Incomplete JPEG')
>         end;
>     end;
> end;

Other Threads