Jump to content


resizing an image in php


3 replies to this topic

#1 tiki

    Young Padawan

  • Members
  • Pip
  • 259 posts
  • Gender:Male
  • Location:California

Posted 02 May 2006 - 10:43 PM

Whats the most efficient way to resize an image?

I want to have php resize the images under products, because they look a bit blurry.
http://www.inferiaefashion.com/

#2 Indigo

    Official Alien

  • Members
  • PipPipPip
  • 617 posts
  • Gender:Male
  • Location:Trondheim, Norway
  • Interests:Computing in general, especially design and programming of all kinds.

Posted 03 May 2006 - 02:01 AM

Do you want php to crop images, just to make some 100x100-thumbnails of the full picture, or just basically resize them?

#3 tiki

    Young Padawan

  • Members
  • Pip
  • 259 posts
  • Gender:Male
  • Location:California

Posted 03 May 2006 - 09:32 AM

Well right now the images are 215x215, they resize by the <img tag to 165x165. If php can resize for them, without having to use a new image, and still keep quality, ill do it that way.

#4 Wybe

    Jedi In Training

  • Members
  • PipPip
  • 399 posts
  • Gender:Male
  • Location:the Netherlands
  • Interests:Graphic design, digital and traditional, street style, graffiti, guerilla drawing, typography, coding, sex

Posted 03 May 2006 - 01:21 PM

Check out PHP.net for the imagecopyresampled() manual. In the comments posted there by others you'll probably find enough if not exactly what you're looking for. Once that's figured out I think the best thing to do is just upload the full version to your site somewhere (the full or larger version should probably be available to customers anyway in case they want to view it), and you can have PHP resize that image.

As for efficiency, you'll want PHP to generate the images once and save them, instead of creating them on the fly every time.

Edited by Wybe, 03 May 2006 - 01:29 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users