Image resizing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vivekjain
Forum Commoner
Posts: 76
Joined: Thu Jan 08, 2004 12:38 am

Image resizing

Post by vivekjain »

Hi,

I am creating an application using PHP. I am uploadig and would require 2 things to be done:
1) Can the images be resized when it is uploaded?
2) Can we automatically generate a thumbnail for these images?

Also, is it possible to upload a zip file using PHP?

Thanks
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

#1 yes
#2 yes

#3 yes

:P
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
vivekjain
Forum Commoner
Posts: 76
Joined: Thu Jan 08, 2004 12:38 am

Image resizing

Post by vivekjain »

Can you please tell me how these can be done?

Thanks.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

For resizing images, you're going to need to use GD, and the PHP functions that go with it -> Read Here

For uploading zip files, it's just like any other file. Just put it into your form, and upload :P
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
vivekjain
Forum Commoner
Posts: 76
Joined: Thu Jan 08, 2004 12:38 am

Image resizing

Post by vivekjain »

Thanks for the reply.
I wanted to know once it is zipped, will I be able to unzip it on the server, or will i need to use the server functions to do that?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Although I have never unzipped anything it should be possible. I don't believe there are any php functions for it (although there are classes that you can search for)

It also depends on what your server has. for example, if you have the gzip utitlity, you could do something like..

Code: Select all

exec("gzip -d $yourzipfile");
don't quote me on that though :P I'm just throwing ideas out :)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
vivekjain
Forum Commoner
Posts: 76
Joined: Thu Jan 08, 2004 12:38 am

Image resizing

Post by vivekjain »

Hi,
I am unable to find a function in the GD Library that would resize an image. Can you please help me with this.

The process is this, I am uploading an image and I need it resize it on the fly.

Thanks
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

search the forum for image resizing, been discussed many times before
Post Reply