The JPE extension is not registered by the Delphi JPEG code. Hence the error. Since you know the image type you can load it directly into a TJPEGImage object:
Image := TJPEGImage.Create;
Image.LoadFromFile(...);
And the assign to the picture control.
ThisPicture.Assign(Image);
Or the simpler solution of registering the JPE extension so that TPicture
associates it with TJPEGImage
. This can be done using TPicture.RegisterFileFormat
:
uses
Vcl.Imaging.JConsts, Vcl.Imaging.jpeg;
....
TPicture.RegisterFileFormat('jpe', sJPEGImageFile, TJPEGImage);
TPicture.RegisterFileFormat('jif', sJPEGImageFile, TJPEGImage);
TPicture.RegisterFileFormat('jfif', sJPEGImageFile, TJPEGImage);
TPicture.RegisterFileFormat('jfi', sJPEGImageFile, TJPEGImage);
For what it is worth, the documentation of RegisterFileFormat
contains this rather quaint line:
The AExtension parameter specifies the three-character system file extension to associate with the graphic class (for example, "bmp" is associated with TBitmap).
Don't worry about the suggestion that extensions have to be exactly three characters in length. That is simply a documentation error.