procedure TForm23.Button1Click(Sender: TObject);
begin
with TIEMultiBitmap.Create do
try
if not Read('TEST.JPG') then
ShowMessage('Error')
else
ShowMessage('ok');
finally
free
end;
end;
Regards!
10 L A T E S T R E P L I E S (Newest First)
xequte
Posted - Dec 15 2024 : 22:56:41 Yes, this works fine in our testing. I cannot explain the reason for the behavior on your side.
procedure TForm1.Button1Click(Sender: TObject);
var
mbmp : TIEMultiBitmap;
begin
mbmp := TIEMultiBitmap.Create;
try
if not mbmp.read( 'D:\TEST.PNG' ) then
ShowMessage('Error')
else
ShowMessage('ok');
ImageEnMView1.AssignEx( mbmp );
finally
mbmp.Free
end;
end;
Posted - Dec 10 2024 : 06:35:45 Read( 'D:\TEST.JPG', nil, True ) works. But renaming to PNG does not work.
xequte
Posted - Dec 09 2024 : 23:15:46 Hi Dany
Did you enable the bCheckUnknown parameter?
This works fine for me:
with TIEMultiBitmap.Create do
try
if not Read( 'D:\TEST.JPG', nil, True ) then
ShowMessage('Error')
else
ShowMessage('ok');
finally
free
end;
This also works fine (note: extension needs to be "PNG"):
RenameFile( 'D:\TEST.JPG', 'D:\TEST.PNG' );
with TIEMultiBitmap.Create do
try
if not Read( 'D:\TEST.PNG' ) then
ShowMessage('Error')
else
ShowMessage('ok');
finally
free
end;
Posted - Dec 09 2024 : 19:24:19 Hi Nigel; Before asking, I already saw the file at low level founding that it say is PGN; so before asking I changed the extension to PGN, but TIEMultiBitmap can't load it. I also see that the old and well known :) MS-Paint can load it.
xequte
Posted - Dec 09 2024 : 16:21:40 Hi Dany
Any time you find an image that does not load (in ImageEn or elsewhere), examine it in a hex or text editor and look at the magic string. You will see that this one, despite having the extension .JPG is actually a PNG file.
To make TIEMultiBitmap load images even if they have the incorrect file extension, you need to enable the bCheckUnknown parameter for Read/LoadFromFile()