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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Saving a TIEBitmap to a stream in a Thread fails

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Stewart262 Posted - Jul 14 2020 : 07:06:44
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.

1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 15 2020 : 21:00:41
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