![]() |
Programming Question
A worker of mine has uploaded X amount of pics that are too big for normal web viewing. I asked my programmer make them smaller.
He says he can't due to "The data stored on the database are binary and cannot be resize." Is this true? |
|
never heard something like that
|
Nothing I can do with it, its stored in binary you cannot resize it. That is
the actual binary data of the image. The image is too big. |
my question would be can you get the "blob" out of the database?
blob stands for binary large object ... the only way i can see that as true is if the data is so large it became corrupt on the way in (meaning the photos too large to be stored) which i highly doubt. |
If you can get get the blob out ... you can use database calls to get data out ... then use GD to resize and then save back to the database.
|
Quote:
but from my experience, I would also have to say he should probably take those images out of db and just make a reference to them instead, makes more sense to me anyways.... |
The images are fucking 18 MB in size. So they may be too big to BLOB?
|
MySQL supports BLOBs (Binary Large Objects), which means you can store any binary file into MySQL. Many people ask, what is the maximum size of a BLOB in MySQL.
The theoretical limit in MySQL 4.0 is 2G, however each blob requires generally to have 3 copies of it in the memory (stored in various buffers) so you need a lot of memory, if you have large BLOBs stored in MySQL. This is the reason, why the theoretical limit can be reached only on 64bit systems. The Practical limits are around some hundreds of megs per BLOB. |
Quote:
|
Quote:
|
Quote:
so in answer to your original question ... your guy is blowing smoke up your ass. |
You should just make references to the images in the db not store them in there. As mentioned..
You might look into creating a solution with http://www.php.net/manual/en/functio...fromstring.php then using gdlib to resize it and save. |
If he's lazy tell him to mod and try this..
Code:
$desired_width = 500; |
giving away the farm ... ;-)
|
First, your programmer is an idiot for storing an image in MySQL, second, like said already, it can be done, your programmer is not only an idiot, but lazy.
If you want to tell him to eat shit and die, my contact info is in my sig, I can not only take all the images out of your database, resize them all to what you want, and restore the LOCATION in the database, and edit the script itself to upload the image to your server and input the LOCATION in the database. |
Yes that's true. But I believe there's a way to view pics in a normal web view.
|
Did I mention I'm looking for work ...
|
If you have the photo files in a single directory, you can batch resize using photoshop and they will stay where they are with the same names: just be smaller.
|
Anyhting is possible. Your programmer is lazy! Put more pressure on him. A skilled programmer can accomplish anything with the right logic. [Ive got an office full of programmers- let me know if you need anything]
Look me up on AdultLinkExchange.com |
I'm copying and pasting your comments and then e mailing them to him. Will give you guys his answer.
|
Quote:
|
I gave you the method and code snippets lol he should have it done in 10 minutes.
|
Quote:
|
Also, the programmer can create a utlity to resize the image. If he can't do that then he must not be a good programmer.
|
Quote:
|
This might get interesting.
"Those guys are bullshit!!! Of course the image are stored in BLOB, how can you store in db if it is not in a BLOB format???? The problem is not the DB etc etc. I'm just telling you that the image are too big. The image size I think is > 3MB. I will try if I can resize it. " |
Quote:
// do some nifty for loop or while loop, doesn't matter... // inside that, use the gd library to resize on the fly // then update big_table_of_images set `content` = $new_size where `id` ='$row['id'].'; not too hard, maybe 10 minutes worth of work. but i'll say again, you will be able to scale much better if you keep it out of db and simply reference it... goodluck :thumbsup:thumbsup |
Quote:
Fire your programmer, he's worthless. |
The problem is probably that the images are too big, php runs out of memory and/or times out, and is unable to process them... with default php settings you won't be able to process 18 MB images with gd/php... :2 cents:
|
INSERT INTO programmer_got_fucked SET message='First, your programmer is an idiot for storing an image in MySQL, second, like said already, it can be done, your programmer is not only an idiot, but lazy. If you want to tell him to eat shit and die, my contact info is in my sig, I can not only take all the images out of your database, resize them all to what you want, and restore the LOCATION in the database, and edit the script itself to upload the image to your server and input the LOCATION in the database.', date=NOW()
:thumbsup |
Quote:
|
All times are GMT -7. The time now is 09:14 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123