Welcome Guest, Not a member yet? Register   Sign In
Size of new_image (Image Manipulation Library)
#1

[eluser]ramm[/eluser]
Is there a way to know what size (width and height in pixels) result from a thumbnail creation with the Image Manipulation Library?

I set the "maintain_ratio" to true, so i don't know what size the get after resizing, and i need to save this value with the image information.

Thanks.
#2

[eluser]Cristian Gilè[/eluser]
http://php.net/manual/en/function.getimagesize.php


Cristian Gilè
#3

[eluser]ramm[/eluser]
I know that function, the thing is how to use it here

Code:
$size = getimagesize($what_here);

Do i have to read the file from the folder after i save it? is there a better way?

Thanks
#4

[eluser]Cristian Gilè[/eluser]
Code:
$img_info = getimagesize('path/to/your/local/image'); //getimagesize can reference a local file or a remote file

$img_info is an array where:

The 0 index is the width of the image in pixels
The 1 index is the height of the image in pixels


Cristian Gilè
#5

[eluser]ramm[/eluser]
That did it, thanks

I think i was overthinking the matter...




Theme © iAndrew 2016 - Forum software by © MyBB