Jump to content

cropping image behaviour


ankh2054
 Share

Recommended Posts

Hi All,

I am probably dong something wrong here, but I am trying to resize images without cropping them, but images are still being cropped even when cropping is set to false. 

This is actually working.

Using the below code:

//Load the user via API 
$u = $users->get($username);

//Will be single object of type Pageimage
$avatar = $u->avatar;

//Set Image array optons
$image_options = array(
  'cropping' => false,
  'quality' => 90
  
);  

//Check if avatar field is empty and assigns default image 
  if ($u->avatar->url){
        $thumb = $avatar->size(100,100, $image_options);
        $avatar_thumb .= "<img class='img-rounded img-responsive' src='{$thumb->url}'' alt='{$avatar->description}'' />"; 
    }
    
Link to comment
Share on other sites

I think the thumbnail image you see in the admin when editing the page is the 100x100 automatically generated image you're seeing. That only shows if your images field has the thumbnails checkbook ticked.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...