Forums
This topic is locked
Image Upload and Manipulation
25 Mar 2002 19:52:23 Peter R posted:
Hello, (Using PHP,MySQL,UD4)I'm going to be using PHP Upload to allow users to upload images to my site and insert a record at the same time. Problem is, how can I control the size of the image that they're uploading?
What I need:
An image is uploaded.
Converted to a maximum 400px wide(or whatever value I choose).
Converted to be under a certain size i.e. 50k(of course this isn't needed if the image is truly converted to x-pixels)
The image is stored in a directory, and the path to the image into a database with other fields.
Also needed:
That same image also converted into a thumbnail, and it's path stored in a database along with the large image's field and other fields.
How would I get started on this? Can anyone point me to a script that could do the above?
Basically I have a Car section on my site to which auto dealers can upload info and images of their cars for sale. So along with the info of their car, I need them to upload 1 image of the car, then have that image converted to a specific size to go along with the cars info, and a thumbnail size for visitors browsing. How can I do this?
NOTE: I don't want a 1MB image squished to fit 400px display and still be 1MB in size. I want the 1MB image to be converted to 400px and have it's size shrunk accordingly to like 50k for example.
Thank you for any advice or help,
Peter R.
Replies
Replied 26 Mar 2002 11:00:23
26 Mar 2002 11:00:23 Aurel Sorin Cirstoiu replied:
Here is a link where you can find what you need.
-----------------------
Cirstoiu Aurel Sorin
InterAKT Support
www.interakt.ro
-----------------------
Cirstoiu Aurel Sorin
InterAKT Support
www.interakt.ro
Replied 26 Mar 2002 16:45:01
26 Mar 2002 16:45:01 Peter R replied:
Hi csorin,
The link didn't show up. Could you post it again please?
Or did you mean the url interakt.ro? If so, I couldn't find anything along the lines of what I'm looking for. Could you specify a more precise URL?
Thank you!
Peter
The link didn't show up. Could you post it again please?
Or did you mean the url interakt.ro? If so, I couldn't find anything along the lines of what I'm looking for. Could you specify a more precise URL?
Thank you!
Peter
Replied 28 Mar 2002 13:06:20
28 Mar 2002 13:06:20 Aurel Sorin Cirstoiu replied:
I m sorry about the link.I don't know what happened.
Here are some useful links:
1. www.blazonry.com/scripting/upload-size.php
2. www.phpbuilder.com/forum/archives/1/2001/4/4/114938
3. www.stickysauce.com/shop/programming/programming3.htm
-----------------------
Cirstoiu Aurel Sorin
InterAKT Support
www.interakt.ro
Here are some useful links:
1. www.blazonry.com/scripting/upload-size.php
2. www.phpbuilder.com/forum/archives/1/2001/4/4/114938
3. www.stickysauce.com/shop/programming/programming3.htm
-----------------------
Cirstoiu Aurel Sorin
InterAKT Support
www.interakt.ro
Replied 31 Mar 2002 14:14:10
31 Mar 2002 14:14:10 Bruno Mairlot replied:
You have two solutions :
1. Using the predefined Image functions of PHP, but this will require the GD module to be compiled within your PHP binaries. (Or those from your ISP)
And, very often, the GD libraries doesn't have the GIF import/export features, due to license restriction.
2. Use ImageMagick (on Unix), and use shell escaped command. Imagemagick contains a tool named convert, that lets you convert any kind of picture into another type of picture, with the geometry, details, compression level and so on...
--- Better to die trying, than never try at all ---
1. Using the predefined Image functions of PHP, but this will require the GD module to be compiled within your PHP binaries. (Or those from your ISP)
And, very often, the GD libraries doesn't have the GIF import/export features, due to license restriction.
2. Use ImageMagick (on Unix), and use shell escaped command. Imagemagick contains a tool named convert, that lets you convert any kind of picture into another type of picture, with the geometry, details, compression level and so on...
--- Better to die trying, than never try at all ---