Hello, could somebody help me integrate ratio check.
I have made isotope plugin for a gallery on the homepage. But I need to pass ratio to plugin somehow. For example. If width > height, I need to set class="horizontal" if height < width I need to set class="vertical".
Any ideas how I can achieve this?
Ok, did it myself
Next question. How I could turn on arbitrary crop for the thumbs? For example, if image is vertical I would like to crop it to 250x150, otherwise it should be 150x150px
I have made isotope plugin for a gallery on the homepage. But I need to pass ratio to plugin somehow. For example. If width > height, I need to set class="horizontal" if height < width I need to set class="vertical".
Any ideas how I can achieve this?
Ok, did it myself
PHP Code:
<?php
foreach ($gallery['items'] as $item) {
$ratiow = $item['width']/$item['height'];
if ($ratiow < 1) {
$ratio = "width-1 height-1";
} elseif ($ratiow > 1 AND $ratiow < 2) {
$ratio = "width-1";
} elseif ($ratiow > 2) {
$ratio = "width-2";
}
?>
Next question. How I could turn on arbitrary crop for the thumbs? For example, if image is vertical I would like to crop it to 250x150, otherwise it should be 150x150px