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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.