rockinaway Posted September 23, 2011 Share Posted September 23, 2011 Right, I have a 2 part question. At the moment, each user has an image stored for them which is linked to via a field in the database. Now I'm showing the image by a simple <img /> tag and just including the result of the filename from a database query, which works perfectly fine but I want to take this a step or two further. 1) Firstly, is it possible to get variables of width, height etc for images that are stored on the server as a file? Much like this information can be accessed when a user uploads an image, is it possible to do it if I'm showing the image once it's uploaded and stored? 2) If I can get dimensions for the image, is it possible to SCALE it properly down to a suitable size? For example, the maximum image can be 50 x 50, but images that are smaller would be scaled up PROPORTIONALLY or if they were bigger they would be scaled down PROPORTIONALLY. For example, if an image is 100 x 200, I don't want it scaled down to 50 x 50, I want it so that it remains to scale and is scaled down to 25 x 50. Quote Link to comment https://forums.phpfreaks.com/topic/247702-image-manipulation/ Share on other sites More sharing options...
roth_t Posted September 23, 2011 Share Posted September 23, 2011 take a look at my thread http://www.phpfreaks.com/forums/index.php?topic=344425.0 you have a part of the code that can be usefull to you.. cheers Quote Link to comment https://forums.phpfreaks.com/topic/247702-image-manipulation/#findComment-1271979 Share on other sites More sharing options...
jcbones Posted September 23, 2011 Share Posted September 23, 2011 http://www.white-hat-web-design.co.uk/blog/resizing-images-with-php/ Simple Image makes this easy, and has great documentation that gets right to the point. Quote Link to comment https://forums.phpfreaks.com/topic/247702-image-manipulation/#findComment-1271994 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.