# --- BEGIN PLUGIN HELP ---
bjl_image_ratio
This is a plugin to list images that have a specified aspect ratio.
This could help you list images that are an appropriate desktop wallpaper size, for example.
There is a built-in 5% tolerance, so images that nearly meet the specified ratio will also be listed.
Tested on 4.0.4.
Example: <txp:bjl_image_ratio w="4" h="3" />
- w : integer : image width. must be specified.
- h : integer : image height. must be specified. These both refer to the original image,
not any thumbnail.
optional attributes:
- ids : "images" or "articles". default "images", means returns image IDs, not article IDs.
if 1, then it returns the ids of articles that have article_images that
fit the specified ratio. good for "photoblog" type sites with one image
per post.
- output : "fullsize" or "thumbs". default "thumbs", this only applies if
ids = "images".
More examples:
<txp:bjl_image_ratio w="1" h="1" /> - list square images.
<txp:bjl_image_ratio w="4" h="3" ids="articles"/> - lists the articles that have article_images
that are square. This will likely only work for articles that only have one image listed.
# --- END PLUGIN HELP ---
$ratiol AND txp_image.w/txp_image.h < $ratioh");
} else {
$what = 'id';
$from = 'txp_image';
$where = "w/h > $ratiol AND w/h < $ratioh";
$rs = safe_rows($what,$from, $where);
}
$output = "";
foreach ($rs as $post) $output .= $post["id"]. ' ';
return $output;
}
# --- END PLUGIN CODE ---
?>