LEADTOOLS Support
General
General Questions
Re: Saving my images in MS SQL database
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, July 19, 2010 6:59:10 AM(UTC)
Groups: Registered
Posts: 2
I've been using LEADTools for a several months to process and manipulate images in disk files in my in-house application. It's a store inventory program written in C# and everything is great. But now I need to modify my app to store images in a database.
I'm using SQL Server 2008 R2 and I'm thinking of using blob field such as FILESTREAM. I'm going to do my own research but wanted any useful hints about the LEAD TOOLS side when saving the images before I store them into the database.
Thanks,
Sunn
#2
Posted
:
Thursday, July 22, 2010 6:06:25 PM(UTC)
Groups: Tech Support
Posts: 366
Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
As a general hint, always use compression when saving images, especially if you're going to store them inside the database table itself. Our toolkit provides plenty of compression options. Some are more suited to black and white images, such as JBIG2 and LEAD ABC, while others are better for color images like JPEG2000.
From the perspective of using LEADTOOLS .NET classes, there won't be much difference between saving to disk and saving to database. Our RasterCodecs.Save() functions have overloads that take string file name and other overloads that take standard .NET Stream objects.
For example, if your current code uses this overload:
Save(RasterImage image, string fileName, RasterImageFormat format, int bitsPerPixel) You can simply use the following overload to save to stream, then store the stream into the database like you do with any binary data:
Save(RasterImage image, Stream stream, RasterImageFormat format, int bitsPerPixel)Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
LEADTOOLS Support
General
General Questions
Re: Saving my images in MS SQL database
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.