![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Too lazy to set a custom title
Join Date: Dec 2001
Location: Charlotte, NC
Posts: 14,137
|
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? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
So Fucking Banned
Join Date: Aug 2003
Location: ICQ #23642053
Posts: 19,593
|
Firstly, his english sux. Secondly:
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Jun 2001
Location: Closer than you think
Posts: 9,535
|
never heard something like that
__________________
Need Mainstream Content and SEO? SEO * Website Copy * Blogs Blogging - PR Work - Forum Marketing - Social Marketing - Link building - Articles 100% Guaranteed Content! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Too lazy to set a custom title
Join Date: Dec 2001
Location: Charlotte, NC
Posts: 14,137
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Registered User
Join Date: Feb 2004
Posts: 93
|
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.
__________________
Programmer looking for work you can hit me here -> Master Web Monkey or ICQ 281945544 PHP mySQL Flash ActionScript3 html javascitpt PERL::MECINIZE expect NATS MPA3 Responsys Interact |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Registered User
Join Date: Feb 2004
Posts: 93
|
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.
__________________
Programmer looking for work you can hit me here -> Master Web Monkey or ICQ 281945544 PHP mySQL Flash ActionScript3 html javascitpt PERL::MECINIZE expect NATS MPA3 Responsys Interact |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
|
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....
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Too lazy to set a custom title
Join Date: Dec 2001
Location: Charlotte, NC
Posts: 14,137
|
The images are fucking 18 MB in size. So they may be too big to BLOB?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Registered User
Join Date: Feb 2004
Posts: 93
|
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.
__________________
Programmer looking for work you can hit me here -> Master Web Monkey or ICQ 281945544 PHP mySQL Flash ActionScript3 html javascitpt PERL::MECINIZE expect NATS MPA3 Responsys Interact |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Too lazy to set a custom title
Join Date: Dec 2001
Location: Charlotte, NC
Posts: 14,137
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Registered User
Join Date: Feb 2004
Posts: 93
|
I would agree ... use the web server to serve files ... use the database to serve data by that I mean text... it will scale better in the long run
__________________
Programmer looking for work you can hit me here -> Master Web Monkey or ICQ 281945544 PHP mySQL Flash ActionScript3 html javascitpt PERL::MECINIZE expect NATS MPA3 Responsys Interact |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Registered User
Join Date: Feb 2004
Posts: 93
|
"blobs can be hundreds of megs" was the answer ... so while big 18 megs is not bigger than the field size.
so in answer to your original question ... your guy is blowing smoke up your ass.
__________________
Programmer looking for work you can hit me here -> Master Web Monkey or ICQ 281945544 PHP mySQL Flash ActionScript3 html javascitpt PERL::MECINIZE expect NATS MPA3 Responsys Interact |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Confirmed User
Industry Role:
Join Date: Nov 2005
Posts: 8,170
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Industry Role:
Join Date: Nov 2005
Posts: 8,170
|
If he's lazy tell him to mod and try this..
Code:
$desired_width = 500; $desired_height = 500; $im = imagecreatefromstring($blobcontents); $new = imagecreatetruecolor($desired_width, $desired_height); $x = imagesx($im); $y = imagesy($im); imagecopyresampled($new, $im, 0, 0, 0, 0, $desired_width, $desired_height, $x, $y); imagedestroy($im); header('Content-type: image/jpeg'); imagejpeg($new, null, 85); |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Registered User
Join Date: Feb 2004
Posts: 93
|
giving away the farm ... ;-)
__________________
Programmer looking for work you can hit me here -> Master Web Monkey or ICQ 281945544 PHP mySQL Flash ActionScript3 html javascitpt PERL::MECINIZE expect NATS MPA3 Responsys Interact |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Guest
Posts: n/a
|
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. |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Join Date: Aug 2008
Posts: 3,223
|
Yes that's true. But I believe there's a way to view pics in a normal web view.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
Registered User
Join Date: Feb 2004
Posts: 93
|
Did I mention I'm looking for work ...
__________________
Programmer looking for work you can hit me here -> Master Web Monkey or ICQ 281945544 PHP mySQL Flash ActionScript3 html javascitpt PERL::MECINIZE expect NATS MPA3 Responsys Interact |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
Confirmed User
Industry Role:
Join Date: Oct 2004
Location: In a refrigerator box by the tracks.
Posts: 4,790
|
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.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
Confirmed User
Join Date: Feb 2006
Location: Miami, FL
Posts: 1,556
|
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 spammed in threads! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
Too lazy to set a custom title
Join Date: Dec 2001
Location: Charlotte, NC
Posts: 14,137
|
I'm copying and pasting your comments and then e mailing them to him. Will give you guys his answer.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 |
Too lazy to set a custom title
Join Date: Dec 2001
Location: Charlotte, NC
Posts: 14,137
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 |
Confirmed User
Industry Role:
Join Date: Nov 2005
Posts: 8,170
|
I gave you the method and code snippets lol he should have it done in 10 minutes.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 |
Too lazy to set a custom title
Join Date: Dec 2001
Location: Charlotte, NC
Posts: 14,137
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 |
Confirmed User
Join Date: Aug 2008
Posts: 3,223
|
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.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 |
Confirmed User
Join Date: Apr 2002
Location: Houston
Posts: 5,651
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#27 |
Too lazy to set a custom title
Join Date: Dec 2001
Location: Charlotte, NC
Posts: 14,137
|
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. " |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#28 | |
Confirmed User
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
|
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 ![]() ![]()
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#29 | |
Guest
Posts: n/a
|
Quote:
![]() ![]() ![]() Fire your programmer, he's worthless. |
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#30 |
<&(©¿©)&>
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
|
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...
![]()
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000 Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager ![]() Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#31 |
Confirmed User
Join Date: Aug 2002
Location: Sydney, Australia
Posts: 6,103
|
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()
![]()
__________________
--- |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#32 | |
Guest
Posts: n/a
|
Quote:
![]() ![]() |
|
![]() ![]() ![]() ![]() ![]() |