473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help with saving a thumbnail of uploaded image.

Markus
6,050 Expert 4TB
I built myself a little image host as a project to test my skills in web design (www.mahcuz.com/upload/). Everything is pretty much perfect but i've noticed on other image hosts that they have an image code for forums which, instead of showing the full size image, shows a thumbnail of the image.

Is there a way to save a thumbnail, of the image that has been upload, and save it in a directory?

Any ideas?

Thanks :)
Oct 13 '07 #1
8 1225
ak1dnar
1,584 Expert 1GB
As I could remember here you can find such a script. Good luck.
Oct 13 '07 #2
Markus
6,050 Expert 4TB
As I could remember here you can find such a script. Good luck.
Hmmm, didn't help me really. But that is a great site :)

And thanks
Oct 13 '07 #3
ak1dnar
1,584 Expert 1GB
Hmmm, didn't help me really. But that is a great site :)

And thanks
Did you read the entire application within 10 mins. What a miracle you are..
If the thumbnail creation portion is not there what is this create Thumbnail function.
Oct 13 '07 #4
Markus
6,050 Expert 4TB
Did you read the entire application within 10 mins. What a miracle you are..
If the thumbnail creation portion is not there what is this create Thumbnail function.
Yeh i saw that, and there's no need for sarcasm :)

I was just hoping for a more detailed approach not just a createThumbnail() peice of text that describes more about bear hunting than it does on how to use it in the way i need it ;)
Oct 13 '07 #5
pbmods
5,821 Expert 4TB
Heya, Markus.

When the User uploads a file, the path to the uploaded file is located at $_FILES['nameOfTheFileInput']['tmp_name'].

You can load an image file into memory using imagecreatefromjpeg(), imagecreatefromgif() and imagecreatefrompng().

Use getimagesize() to determine the file's mime-type so that you know which function to use.

To save a file loaded in memory, use imagejpeg() (or if you want to save all your images as PNG files, use imagepng() instead).
Oct 13 '07 #6
ak1dnar
1,584 Expert 1GB
Last edited by pbmods : Today at 11:15 PM. Reason: Washed Markus' mouth out with soap.
Hmmm....I know your style pb. But I missed the original post.
Oct 13 '07 #7
Markus
6,050 Expert 4TB
Hmmm....I know your style pb. But I missed the original post.
Well there was no reason for ajax to assume i'd just blew his advice off. I didn't.

And sorry.

And! Thanks, i've gotten it down now :) just getting an error when trying to save it

Thanks a bunch.
Oct 13 '07 #8
pbmods
5,821 Expert 4TB
Heya, Markus.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)

This thread is now closed.
Oct 13 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Luke Dubbber | last post by:
I am currently new to PHP and I am reading a book by Premier Press called PHP Professional Projects. I am new to PHP, I heard it was better and faster and way more flexible so far they have been...
0
by: Michael Satterwhite | last post by:
I'm having trouble with the functions for resizing a picture uploaded to my server. Consider the following: $jpeg = imagecreatefromjpeg($filePath); //I know this works! $oldX =...
3
by: Peter Morris [Droopy Eyes Software] | last post by:
Hi all I have a JPG that has just been uploaded, and I now need to create a thumbnail. I loaded the JPG using Image.Load and created a new image using original.GetThumbnailImage, but when I...
4
by: moondaddy | last post by:
I have an app where users will upload photos to their shopping cart. When they review their cart I need to include a light weight thumbnail of the image they uploaded. how can I take the image a...
2
by: asad | last post by:
Hello friends, how ru all, i have some problem about saving created thumbnail, following is the code i use for creating thumbnail but thumbnail was not saved it is on memory which method is used to...
2
by: Brad | last post by:
I have code which takes an image, uploaded from a web page, and saves it to a database. Now I want to always resize an uploaded image before it is saved to the database. My code to resize is...
4
by: pek | last post by:
I created a file name image.php which contains only the following code: <?php function createThumbnail($picture,$thumb,$new_w,$new_h) { $extension=substr($picture,strrpos($picture,".")+1);...
2
by: RB | last post by:
Hi there, I'm having a problem with an ASP.NET/VB.NET Control I am writing. The control is a simple gallery control, which shows a set of thumbnails (using a DataList), and a main image of the...
1
by: dodgeyb | last post by:
Hi there, Trying to allow client to upload image, thumbnail it, and save it into sql table image field. Code compiles & runs but image cannot be retrieved. any clues what I'm doing wrong pls ! ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.