Jump to content

Image resizing from the web


gerkintrigg

Recommended Posts

I have a site that uses an XML feed to get data, and I have managed to do most of what I want, but I am trying to use a script that I previously used for image uploads, but is proving a little tricky to resize from the image on the sender's server.

 

The code I am using refers to an uploaded image, but I changed it to refer to the database that i uploaded all the details to and it doesn't like it very much:

$q="SELECT * FROM `feeddata2` ORDER BY `Date` DESC Limit 3";
$sql=mysql_query($q);
while ($r=mysql_fetch_array($sql)){
$record_id='1';
if(empty($r['small_photo_URL'])){
if (!empty($r['PhotoURL'])){
// for the main image:
   $image = new SimpleImage();
   $image->load($r['PhotoURL']);
   $image->resizeToWidth(80);
   $image->save($root.'news/images/small_'.$record_id.'.jpg');
   $my_small_image='news/images/small_'.$record_id.'.jpg';
}
}

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/165585-image-resizing-from-the-web/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.