#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    30
    Rep Power
    15
    Here is my code so far, straight off of www.phpbuilder.com, but what I want to do is to take the raw data created by the ImageCopyResized() function and slam it into a mysql table. All's I get is a "Resource id #"

    <----Code

    $original = ImageCreateFromJpeg("1.jpg");

    $original_width = ImageSX($original);
    $original_height = ImageSY($original);
    $thumb_width = 75;
    $thumb_height = 75;

    $thumbnail = ImageCreate($thumb_width, $thumb_height);

    ImageCopyResized($thumbnail, $original, 0, 0, 0, 0, $thumb_width, $thumb_height, $original_width, $original_height);

    Here instead of displaying the thumbnail I want to grad the raw data and slam it into the mysql database....what I need to know is how to get that "raw" picture data! Thanks
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    24
    Rep Power
    0

    Y don't you use the fopen and fread functions instead. something like so:

    $fp=fopen("image.jpg","r");
    $line = fread($fp,50000);
    #code for Sql


    I never have done anything with mySql so you'll have to fiqure out hoe to do that by your self

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by baldwnad:
    Here is my code so far, straight off of www.phpbuilder.com, but what I want to do is to take the raw data created by the ImageCopyResized() function and slam it into a mysql table. All's I get is a "Resource id #"

    <----Code

    $original = ImageCreateFromJpeg("1.jpg");

    $original_width = ImageSX($original);
    $original_height = ImageSY($original);
    $thumb_width = 75;
    $thumb_height = 75;

    $thumbnail = ImageCreate($thumb_width, $thumb_height);

    ImageCopyResized($thumbnail, $original, 0, 0, 0, 0, $thumb_width, $thumb_height, $original_width, $original_height);

    Here instead of displaying the thumbnail I want to grad the raw data and slam it into the mysql database....what I need to know is how to get that "raw" picture data! Thanks
    [/quote]

  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    30
    Rep Power
    15
    Thanks, that is what I ended up doing. I got it before you posted, but hopefully anybody else with this problem will get something out of the post. Any of my projects can be found here http://www.geekgetsthegirl.com/projects

    thanks everyone!

IMN logo majestic logo threadwatch logo seochat tools logo