•  » Themes
  •  » Bootstrap Darkroom vs. Center of Interest.

#1 2021-08-25 17:12:50


Bootstrap Darkroom vs. Center of Interest.


It seems that Bootstrap Darkroom doesn't honor the COI settings. Also, the maintainer died two years ago. So I decided to see if I could fix my install but this is my first real run through the theme code. What I've found is

bootstrap_darkroom/template/thumbnails.tpl - Displays a thumbnail

It sets up the derivative parameters.
{define_derivative name='derivative_params' width=$width height=$height crop=true}

It then loops through the thumbnails
{foreach from=$thumbnails item=thumbnail}
   So far as I can tell, this is what does the scaling/cropping.
   {assign var=derivative value=$pwg->derivative($derivative_params, $thumbnail.src_image)}
   And then it displays the thumbnail
   <img src="{$derivative->get_url()}"

$pwg->derivative is in include/template.class.php
It's a one liner:
    return new DerivativeImage($type, $img);

Then 'something' seems to cause derivative to call its private 'build' funtion.
  private static function build($src, &$params, &$rel_path, &$rel_url, &$is_cached=null)
  which, I think gets to i.php to do the rescale. i.php doesn't seem to use coi at all.

Now we know that Modus does use the COI. How? Turns out it does it's own derivative by calling crop_h and crop_v and passing the COI.

It doesn't seem to me that honoring COI should be a burden placed on the themes, but should be built into i.php.

Have I misread things? Is there a reason i.php doesn't do this?


  •  » Themes
  •  » Bootstrap Darkroom vs. Center of Interest.

Board footer

Powered by FluxBB

github twitter newsletter Donate © 2002-2022 · Contact