Jump to content


Photo

Simple Image Scaling


  • Please log in to reply
2 replies to this topic

#1 meman1188

meman1188
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 26 June 2006 - 06:18 AM

I am pretty new to PHP, so i don't really know how to do anything beyond the basics and am mostly using code examples to learn my way. However, i haven't been been able to find any examples for what i'm looking to do. I want to take an image (jpg or gif) and scale it so it fits into a pre-sized box. I know there are lots of scripts out there that do this with a file and output to a file.. but i'm looking for something that that takes a web image (http link) and then outputs directly to the browser or returns some sort of image that i can display with <img> tags (i don't know if thats even possible, but would be my first choice). If anyone knows of a script already made to do this or maybe there is a method already in php for this sort of thing that would be great. Thank you for your help.

-- Brady

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 26 June 2006 - 01:46 PM

You'll need PHP compiled with GD support to use its image functions. There is an example of resizing images on the [a href=\"http://uk.php.net/imagecopyresized\" target=\"_blank\"]manual page for imagecopyresized()[/a].

#3 meman1188

meman1188
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 27 June 2006 - 01:52 AM

Thank you for the link, worked out great just used getimagesize, don't even need the GD library (not sure if i have that or not, its not my server). Thanks again

-- Brady




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users