ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 ImageEn LoadFromURL
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

LHSoft

Germany
3 Posts

Posted - Jun 14 2013 :  01:00:53  Show Profile  Reply
Hello,

I have a liitle problem occuring since version 4.1 or so regarding LoadFromURL:
This is my code:

procedure TPicImport.EditChange(Sender: TObject);
begin
ImageENView.Clear;
ImageENView.ResetState;
ImageEnView.IO.LoadFromURL('http://' + main.Host + '/OLS/Images/' + Edit.Text + '.jpg');
if ImageENView.IO.Params.Height < 10 then exit; //if file does not exist
ImageEnView.Proc.Resample(ImageEnView.Width, ImageENView.Height, rfLanczos3, True);
end;

This worked fine in the past, but since one of the newer versions 4.1xx I only get a small area in the upper left corner filled with part of the pic. Now I must repeat loading after the exit-condition to get it work, what means doing LoadFromURL twice.
The edit is an TEdit to enter some numbers and when you type an number and the pic f.x. 123.jpg exists the pic is shown after running two times with the exit-condition (1.jpg and 12.jpg do not exist, 123.jpg does).

So my question: What has changed and what I do have to change so this will work again?

Best regards
Hans

fab

1310 Posts

Posted - Jun 15 2013 :  06:50:07  Show Profile  Reply
Hello,
you should check LoadFromURL successful using Aborting property. For example:

ImageEnView1.IO.LoadFromURL('http://www.xequte.com/ImageEnForum/images/logo_forum.gif');
if ImageEnView1.IO.Aborting then
  ShowMessage('not found');
Go to Top of Page

LHSoft

Germany
3 Posts

Posted - Jun 15 2013 :  14:31:45  Show Profile  Reply
Hello fab,

thanks for the tipp "aborting".

But the problem isn't solved.
It seems, that ImageENView.LoadFromURL has problems with new picture if there was an aborting before.
So, still I have to repeat the LoadFromURL to get picture like

begin
 ImageENView.Clear;
 ImageENView.ResetState;
 ImageEnView.IO.LoadFromURL('http://' + main.Host + '/OLS/Images/' + Edit.Text + '.jpg');
 if ImageENView.IO.aborting then exit;
 ImageEnView.IO.LoadFromURL('http://' + main.Host + '/OLS/Images/' + Edit.Text + '.jpg');
 ImageEnView.Proc.Resample(ImageEnView.Width, ImageENView.Height, rfLanczos3, True);
end;

This need to repeat the LoadFromURL-command appeared in one of the 4.xx Version.

best regards
Hans
Go to Top of Page

fab

1310 Posts

Posted - Jun 15 2013 :  15:23:21  Show Profile  Reply
Hello,
it seems a bug (Aborting is not reset before LoadFromURL). Please try:

begin
 ImageEnView.IO.Aborting := false;   // <--- added
 ImageEnView.IO.LoadFromURL('http://' + main.Host + '/OLS/Images/' + Edit.Text + '.jpg');
 if ImageENView.IO.aborting then exit;
 ImageEnView.Proc.Resample(ImageEnView.Width, ImageENView.Height, rfLanczos3, True);
end;
Go to Top of Page

LHSoft

Germany
3 Posts

Posted - Jun 15 2013 :  15:41:50  Show Profile  Reply
Many thanks, thats it.
now it works.

best regards
Hans
Go to Top of Page

fab

1310 Posts

Posted - Jun 15 2013 :  23:28:28  Show Profile  Reply
Thank you, it will be fixed in next minor release.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: