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-names|n
    		quality|q=i
    		version|v
    	},
    );

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

VERSION

This manual documents App::Dthumb version 0.2

DESCRIPTION

App::Dthumb does the backend work for dthumb(1).

METHODS

$dthumb = App::Dthumb->new(%conf)

Returns a new App::Dthumb object. As you can see in the SYNOPSIS, %conf is designed so that it can be directly passed from 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.html

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

$dthumb->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.

$dthumb->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.

$dthumb->delete_old_thumbnails

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

$dthumb->get_files

Returns an array of all image files found by read_directories.

$dthumb->create_thumbnail_html($file)

Append the necessary lines for $file to the HTML.

$dthumb->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.

$dthumb->write_out_html

Write the cached HTML data to index.html.

DIAGNOSTICS

None yet.

DEPENDENCIES

* App::Dthumb::Data
* Image::Imlib2

BUGS AND LIMITATIONS

To be determined.

AUTHOR

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

LICENSE

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