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
 Saving a TIEBitmap to a stream in a Thread fails
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Stewart262

United Kingdom
1 Posts

Posted - Jul 14 2020 :  07:06:44  Show Profile  Reply
I'm processing many images in separate threads for speed.

This code fails randomly with 'Cannot create TIECanvas. Ensure GDI+ is installed on system.'

ieBitmap := TIEBitmap.Create;
try
  ieBitmap.Read(paperStream);
  paperStream.Clear;
  iImageEnProc := TImageEnProc.CreateFromBitmap(ieBitmap);
  try
    iImageEnProc.Resample(newWidth, newHeight, rfFastLinear, True);
  finally
    iImageEnProc.Free;
  end;
  iImageEnIO := TImageEnIO.CreateFromBitmap(ieBitmap);
  try
    iImageEnIO.SaveToStreamJpeg(paperStream);
  finally
    iImageEnIO.Free;
  end;
finally
  ieBitmap.Free;
end;

It fails specifically at the line:
iImageEnIO.SaveToStreamJpeg(paperStream);

I've tried writing this just using TIEBitmap but that produces the same error. If I wrap the whole code block in a synchronise procedure it works fine but obviously slow the process making threads redundant.

xequte

38610 Posts

Posted - Jul 15 2020 :  21:00:41  Show Profile  Reply
Hi

What version of ImageEn is this? Are you able to create a small demo that reproduces the issue?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: