Welcome! Log In Create A New Profile

Advanced

Image bloat in mysql medium blob column

Posted by mixgh 
Image bloat in mysql medium blob column
January 18, 2024 03:21AM
Hi,

I've been loading pictures into MySQL 5.6 database for years ans recently realized that loading a 60k image ends up being stored as 600k in the database and when I extract the image, it comes out as 600k. My method required loading the image into an image control linked to file and then using hAdd or hModify. I've experimented and realized that if I use hLinkMemo, I get the proper size being loaded. Does this mean the image control modifies the image in some way before saving it? Any ideas on whats taking place in the background?

Thanks and regards

issah
Argus
Re: Image bloat in mysql medium blob column
January 18, 2024 08:08AM
when you are loading an image file in an image control, the content is modified to FIT the control...

So if your image control is 800*600, you get an image containing 480000 pixels, EVEN if your original image was 400*300...

So saving that directly to a file will change the content, yes

On top of that (but I haven't tested that part), the image control itself is probably considered RAW format in your case, so even if you reiszed the control to the corrct size for your image before loading the image file in it, it would STILL probably be much bigger with your method, as there is no INPLIED dsauveimagejpg with a percentage of compression.
Re: Image bloat in mysql medium blob column
January 20, 2024 07:30PM
Hi Argus,

Thanks. This is new to me though when I realized this, I suspected the image control was doing some shenanigans behind the scenes. Using hLinkMemo all the way now.

issah
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: