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
 get file size of an image loaded into TImageEn

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
ameza Posted - Sep 01 2014 : 15:37:47
Is there a property to get file size of an image loaded into TImageEn?
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - May 07 2015 : 18:58:32
Hi

It is not just the image that can take up memory. Some images contain meta data, which can often be huge (I recently saw images with >70MB of meta data).

But with a TImageEnView all memory from the previous image should be cleaned up when loading the next one.

So there may be a memory leak somewhere in the app.

Try monitoring for leaks by enabling ReportMemoryLeaksOnShutdown

Or using a memory tool:

http://stackoverflow.com/questions/416046/what-is-the-best-tool-to-detect-memory-leaks-in-delphi

If you think it is ImageEn related. Create a new demo that reproduces it (ideally without use of a database) and send it to us.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
eramirezgz Posted - May 07 2015 : 15:31:03
I agree with you about using TaskManager, that's the reason I want to check the memory required in the control.

this is the actual code:

oImagenStream := CreateBlobStream( FieldByName( sField ), bmRead );
oImageEnView.IO.LoadFromStream( oImagenStream );
FreeAndNil( oImagenStream );

debugging the code, before it gets to LoadFromStream() my app it's 27.1MB, exactly after this statement it gets up to 41.1MB and when the application processed 300+ images ends using 1.8GB

NOTE: The component it's added at desing time, but i already tried creating and destroying the control in the method and got the same result.
w2m Posted - May 07 2015 : 14:27:00
You should not have to free TImageEnView unless you create it at run time. When you free TImageEnView it also frees the memory in the bitmap.

If TImageEnView is added to a form at design time when you close the form, TImageEnView and any bitmap it holds is released. I do not see why you want to free it. Please explain how you are using the component. If it is created in the IDE at design time then you just open an image at runtime there is no need to free.

Using the TaskManager to monitor memory does not work very well. The memory in the TaskManager is for the whole application, all its its forms and all its components... not just the image in memory.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
eramirezgz Posted - May 07 2015 : 13:29:00
Hi, I found this question without an answer. I need to know the size in memory of the image.

I'm using a TImageEnView component to retrieve images from a database and when I load it, my application increases memory in 12MB (According to Task Manager).

Once loaded, I check the Bitmap width and height of the image and is: 1920 x 2560 = 4.69MB, I suppose this should be more or less the maximum memory it requires.

After I process the image i tried to release this memory, but haven't found the right command to do it (I tried with bitmap.freeimage, image.Clear, image.Free), actually bitmap.freeimage increases memory...

NOTE: I'm using ImageEn 5.1
xequte Posted - Sep 02 2014 : 23:10:49
Hi

Do you mean the size on disk or the size of the image in memory?


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com