App-sitelenmute

 view release on metacpan or  search on metacpan

script/sitelen-mute  view on Meta::CPAN


To optimise PNG file size: C<pngcrush>.

To center thumbnails on faces: C<facedetect>.

On Debian or Ubuntu, you can all the dependencies with:

    sudo apt install \
      imagemagick p7zip liblcms2-utils exiftran \
      jpegoptim pngcrush facedetect

C<fcaption> is written in Python and requires either I<PyQT4> or I<PySide2>
(Qt5). On Debian or Ubuntu, you can it with:

    sudo apt install python-pyside2

=head1 ARCHITECTURE

I<Sitelen Mute> is composed of a backend (the F<sitelen-mute> script which
generates the gallery) and a viewer (which is copied into the F<view>
directory). The two are designed to be used independently.

The backend just cares about generating the image previews and the
album data. All the presentation logic however is inside the viewer.

It's relatively easy to generate the album data dynamically and just
use the viewer. This was Yuri D'Elia's aim when they started to develop
*fgallery*, as it's much easier to just modify an existing CMS instead
of trying to reinvent the wheel. All a backend has to do is provide a
valid "data.json" at some prefixed address.

=head1 TODO

Videos.

"Live" images as created by iPhones consisting of a JPEG cover image and a very
short video.

=head1 HISTORY

I<Sitelen Mute> grew out of I<fgallery> by Yuri D'Elia because the author said
that their mind is "on other projects".
L<https://github.com/wavexx/fgallery/pull/76#issuecomment-368947439>

=head1 LICENSE

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.

=cut

use Modern::Perl '2018';
use open ':std', ':encoding(utf8)';
use utf8;

our $VERSION = "3.0.0";

use Digest::SHA;
use Encode qw(decode decode_utf8 encode_utf8);
use Encode::Locale;
use File::Basename qw(fileparse);
use File::Copy::Recursive qw(dircopy);
use File::Path qw{make_path remove_tree};
use File::ShareDir qw(dist_dir);
use File::Slurper qw(read_text write_text read_dir read_binary write_binary);
use File::Spec::Functions qw(rel2abs canonpath catfile splitpath);
use File::Symlink::Relative; # symlink_r
use Getopt::Long qw(:config bundling);
use Image::ExifTool qw(ImageInfo);
use JSON::Tiny qw(decode_json encode_json);
use List::Util qw(min max none);
use Time::Piece; # strptime, strftime
use Time::Progress;

# our name ;-)
my $me = (splitpath($0))[2];
# view subdirectory where the JavaScript and CSS code lives
my $viewdir = catfile(dist_dir('App-sitelenmute'), 'view');
umask oct('0022');

# defaults
my $facedetect_url = 'http://www.thregr.org/~wavexx/hacks/facedetect/';
my $filemode = oct('0644');
my $slim = 0;
my $include = 0;
my $orient = 1;
my $timesort = 1;
my $revsort = 0;
my %filetypes = map { $_ => 1 } qw{JPEG PNG TIFF};
my $extensions = join("|", qw{jpg jpeg png tif tiff});
my $ext = "jpg";
my @minthumb = (150, 112);
my @maxthumb = (267, 200);
my @maxfull = (1600, 1200);
my $imgq = 90;
my $fullpano = 1;
my $nodown = 0;
my $panort = 2.;
my $facedet = 0;
my $use_orig = 0;
my $jpegoptim = 1;
my $pngoptim = 1;
my $p7zip = 1;
my $verbose = 0;
my $sRGB = 1;
my $do_blur = 1;
my $indexUrl = undef;
my %captions = map { $_ => 1} qw{txt xmp exif cmt};
my @captions = keys %captions;
my $galleryTitle = '';
my $galleryDescription = '';
my $galleryUrl = '';



( run in 0.559 second using v1.01-cache-2.11-cpan-a1f116cd669 )