Memory usage of CreateThumbnailHQ method

Discussions about image processing and document imaging.
Post Reply
MarkoZ
Posts: 19
Joined: Tue Jun 29, 2010 9:30 am

Memory usage of CreateThumbnailHQ method

Post by MarkoZ » Wed Apr 01, 2015 2:33 pm

Hi,

I've recently upgraded one of our scanning applications from GDPicture8 to GDPicture11. When testing it's performance I've noticed extremely high memory consumption when converting color images to thumbnails. We're scanning in 200 DPI. Our code has not changed in any way, we just changed reference to GdPicture dll and fixed namespaces. This is the code we're using to generate thumbnails.

Code: Select all

int tiffID = gdImaging.CreateGdPictureImageFromFile(path);
                if (tiffID == 0)
                {
                    return null;
                }

                int ThumbnailID = gdImaging.CreateThumbnailHQ(tiffID, thumbWi, thumbHi, Ozadje);

                Bitmap thumb = null;
                if (ThumbnailID != 0)
                {
                    thumb = new Bitmap(gdImaging.GetBitmapFromGdPictureImage(ThumbnailID));
                    //thumb.Save(@"c:\test\test.bmp");

                    gdImaging.ReleaseGdPictureImage(ThumbnailID);
                }

                gdImaging.ReleaseGdPictureImage(tiffID);
                return thumb;

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Memory usage of CreateThumbnailHQ method

Post by Loïc » Wed Apr 01, 2015 3:00 pm

Hi,

Could you give precision about what you meant by "extremely high memory consumption ".

Which are the values used for thumbWi & thumbHi?

Regards,

Loïc

MarkoZ
Posts: 19
Joined: Tue Jun 29, 2010 9:30 am

Re: Memory usage of CreateThumbnailHQ method

Post by MarkoZ » Thu Apr 02, 2015 8:45 am

On average memory usage increases by 15MB on each CreateThumbnailHQ call. Thumbnail size is 150x150.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Memory usage of CreateThumbnailHQ method

Post by Loïc » Thu Apr 02, 2015 3:59 pm

OK. We've just published a new minor release improving memory usage. Could you try with it?

See: viewtopic.php?t=4810

With best regards,

Loïc

MarkoZ
Posts: 19
Joined: Tue Jun 29, 2010 9:30 am

Re: Memory usage of CreateThumbnailHQ method

Post by MarkoZ » Fri Apr 03, 2015 10:18 am

It works much better now, thanks for quick response.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests