Jump to content

[SOLVED] automatically make images?


acidglitter

Recommended Posts

This is one of my new websites

http://candyadds.com/

Tomorrow when the points reset there will be a lot of new VIP members. So there will be a lot more images being direct linked from myspace. Since the images are being direct linked from myspace does that hurt my bandwidth?

 

And I'm wondering if there is a script that could go to someones myspace page, get their default picture and make it into a new picture thats only 80x80 pixels and say 15 kb. Because if I could do that all of my pages would load a LOT faster. The pictures on there now are only resized with CSS. The original sizes are usually 170x226 pixels and 40 kb.

Link to comment
Share on other sites

Since the images are being direct linked from myspace does that hurt my bandwidth?

 

No, but it's considered impolite to do so, and if myspace doesn't like that they could block people from doing so when the referrer is your web site.

 

And I'm wondering if there is a script that could go to someones myspace page, get their default picture and make it into a new picture

 

Yes, there are scripts...I don't know of any off hand.  The basic principle is to use a command like file_get_contents to retrieve the image, then use the GD commands to manipulate it.

 

http://www.php.net/file_get_contents

http://www.php.net/gd

Link to comment
Share on other sites

Okay those are completely new to me so I'll try looking up some tutorials and then post back if I still need help. Thanks for your help!

 

This is kind of a dumb question, but right now my site is taking forever to load. Is the most likely reason for this because there are like 100+ visitors and way too many large images? And besides resizing the images so they load faster, are there other ways to make the site load more quickly?

Link to comment
Share on other sites

So I'm having problems..

 

I have one file that gets a picture from my site and resizes it and displays it alright..

Like it resizes everything and at the bottom of the page I have this to display it and then the page ends.

header('Content-type: image/png');
imagepng($image_resized);
imageDestroy($image_resized);

 

 

What I'm trying to do is have another page take that page and save it as a picture to a folder on my site.

I just have this right now and it copies it, but when you go to the address it says the image has errors, and if you view the source it shows the php code from the above page.....

if(copy($url, $path."file.png")){
echo "it worked!<p>";
echo $path."file.png";
} else {
echo "failed";
}

 

 

So what am I doing wrong?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.