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
 Io.LoadFromStream with nongraphic file bug

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
Marius Posted - Aug 07 2018 : 07:39:59
I have the following code which is no longer working after the update to ImageEn 7.5.0, after the AToolbox.Io.LoadFromStream(AStream) (with a non graphic file) the with and the height are alway's 1.

Is this a bug?


AStream.Position := 0;
AToolbox := TImageEnView.Create(nil);
AToolbox.Io.LoadFromStream(AStream);
if AToolbox.IeBitmap.Width + AToolbox.IeBitmap.Height > 0 then begin
...
end;

Thanks,
Marius

Delphi XE
4   L A T E S T    R E P L I E S    (Newest First)
Marius Posted - Aug 09 2018 : 05:52:25
Thank you Nigel,

That indeed solved our problem.

Regards,
Marius
xequte Posted - Aug 09 2018 : 03:19:50
Hi Marius

In 7.5.0 we changed the default of TImageEnView.LegacyBitmap to false, previously it was true. So previously with your code:

AToolbox := TImageEnView.Create(nil);


AToolbox.LegacyBitmap would have been true.


To return to 7.0.* functionality change the code to:

AToolbox := TImageEnView.Create(nil);
AToolbox.LegacyBitmap := true;
...


When LegacyBitmap is enabled, TImageEnView uses a TBitmap to store images instead of a TIEBitmap. TBitmap is not as good with memory handling.

Nigel
Xequte Software
www.imageen.com
Marius Posted - Aug 08 2018 : 03:50:56
We did an upgrade from ImageEN from version 7.0 to 7.5 and then the 1x1 bitmaps weirdness happends.

After searching and comparing ImageEn sources, we might have overlooked the changes with the conditional "LegacyBitmapInTImageEnView", it is mentioned in the "Updating and Compatibility" but its effects are unclear (they are kind of destructive in combination with checking on width and heigth)


Thanks and regards,
Marius
xequte Posted - Aug 07 2018 : 21:17:40
Hi Marius

For legacy reasons are "null" image in a TImageEnView is actually 1x1 pixel. This should be the same in old versions too (unless using a stand-alone TIEBitmap).

Your code will have been affected by the transition from LegacyBitmp = False to LegacyBitmap = True, which may have an effect (though off the top of my head, I can't think why).

Generally to test the success of loading, you should check IO.Aborting, otherwise in this base use a TIEBitmap rather than a TImageEnView, or check > 1x1.



Nigel
Xequte Software
www.imageen.com