PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Here's an analogy of what you just did:
You just handed us a blank piece of paper and asked us how long ago the tree was cut down.
You have three options:
1. Post all the code that has to do with image resizing.
2. Explain what those variables mean.
3. Since you don't seem to understand PHP well, it's a good guess you didn't develop this yourself. Ask your question to the person who did, or tell us what library/code sample you downloaded.
Jim_Bo wrote:PS.. I like the way you assume I dont understand php well mate.
I thought it was quite a fair assumption given your question and further response.
You can't use a wildcard. You'll need to write some code to get the width and height of the image (using getimagesize()), then calculate the new size using a straightforward formula to maintain the aspect ratio.
Suppose you have an image whose width is 320 pixels and height is 240 pixels. You want to resize the width to 100 pixels. The new height will be 75 pixels.
Equivalent-Ratios.png (3.72 KiB) Viewed 204 times
Edit: This post was recovered from search engine cache.
Attachments
Equivalent-Ratios.png (3.72 KiB) Viewed 251 times
Last edited by McInfo on Tue Jun 15, 2010 4:42 pm, edited 1 time in total.
I have it solved, I allready new the information posted, I guess my question was bit lame in the way I asked.. I just assumed given it was GD and posted width and height variable it would make sence as I new was I was trying to acheive.
Small issue I still have is checking whether the form file feilds contain a file or not .. If any of the fields hold a file then exicute the code.