Web Hosting Talk







View Full Version : Image resizing on website


ruts
08-31-2009, 03:54 PM
I searched but couldn't find something on this topic unless I missed it somewhere. I'm trying to figure out what sort of programming or script is used to put a picture resizing tool on a website for visitors to use. If someone knows of a script for this sort of tool that a webmaster can put on their site or what kind of programming is required, I'd appreciate any pointers or leads in the right direction. Thanks!

dotflyer
09-01-2009, 03:12 AM
i didn't got your clearly, but seems you looking for a script which automatically resize images. You can do this easily if you have installed GD and imagemagik library on your server.
if you looking for script for this then you can search on google with "automatically resize images script gd library" keyword.

cpoalmighty
09-01-2009, 11:03 AM
Im stomped. I was going to suggest using cpanel then clicking on file manager to send you to the directory then you can always edit your pics using the necessary links but i guess that is not what your looking for :confused:

tonis
09-02-2009, 03:46 AM
I also want to know it, but still cann't find the ideal soulation. Someone says javascript can sovle it prefectly, looking for it.

Hosting24
09-02-2009, 03:58 AM
ruts, what kind of image resize solution are you looking for? Do you want to display a thumbnail version of big image? if so, it's very easy to make a script for this purpose. It will take only about 10 lines of code.

aradapilot
09-02-2009, 08:18 AM
I have a few of those that i've written, what specifically are you looking for? I'll put it up for you

mwatkins
09-02-2009, 10:59 AM
# python
from PIL import Image

orig_img = Image.open('your_big_image.jpg')
new_img = orig_img.resize((400, 350), Image.ANTIALIAS)
new_img.save('your_big_image_resized.jpg')

http://www.pythonware.com/products/pil/

Python Imaging Library (free) has other functions which may be of use.

Docs: http://www.pythonware.com/library/pil/handbook/index.htm

Another example straight from the handbook, creates thumbnails from every jpg in a directory:

# python
from PIL import Image
import glob, os

size = 128, 128

for infile in glob.glob("*.jpg"):
file, ext = os.path.splitext(infile)
im = Image.open(infile)
im.thumbnail(size, Image.ANTIALIAS)
im.save(file + ".thumbnail", "JPEG")

http://www.pythonware.com/library/pil/handbook/image.htm

siv9
09-02-2009, 11:20 AM
Try looking up phpThumb on SourceForge (or google will get you there)

You should checkout phpThumb. It might not be exactly what your looking for (ie you may need to make a few changes to it to make it work as you need)

phpThumb is one of the most valuable, powerful thumbnail/image resizing tools that I know of.