Variables

Introduction

In the options of some actions you will find notations like "<dpi>" , "<filename>", "<folder>",… Everything what is between the brackets, is a variable. The value of the variables is derived from the source image file. The Image Inspector lists all available variables of an image. You can use # for formatting numbers, for example if the number is 32:

  • <#>, <width>, <height> becomes 32
  • <####>, <####width>, <####height> becomes 0032
image_inspector_exif.png

Categories

Default

  • <#> index (the index of the first file is 0)
  • <day>
  • <dpi>
  • <filename>
  • <folder> (the folder given in the execute dialog box, within a hierarchy this is fixed)
  • <foldername> (the basename of the folder)
  • <subfolder> (the relative path of the image in regards to <folder>, within a hierarchy this changes)
  • <root> (the parent folder of <folder>, within a hierarchy this is fixed)
  • <path> (the absolute path of the image)
  • <height>
  • <hour>
  • <minute>
  • <month>
  • <monthname>
  • <path>
  • <second>
  • <type>
  • <weekday>
  • <weekdayname>
  • <width>
  • <year>

To be clear, these expressions for the absolute path are all equal:
<path>
<folder>/<subfolder>/<filename>.<type>
<root>/<foldername>/<subfolder>/<filename>.<type>

For an example, open an image the Image Inspector and you will be able to inspect all these values.

Pil

- Phatch always provides these variables.

  • <Pil.Format>
  • <Pil.FormatDescription>
  • <Pil.Mode>
  • <Pil.Size>

Exif

- Requires pyexiv2 (see below)
- This is capable to handle the most image files (JPEG, TIFF, …).

  • <Exif.Image.DateTime>

Iptc

- Requires pyexiv2 (see below)
- You can find more information about IPTC on wikipedia.

Pexif

- Always available.
- These will always work for JPEG images if the file has exif information available.

  • <Pexif.DateTime>

Zexif

- Always avaible.
- This is the same as Pexif, but with numbered variables instead of labels.

  • <Zexif.0x0132>

Use cases

Folder Arrangement

Save images to different folders based on their characteristics (type, width, dpi, etc). If folder doesn't exist, Phatch creates one.

Example: Save your images in folder: <folder>_<width>_<height>

© 2007-2008 www.stani.be
(It is not allowed to copy, distribute or transmit any part of the wiki without written permission.
Only contribute to this wiki if you agree with this term.)