Jump to content

Recommended Posts

Posted

Hi

I want to exclude images of a certain width. I wrote a function, but it created an array instead of PageImages. How come I could ameliorate this?

function resolution ($largeur, $hauteur, Pageimages $images) {
	$imageLarge=[];

	foreach ($images as $image) {
		if ($image->width >= $largeur) {
			$imageLarge[]=$image->size($largeur,$hauteur);
		}
	}		
	return $imageLarge;		
}
	

Thanks

Mel

Posted

You can use width in a find() selector with Pageimages, e.g...

$wide_images = $images->find("width>1000");

 

  • Like 1

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
  • Recently Browsing   0 members

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