--- In [email protected], James Keeline <[EMAIL PROTECTED]> wrote: > > --- whoisquilty <[EMAIL PROTECTED]> wrote: > > > I want to create a thumbnail image. But I don't want to physically resize > > each image before > > uploading it (actually, my client doesn't really have the capability). > > > > Can I dictate a height (i.e. 108 px) and have a PHP script that will > > proportionately size down > > the image using that height? So, if the original is 360 px wide by 540 px > > high, the image will > > automatically size to 108 px high by 72 px wide. > > > > How would I do this? > > If I am interpreting your description, you don't want to make smaller thumbnail > image files bo be stored on the server. You simply want to display the images > at a smaller size. > > While you could dynamically change the size each time the image was displayed, > this would cause your server to do a lot of work. Surely processing power is > more expensive than disk space. > > Instead, if the images are small enough to be quick to load, you could use HTML > and simply define one dimension as the desired size. If the other dimension is > undefined, it will be proportionally smaller, keeping the aspect ratio. > > <img height='108' src='image.jpg'> > > Now the browser is required to scale the image. Some browsers and some OSs do > a better job of this than others. > > James >
As i see the problem is a bit different for the one James described. As i guess you, whoisquilty, want to upload a large image, resize it and store at the server. This operation will be performed only ones and each time a browser wants an image to be loaded it will load this small copy of your large image. And no runtime resizing. If i'm right then look at the directory Funtions->Image Functions in your PHP help file. There's a function named imagecopyresized. Use it in conjunction with some others.
