});
});
/**
* Restricts the search by images dimensions.
* @param string
* @param string
* @return Nette\Utils\Finder provides a fluent interface
*/
Finder::extensionMethod('dimensions', function($finder, $width, $height){
if (!preg_match('#^([=<>!]+)\s*(\d+)$#i', $width, $mW) || !preg_match('#^([=<>!]+)\s*(\d+)$#i', $height, $mH)) {
throw new InvalidArgumentException('Invalid dimensions predicate format.');
}
return $finder->filter(function($file) use ($mW, $mH) {
return $file->getSize() >= 12 && ($size = getimagesize($file->getPathname()))
&& (!$mW || Finder::compare($size[0], $mW[1], $mW[2]))
&& (!$mH || Finder::compare($size[1], $mH[1], $mH[2]));
});
});
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">