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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-23-2009, 09:38 PM   #1
FreeHugeMovies
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?
FreeHugeMovies is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 09:40 PM   #2
who
So Fucking Banned
 
Join Date: Aug 2003
Location: ICQ #23642053
Posts: 19,593
Firstly, his english sux. Secondly:

who is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 09:47 PM   #3
pimplink
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!
pimplink is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 09:49 PM   #4
FreeHugeMovies
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.
FreeHugeMovies is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:09 PM   #5
masterwebmonkey
Registered User
 
masterwebmonkey's Avatar
 
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
masterwebmonkey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:11 PM   #6
masterwebmonkey
Registered User
 
masterwebmonkey's Avatar
 
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
masterwebmonkey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:16 PM   #7
jwerd
Confirmed User
 
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
Quote:
Originally Posted by masterwebmonkey View Post
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.
exactly

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
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:18 PM   #8
FreeHugeMovies
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?
FreeHugeMovies is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:22 PM   #9
masterwebmonkey
Registered User
 
masterwebmonkey's Avatar
 
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
masterwebmonkey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:26 PM   #10
FreeHugeMovies
Too lazy to set a custom title
 
Join Date: Dec 2001
Location: Charlotte, NC
Posts: 14,137
Quote:
Originally Posted by masterwebmonkey View Post
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.
You lost me after MySQL
FreeHugeMovies is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:26 PM   #11
masterwebmonkey
Registered User
 
masterwebmonkey's Avatar
 
Join Date: Feb 2004
Posts: 93
Quote:
Originally Posted by lamerhooD View Post
exactly

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....
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
masterwebmonkey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:30 PM   #12
masterwebmonkey
Registered User
 
masterwebmonkey's Avatar
 
Join Date: Feb 2004
Posts: 93
Quote:
Originally Posted by FreeHugeMovies View Post
You lost me after MySQL
"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
masterwebmonkey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:32 PM   #13
fallenmuffin
Confirmed User
 
fallenmuffin's Avatar
 
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.
fallenmuffin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:35 PM   #14
fallenmuffin
Confirmed User
 
fallenmuffin's Avatar
 
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);
fallenmuffin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:40 PM   #15
masterwebmonkey
Registered User
 
masterwebmonkey's Avatar
 
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
masterwebmonkey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:45 PM   #16
Killswitch - BANNED FOR LIFE
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.
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:51 PM   #17
ExLust
Confirmed User
 
ExLust's Avatar
 
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.
__________________

BE A PARTNER
ExLust is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:55 PM   #18
masterwebmonkey
Registered User
 
masterwebmonkey's Avatar
 
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
masterwebmonkey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:56 PM   #19
Redrob
Confirmed User
 
Redrob's Avatar
 
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.
Redrob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 10:57 PM   #20
SeanLEE
Confirmed User
 
SeanLEE's Avatar
 
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!
SeanLEE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 11:02 PM   #21
FreeHugeMovies
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.
FreeHugeMovies is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 11:04 PM   #22
FreeHugeMovies
Too lazy to set a custom title
 
Join Date: Dec 2001
Location: Charlotte, NC
Posts: 14,137
Quote:
Originally Posted by masterwebmonkey View Post
Did I mention I'm looking for work ...
I hear ya but he's been working for me for a while and hes a lot cheaper than you are for sure! I know you get what you pay for but he normally doesn't do stuff like this!
FreeHugeMovies is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 11:07 PM   #23
fallenmuffin
Confirmed User
 
fallenmuffin's Avatar
 
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.
fallenmuffin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 11:09 PM   #24
FreeHugeMovies
Too lazy to set a custom title
 
Join Date: Dec 2001
Location: Charlotte, NC
Posts: 14,137
Quote:
Originally Posted by fallenmuffin View Post
I gave you the method and code snippets lol he should have it done in 10 minutes.
I E Mailed him playa, will let you know and thank you all for your help.
FreeHugeMovies is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2009, 11:14 PM   #25
ExLust
Confirmed User
 
ExLust's Avatar
 
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.
__________________

BE A PARTNER
ExLust is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-24-2009, 01:37 AM   #26
Alky
Confirmed User
 
Alky's Avatar
 
Join Date: Apr 2002
Location: Houston
Posts: 5,651
Quote:
Originally Posted by Redrob View Post
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.
thanks for the tip lol... did you read the thread?
Alky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-24-2009, 08:37 AM   #27
FreeHugeMovies
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.
"
FreeHugeMovies is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-24-2009, 08:53 AM   #28
jwerd
Confirmed User
 
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
Quote:
Originally Posted by FreeHugeMovies View Post
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.
"
$query = "select id, content from big_table_of_images";
// 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
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-24-2009, 09:34 AM   #29
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
Quote:
Originally Posted by lamerhooD View Post
$query = "select id, content from big_table_of_images";
// 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


Fire your programmer, he's worthless.
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-24-2009, 09:55 AM   #30
woj
<&(©¿©)&>
 
woj's Avatar
 
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

Last edited by woj; 02-24-2009 at 09:57 AM..
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-24-2009, 10:06 AM   #31
Zorgman
Confirmed User
 
Zorgman's Avatar
 
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()
__________________
---
Zorgman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-24-2009, 10:08 AM   #32
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
Quote:
Originally Posted by Zorgman View Post
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()
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.