Page 1 of 1

CC snippet - Image size in inches

Posted: 22 Mar 2018 12:29
by highend
How to set up a custom column with a snippet: viewtopic.php?f=7&t=18653

This one displays the size of an image in inches instead of pixel

The snippet code:

Code: Select all

Snip: CustomColumn 1
  XYplorer 18.90.0000, 22.03.2018 12:28:38
Action
  ConfigureColumn
Caption
  Size (inches)
Type
  3
Definition
      $dpi = get("Screen", "dpi");
      $hSize = property('System.Image.HorizontalSize', <cc_item>);
      $vSize = property('System.Image.VerticalSize', <cc_item>);
      if (!$hSize || !$vSize) { return "<unknown size>"; }
      return round(($hSize / $dpi), 2) . " x " . round(($vSize / $dpi), 2);
Format
  1
Trigger
  1
Item Type
  0
Item Filter
  {:Image}
It looks like this:
cc_setup.png