Simmo Posted October 21, 2012 Share Posted October 21, 2012 I want to able to allow users to upload pictures. Using the GD library I will create/store three different size images for a gallery and displaying the product. The problem is scaling the dimensions for people who have uploaded different sized images. For example, a 4000 x 3000 image will scale to what I want 240 x 180, however I notice that some users have pictures with different dimensions that will not scale to this, e.g. 3008 x 2000 and 3837 x 2551 which will not scale to 240 x180. Can someone please guide me to the best way to handle these different image dimensions so they can be scaled to a common size. Quote Link to comment https://forums.phpfreaks.com/topic/269743-handling-uploaded-pictures-with-different-dimensions/ Share on other sites More sharing options...
Barand Posted October 21, 2012 Share Posted October 21, 2012 I'd scale them all so they fit inside a 240 pixel square ie the max dimension is 240 and the smaller side scaled proportionately Quote Link to comment https://forums.phpfreaks.com/topic/269743-handling-uploaded-pictures-with-different-dimensions/#findComment-1386802 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.