Welcome Guest, Not a member yet? Register   Sign In
how to get properties of a resized image؟
#1

[eluser]neverbewith[/eluser]
Hi every one
i want to know is there any method to get properties of a resized image (such as size,dimension,...) like we do in
Code:
$this->upload->data()
?
thanks in advance
#2

[eluser]rip_pit[/eluser]
yes using image_lib will give you these datas:
Code:
//W/H BEFORE RESIZING
$this->image_lib->orig_width;
$this->image_lib->orig_height;

//W/H AFTER RESIZING
$this->image_lib->width;
$this->image_lib->height;

you can use something like that :
Code:
$this->image_lib->initialize($your_cfg);

if ($this->image_lib->resize()) {


  $orig_dim = $this->image_lib->orig_width." x " .$this->image_lib->orig_height." px";//old = before resize
  $new_dim = $this->image_lib->width." x " .$this->image_lib->height." px";//new = after

}
#3

[eluser]neverbewith[/eluser]
Hi
I'm not testing it yet, but thanks so much for your reply
does other properties(name,size in KB,...) have the same rule and is there any documentation for that or it is just you? :-P
#4

[eluser]rip_pit[/eluser]
yes there are a lot of properties available from the lib,
but i don't see no ->data() function in it, you'll have to use $this->image_lib instead.

you can have vars
Code:
var $source_folder
    var $dest_folder  
    var $mime_type            
    var $orig_width          
    var $orig_height        
    var $image_type        
    var $size_str          
    var $full_src_path      
    var $full_dst_path
and more :
use print_r($this->image_lib) after you used it in a script, it'll show you all the properties in context.
Or you can open the lib file and look at it's var definitions from source code(/libraries/Image_lib.php)
#5

[eluser]neverbewith[/eluser]
thank you so much
it's really helped
regards




Theme © iAndrew 2016 - Forum software by © MyBB