NAME

App::Dthumb - Generate thumbnail index for a set of images

SYNOPSIS

use App::Dthumb;
use Getopt::Long qw(:config no_ignore_case);

my $opt = {};

GetOptions(
	$opt,
	qw{
		help|h
		size|d=i
		spacing|s=f
		no-lightbox|L
		no-names|n
		quality|q=i
		version|v
	},
);

my $dthumb = App::Dthumb->new($opt);
$dthumb->run();

VERSION

This manual documents App::Dthumb version 0.2

METHODS

new($conf)

Returns a new App::Dthumb object. As you can see in the SYNOPSIS, $conf is designed so that it can be directly fed by Getopt::Long.

Valid hash keys are:

dir_images => directory

Set base directory for image reading, data creation etc.

Default: . (current working directory)

file_index => file

Set name of the html index file

Default: index.xhtml

Include and use javascript lightbox code

Default: true

recreate => bool

If true, unconditionally recreate all thumbnails.

Default: false

size => int

Maximum image size in pixels, either width or height (depending on image orientation)

Default: 200

spacing => float

Spacing between image boxes. 1.0 means each box is exactly as wide as the maximum image width (see size), 1.1 means slightly larger, et cetera

Default: 1.1

names => bool

Show image name below thumbnail

Default: true

quality => 0 .. 100

Thumbnail image quality

Default: 75

read_directories

Read in a list of all image files in the current directory and all files in .thumbs which do not have a corresponding full-size image.

create_files

Makes sure the .thumbs directory exists.

Also, if lightbox is enabled (which is the default), creates the .dthumb directory and fills it with all required files.

delete_old_thumbnails

Unlink all no longer required thumbnails (as previously found by read_directories).

get_files

Returns an array of all image files found by read_directories.

create_thumbnail_html($file)

Append the necessary lines for $file to the HTML.

create_thumbnail_image($file)

Load $file and save a resized version in .thumbs/$file. Skips thumbnail generation if the thumbnail already exists and has a more recent mtime than the original file.

write_out_html

Write the cached HTML data to index.xhtml.

DEPENDENCIES

  • App::Dthumb::Data

  • Image::Imlib2

AUTHOR

Copyright (C) 2009-2011 by Daniel Friesel <derf@chaosdorf.de>

LICENSE

0. You just DO WHAT THE FUCK YOU WANT TO.