getting image dimensions |
[eluser]andyd[/eluser]
What is the best way to get the image dimensions of a gif or jpeg file on the server? Does the image manipulation helper offer function to provide these values, before trying to change the file. Is it easy to get the image dimensions and resolution (width, height, dpi) with CI or PHP? Kind regards Andy
[eluser]sophistry[/eluser]
Here you go... it's your birthday today so I went to the PHP site and I searched on get image size and, what do you know? I found a function called getimagesize(). pretty cool, huh? http://us2.php.net/manual/en/function.getimagesize.php good luck in your future PHP manual searches. please be sure to share your learnings with us! As you so kindly requested, I also looked in the CI codebase for you and found that the Image Library does indeed have a function (undocumented) that can get you the data too. But, you probably don't want to rely on undocumented features... they might change. Code: // -------------------------------------------------------------------- Cheers.
[eluser]andyd[/eluser]
Thank you so much, i have got so involved with codeigniter, that i forgot about normal php functions. I have got it working lovely. Andy |
Welcome Guest, Not a member yet? Register Sign In |