Jump to content


Help please


6 replies to this topic

#1 Dawiss

    Young Padawan

  • Members
  • Pip
  • 17 posts

Posted 14 August 2008 - 11:44 AM

I have a problem,

I want to make page on web where is shown only part of a bigger image.. Like I have 800x600px images uplaoded and I want to show only a smaall random part of the image in 50x50px table.. so that dosent resize it to 50x50px and it dont look ugly..

If someone knows how to do this with javascript,css or PHP please help.

Thanks

Edited by Dawiss, 14 August 2008 - 02:43 PM.


#2 dotSilver

    Young Padawan

  • Members
  • Pip
  • 32 posts

Posted 14 August 2008 - 04:17 PM

This can be achieved using php with it's GD Library. You'll need to make sure that your host has GD Library switched on in their php server, most hosts usually do.

And here's a tutorial found (using the search) on p2l, it's how to crop images with GD.

http://www.pixel2life.com/tutorials/count/...using_php_s_gd/

#3 Blaatzorrr

    Young Padawan

  • Members
  • Pip
  • 24 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Html,CSS,Javascript,PHP&Mysql and more =)

Posted 14 August 2008 - 04:21 PM

View PostdotSilver, on Aug 14 2008, 11:17 PM, said:

This can be achieved using php with it's GD Library. You'll need to make sure that your host has GD Library switched on in their php server, most hosts usually do.

And here's a tutorial found (using the search) on p2l, it's how to crop images with GD.

http://www.pixel2life.com/tutorials/count/...using_php_s_gd/

I think you mean : http://haugland.ca/e...ropping-with-gd ( the link you gave was dead ;) )

Also,, this sucks that this topic is just now on Pixel2Life i sat this midday thinking about an hour to do this by my self :hitit:

#4 dotSilver

    Young Padawan

  • Members
  • Pip
  • 32 posts

Posted 14 August 2008 - 04:38 PM

my bad... I didn't check the link first, I remember reading the tutorial once and it works fine and dandy, but that was over a year ago. :|

#5 Dawiss

    Young Padawan

  • Members
  • Pip
  • 17 posts

Posted 14 August 2008 - 11:53 PM

View PostRicardoC, on Aug 15 2008, 12:21 AM, said:

View PostdotSilver, on Aug 14 2008, 11:17 PM, said:

This can be achieved using php with it's GD Library. You'll need to make sure that your host has GD Library switched on in their php server, most hosts usually do.

And here's a tutorial found (using the search) on p2l, it's how to crop images with GD.

http://www.pixel2life.com/tutorials/count/...using_php_s_gd/

I think you mean : http://haugland.ca/e...ropping-with-gd ( the link you gave was dead ;) )

Also,, this sucks that this topic is just now on Pixel2Life i sat this midday thinking about an hour to do this by my self :hitit:

Big thanks, Iknew it will have to be some [art GD commands, but didn't knew which. Big thanks but there is little problem, that program like takes big image and makes new where is shown center of that image, maybe someone knows how to do this without making new image?

#6 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 15 August 2008 - 11:40 AM

The best way to do it is to make a new image, cache it, and display that every time rather then having to waste the resources to crop it on every page load.

If you still don't want to cache it, then send the imagejpg() output directly to the browser rather then a file.

#7 Dawiss

    Young Padawan

  • Members
  • Pip
  • 17 posts

Posted 15 August 2008 - 02:57 PM

Ok thanks for advises I'll try my best.. Thanks agan





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users