Get the X prior to resize

See all posts Reply

Get the X prior to resize new!
by Todd, 18 years, 10 months ago
Is it possible to get the x or y size prior to image resizing from within the class?Reply
Re: Get the X prior to resize new!
by Todd, 18 years, 10 months ago
NVM Figured it out. Just call $handle->image_x before you set your resize size.Reply
Re: Get the X prior to resize new!
by Todd, 18 years, 10 months ago
sratch that, $handle->Image_x defaults to 150, sooooo I guess my original question still stands.Reply
Re: Get the X prior to resize new!
by colin, 18 years, 10 months ago
No, it is not possible to know the size of the image prior to resizing, at least not in the class itself. The X and Y sizes are retrieved when you call process(), not before.

However, you can read some class variables before calling process(). For instance, you can read $foo->file_src_name which gives you the filename of the just-uploaded file. From there, you can get the size of your picture, outside of the class, and then call process() with different options.Reply
Re: Get the X prior to resize new!
by Leon, 18 years, 6 months ago
let's say we got the name of the uploaded file with $foo->file_src_name, is there a way to get the full path where the file has been uploaded?

I would like to check the mime and size of the uploaded file before the action, so I need to use file_exists() and getimagesize() functions and for this I need to know the full path to the file. Documents say it is /tmp/ but is this always true?Reply