Jump to content

Image manipulation


rockinaway

Recommended Posts

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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/247702-image-manipulation/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.