summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-04-08 11:59:16 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-04-08 11:59:16 +0200
commit9b243c81dac2a08e3cc1436d28903433b7c6f1da (patch)
tree060cee9978182736c7dde97e4a0fdca33518080b
parent8a3a3d1e723a0e5b803ebf9f122c28d1d1052208 (diff)
add optional HTML include header
-rwxr-xr-xbin/dthumb5
-rwxr-xr-xlib/App/Dthumb.pm6
2 files changed, 10 insertions, 1 deletions
diff --git a/bin/dthumb b/bin/dthumb
index 32931f9..6e94c84 100755
--- a/bin/dthumb
+++ b/bin/dthumb
@@ -24,6 +24,7 @@ GetOptions(
$opt,
qw{
all|a
+ header=s
help|h
no-names|n
quality|q=i
@@ -137,6 +138,10 @@ no border at all, etc.
Set HTML document title. Defaults to the basename of the current directory
+=item B<--header> I<file>
+
+Include I<file> contents in the generated HTML, right after the opening div tag.
+
=item B<-q>, B<--quality> I<int> (default: 75)
Set thumbnail quality.
diff --git a/lib/App/Dthumb.pm b/lib/App/Dthumb.pm
index 0223016..74face3 100755
--- a/lib/App/Dthumb.pm
+++ b/lib/App/Dthumb.pm
@@ -7,7 +7,7 @@ use 5.010;
use App::Dthumb::Data;
use Cwd;
use File::Copy qw(copy);
-use File::Slurp qw(read_dir write_file);
+use File::Slurp qw(read_dir read_file write_file);
use Image::Imlib2;
our $VERSION = '0.2';
@@ -45,6 +45,10 @@ sub new {
$ref->{html} = $ref->{data}->get('html_start.dthumb');
+ if ( $conf{header} ) {
+ $ref->{html} .= read_file( $conf{header} );
+ }
+
return bless( $ref, $obj );
}