dimanche 20 mai 2007

gThumb web album theme

Since I couldn't find it anywhere on the web, I had a look at the source package of gThumb, and I found some documentation about how to customize a "web album theme", a very useful feature within gThumb.


So, this is from /gthumb-2.10.1/doc/ :


EXPR:
EXPR + EXPR
EXPR - EXPR
EXPR * EXPR
EXPR / EXPR
EXPR && EXPR
EXPR || EXPR
- EXPR
+ EXPR
! EXPR
( EXPR )
EXPR == EXPR
EXPR != EXPR
EXPR <= EXPR
EXPR >= EXPR
EXPR < EXPR
EXPR > EXPR
NUMBER
RVAR

NUMBER:
unsigned integer number

RVAR (Readable Variables):
images (integer) Total number of images being exported
image_idx (integer) Index of current image
pages (integer) Total number of index pages being generated
page_idx (integer) Index number of current index page
display_file_name_thumbnail
display_file_name_image
image_width
image_height
preview_width
preview_height
thumb_width
thumb_height
copy_originals (boolean) Original images are being copied to the web
album output directory
comment_visibility_image (bool) Show comments on preview pages
comment_visibility_index (bool) Show comments on index pages
place_visibility_image (bool) Show place on preview pages
place_visibility_index (bool) Show place on index pages
date_time_visibility_image (bool) Show date and time on preview pages
date_time_visibility_index (bool) Show date and time on index pages
file_name_visibility_image (bool) Show file name on image pages
file_name_visibility_index (bool) Show file name on index pages
image_dim_visibility_image (bool) Show image dimensions on image pages
image_dim_visibility_index (bool) Show image dimensions on index pages
file_size_visibility_image (bool) Show file size on image pages
file_size_visibility_index (bool) Show file size on index pages
exif_date_time_visibility_image (bool) Show date and time (from exif
data) on image pages
exif_date_time_visibility_index (bool) Show date and time (from exif
data) on index pages
exif_exposure_time_visibility_image (bool) Show exposure time on image pages
exif_exposure_time_visibility_index (bool) Show exposure time on index pages
exif_exposure_mode_visibility_image (bool) Show exposure mode on image pages
exif_exposure_mode_visibility_index (bool) Show exposure mode on index pages
exif_flash_visibility_image (bool) Show flash mode on image pages
exif_flash_visibility_index (bool) Show flash mode on index pages
exif_shutter_speed_visibility_image (bool) Show shutter speed on image pages
exif_shutter_speed_visibility_index (bool) Show shutter speed on index pages
exif_aperture_value_visibility_image (bool) Show aperture value on image pages
exif_aperture_value_visibility_index (bool) Show aperture value on index pages
exif_focal_length_visibility_image (bool) Show focal length on image pages
exif_focal_length_visibility_index (bool) Show focal length on index pages
exif_camera_model_visibility_image (bool) Show camera model on image pages
exif_camera_model_visibility_index (bool) Show camera model on index pages

WVAR (Writable Variables):
thumbnail_width (integer) Output thumbnails of this width
thumbnail_height (integer) Output thumbnails of this height
preview_width (integer) Output preview images of this width
preview_height (integer) Output preview images of this height

---

<gthumb:title/> Display the album title.

<gthumb:image/> Display the image.
idx="EXPR"
idx_relative="EXPR"
thumbnail="0/1" Display the image thumbnail (the
image used in the index.html file).
preview="0/1" Display the image preview (the
image in the image.html file).
max_size="EXPR"
class="NAME" Assign CSS class NAME to image element
id="NAME" Assign CSS id NAME to image element
alt="TEXT" Assign alt text TEXT to image element

<gthumb:image_link/> Display the image link
idx="EXPR"
idx_relative="EXPR"
thumbnail="0/1" Display the image thumbnail link
preview="0/1" Display the image preview link

<gthumb:image_idx/>
idx_relative="EXPR"

<gthumb:image_dim/>
idx="EXPR"
idx_relative="EXPR"

<gthumb:images/> This tag gets substituted by the total
number of images.

<gthumb:file_name/>
idx="EXPR" Display the filename of the image with
index 'idx'.

idx_relative="EXPR" Display the filename of the image with
index 'current_index + idx_relative'.
For example if idx_relative is -1 the
filename of the previous image will be
displayed.

with_path="0/1" Display the full image path instead of the
filename only.
For example '/home/joe/images/foo.jpg'
instead of 'foo.jpg'

with_relative_path="0/1" If with_path == 0 display the path relative
to the destination path.
For example if the image path is
'/home/joe/images/foo.jpg' and the index is
saved as '/home/joe/public_html/index.html'
then this tag will be substituted by
'../images/foo.jpg'

visibility="index/image/always" Choose when to display this information:
index: Display this tag if the user
chosen to display the filename
in the index caption.
image: Display this tag if the user
chosen to display the filename
in the image caption.
always: Always display this tag
regardless of what the user
chosen to display.

utf8="0/1" Write in utf-8 format

<gthumb:file_path/>
idx="EXPR"
idx_relative="EXPR"
relative_path="0/1"
visibility="index/image/always"
utf8="0/1"

<gthumb:file_size/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:comment/> Display the comment for an image
idx="EXPR"
idx_relative="EXPR"
max_size="EXPR"
visibility="index/image/always"

<gthumb:place/> Display the place where an image was taken
idx="EXPR"
idx_relative="EXPR"
max_size="EXPR"
visibility="index/image/always"

<gthumb:date_time/> Display the time when an image was taken
idx="EXPR"
idx_relative="EXPR"
max_size="EXPR"
visibility="index/image/always"

<gthumb:exif:exposure_time/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:exposure_mode/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:flash/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:shutter_speed/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:aperture_value/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:focal_length/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:date_time/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:camera_model/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:page_link/>
idx="EXPR"
idx_relative="EXPR"
image_idx="0/1"

<gthumb:page_idx/>
idx_relative="EXPR"

<gthumb:pages/>

<gthumb:table/> Output thumbnail blocks (thumbnail.gthtml)
inside an HTML table

<gthumb:thumbs/> Output thumbnail blocks (thumbnail.gthtml)
without a surrounding table structure

<gthumb:date/>

<gthumb:set_var WVAR="EXPR" WVAR="EXPR" [..] />


---

<gthumb:text> Localized text. You need to add the same
[TEXT] text in the data/albumthemes/text.h file.
</gthumb:text>

---

<gthumb:if EXPR/>
[HTML]
<gthumb:else_if EXPR/>
[HTML]
<gthumb:else_if EXPR/>
[HTML]
.
.
.
<gthumb:else_if EXPR/>
[HTML]
<gthumb:else/>
[HTML]
<gthumb:end/>

---

<gthumb:eval/>
idx=EXPR
idx_relative=EXPR
expr=EXPR Insert result of expression, maybe applied
against given image info

2 commentaires:

  1. This was VERY helpful. Thanks for posting it!

    RépondreSupprimer
  2. You're welcome !
    It's not that complicated, I do not understand why they (at gThumb) didn't communicate more about that...

    RépondreSupprimer