Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am storing image in database . It store as binary data in database. My database become heavy as i store it directly.
Help me what to do to reduce database.
I don't want to save image in folder.
Posted

You may save space just if images aren't already compressed (for instance, JPEG images are already compressed). If it is your case then System.IO.Compression[^] namespace is your friend.
 
Share this answer
 
Probably, you can't - not without losing detail or reducing the image size. Most images formats are already compressed using either a lossy or non-lossy compression technique, and it's hard (or even impossible) to compress the data further without changing the size or throwing away data - certainly there is no generic "this works for all images" solution. Compressing images may even make them larger as it adds a small amount of decompression overhead!

I'd strongly suggest that you don't store images in your DB - a folder is a much better solution in most cases, even if you don't want to do that!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900