From c2ccc508bdccc10febd1c0cc4b12d73a757aae72 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 28 Dec 2016 11:41:37 +0100 Subject: some documentation updates --- bin/dthumb | 42 ++++++++++++++++++------------------------ lib/App/Dthumb.pm | 26 +++++++++----------------- 2 files changed, 27 insertions(+), 41 deletions(-) diff --git a/bin/dthumb b/bin/dthumb index 863d60f..0ba3e89 100755 --- a/bin/dthumb +++ b/bin/dthumb @@ -1,5 +1,5 @@ #!/usr/bin/perl -# Copyright © 2009-2011 by Daniel Friesel +# Copyright © 2009-2016 by Daniel Friesel # License: WTFPL: # You just DO WHAT THE FUCK YOU WANT TO use strict; @@ -27,7 +27,6 @@ GetOptions( no-names|n quality|q=i recreate|r - shadowbox|S size|d=i spacing|s=f title|t=s @@ -72,26 +71,23 @@ __END__ =head1 NAME -dthumb - Generate Thumbnails + Index for a set of images +dthumb - Generate file index with thumbnails for a directory. =head1 SYNOPSIS -B [I] +B [B<-nr>] [B<-d> I] [B<-s> I] [B<-t> I] +[B<-q> I<quality>] =head1 VERSION -This manual documents B<dthumb> version 0.2 +version 0.2 =head1 DESCRIPTION -B<dthumb> will create an F<index.xhtml> with a list (thumbnails) of -all images found in the current directory; the thumbnails will link to the -images. - -It uses a javascript lightbox (see -E<lt>http://www.huddletogether.com/projects/lightbox/E<gt>) to display the -images. To view them without the lightbox, either disable it using the B<-L> -option or open images by clicking on the filename instead of the thumbnail. +B<dthumb> creates an HTML index with thumbnails for all images found in the +current directory. It uses a javascript lightbox (see +L<http://fancyapps.com/fancybox/>) to display images. To view them without the +lightbox, open images by clicking on the filename instead of the thumbnail. Note that recursion is not yet supported. @@ -109,29 +105,27 @@ Do not show image names below thumbnails Recreate all thumbnails -=item B<-d>, B<--size> I<pixels> +=item B<-d>, B<--size> I<maxsize> (default: 200) -Maximum thumbnail size (either width or height). Defaults to 200 +Set maximum thumbnail size. Thumbnails are created so that neither width nor +height exceed I<maxsize> pixels. -=item B<-s>, B<--spacing> I<float> +=item B<-s>, B<--spacing> I<float> (default: 1.1) Use I<float> as spacing factor. -The size of each image element (image + possible border around it) is the +The size of each image element (image + border around it) is the number of pixels (see --size) times I<float>. So for B<1.1> you have a small border around each image, for B<1.0> you have no border at all, etc. -Defaults to 1.1 - =item B<-t>, B<--title> I<string> Set HTML document title. Defaults to the basename of the current directory -=item B<-q>, B<--quality> I<int> +=item B<-q>, B<--quality> I<int> (default: 75) Set thumbnail quality. Accepts values between 0 and 100, where 100 is the highest possible quality. -Default is 75 =back @@ -146,10 +140,10 @@ None. =head1 FILES B<dthumb> always works in the current working directory. It will create the -file F<index.xhtml>, in which the HTML code for the thumbnail list is saved. +file F<index.html>, in which the HTML code for the thumbnail list is saved. It also creates two directories: F<.thumbs> for the thumbnail images, and -F<.dthumb>, which contains various data (so far icons and javascript code). +F<.dthumb> for CSS and lightbox code. =head1 DEPENDENCIES @@ -183,6 +177,6 @@ For this program: 0. You just DO WHAT THE FUCK YOU WANT TO -For the fancybox code (part of the generated HTML): +For the lightbox code (part of the generated HTML): CC-BY-NC 3.0 diff --git a/lib/App/Dthumb.pm b/lib/App/Dthumb.pm index 3dd76d8..5e6aabe 100755 --- a/lib/App/Dthumb.pm +++ b/lib/App/Dthumb.pm @@ -223,7 +223,6 @@ App::Dthumb - Generate thumbnail index for a set of images help|h size|d=i spacing|s=f - no-lightbox|L no-names|n quality|q=i version|v @@ -231,7 +230,7 @@ App::Dthumb - Generate thumbnail index for a set of images ); my $dthumb = App::Dthumb->new($opt); - $dthumb->run(); + $dthumb->run; =head1 VERSION @@ -239,7 +238,7 @@ This manual documents App::Dthumb version 0.2 =head1 DESCRIPTION -App::Dthumb does all the backend work for dthumb(1). +App::Dthumb does the backend work for dthumb(1). =head1 METHODS @@ -266,12 +265,6 @@ Set name of the html index file Default: F<index.html> -=item B<lightbox> => I<bool> - -Include and use javascript lightbox code - -Default: true - =item B<recreate> => I<bool> If true, unconditionally recreate all thumbnails. @@ -306,24 +299,24 @@ Default: 75 =back -=item $dthumb->read_directories() +=item $dthumb->read_directories Read in a list of all image files in the current directory and all files in F<.thumbs> which do not have a corresponding full-size image. -=item $dthumb->create_files() +=item $dthumb->create_files Makes sure the F<.thumbs> directory exists. Also, if lightbox is enabled (which is the default), creates the F<.dthumb> directory and fills it with all required files. -=item $dthumb->delete_old_thumbnails() +=item $dthumb->delete_old_thumbnails Unlink all no longer required thumbnails (as previously found by B<read_directories>). -=item $dthumb->get_files() +=item $dthumb->get_files Returns an array of all image files found by B<read_directories>. @@ -337,7 +330,7 @@ Load F<$file> and save a resized version in F<.thumbs/$file>. Skips thumbnail generation if the thumbnail already exists and has a more recent mtime than the original file. -=item $dthumb->write_out_html() +=item $dthumb->write_out_html Write the cached HTML data to F<index.html>. @@ -359,12 +352,11 @@ None yet. =head1 BUGS AND LIMITATIONS -So far, this module is pretty focused on working with dthumb(1). It is -planned to make it somewhat more universal. +To be determined. =head1 AUTHOR -Copyright (C) 2009-2011 by Daniel Friesel E<lt>derf@chaosdorf.deE<gt> +Copyright (C) 2009-2016 by Daniel Friesel E<lt>derf@chaosdorf.deE<gt> =head1 LICENSE -- cgit v1.2.3