Hi, I have a form to upload images one at a time with text to a mysql database table, but I need to resize these images before adding them to the table, I want to retain aspect ratio and I need it to always resize the longest side of the image. So a portrait or landscape image will be resized to 300 on its longestside and wil retain aspect ratio.
Can anyone help?

Thanks for looking...................

Recommended Answers

All 2 Replies

checkout imagecopyresampled , look at example 1.
Do you want to add the images to to the database?
It's often better (faster) to save the image to a special dir and just store the filname in the database.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.