Discussion Locked

Compressing Images

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello,

Anyone know how to compress the images(in asp.net) which is uploaded in sql server database so that I need not worry about the disk space?I don't know :-??

If anybody is having any idea then please do share your knowledge.
I would really appreciate if someone provide code for it.
Its very urgent for me.
Waiting for your valuable suggestion :-w

Thanks

9 replies

by darknessandhope

First of all why are you interested in compressing an image? Is it because you need to present it in different sizes?

And how about accessing the image? Will it be frequently accessed or just from time to time?

I think you know that sometimes you won't get much benefits from compressing image formats that are originally compressed by nature like .jpg or .gif

by preethiraajesh

hello,

There may be billions of files(pdf or tiff format) that has to be stored in database table/ server folder. So in order to save space I need it.
File has to be uploaded day to day basis. Whenever required it has to be retrieved.
Do you know any other way other than compressing, in my opinion compressing is the only way.

Expecting your immediate response.

Thanks
Preethi

by onbliss

...offers [b]System.IO.Compression[/b] namespace that provides methods to [b]compress and decompress streams[/b]. So you would read your images/pdfs as streams, then compress them using the methods, and then write them to a BLOB field in SQL Server.

Personally, I have not yet used the namespace yet. So my information is based on the MSDN help. But, I am positive that some of the third party tools are better at the compression and there might be some limitations in the .Net compression namespace. You need to check them out.

good luck!!!

by darknessandhope

Preethi,

As onbliss posted there is System.IO.Compression namespace on .NET 2.0, but i recommend you to search also on www.codeproject.com, there are some free solutions and probably you'll find one there that does exactly what you need it to do, you just need to waste some time looking around...

If you're working with large tiff and pdf files i can only advise you to use a server folder rather than upload the files to the database, since reading and writing those files into a table may cause an huge overhead on a sql server database.

Good luck!

by preethiraajesh

hello,
Preethi here, I'm still working on that; now I'm studying various algorithms for the compression.

If I get a solution I'll definetly post it.
I think I'll master in image manipulations

Thanks

by onbliss

Actually I was thinking about the same thing - storing of the files. Was storing the files in SQL Server a better option than storing them just on a folder? Having them in SQL database adds a layer of complexity, but makes the files little more "available" to other applications in an enterprise. Don't you think so?

This discussion is closed to new replies.