App-sitelenmute

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

* Fixed incorrect thumbnail size for rotated JPGs.
* Fixed encoding of the album name.


fgallery 1.3: 2014-01-05
------------------------

* Improved browser behavior of the `back` button.
* Fixed incorrect thumbnail stretch for certain image ratios.
* Fixed empty thumbnail list in old browsers without `devicePixelRatio`.
* Fixed incorrect usage of `pngcrush`, resulting in stray PNG output files.
* Gallery generation speedup with parallelism/multi-core support (`-j`).
* Can use `p7zip` when installed for faster compression.
* Perl dependency on `Date::Parse` removed.
* Minor/cosmetic improvements.


fgallery 1.2: 2013-11-30
------------------------

* Faster loading of large galleries.

MANIFEST  view on Meta::CPAN

LICENSE
Makefile.PL
MANIFEST			This list of files
README.md
script/fcaption
script/sitelen-mute
share/album/index.css
share/album/index.html
share/album/index.js
share/fcaption.desktop
share/view/back.png
share/view/cap-always.png
share/view/cap-never.png
share/view/cap-normal.png
share/view/cut-left.png
share/view/cut-mov.png
share/view/cut-right.png
share/view/cut-top.png
share/view/download.png
share/view/eye.png
share/view/index.css
share/view/index.html
share/view/index.js
share/view/mootools-core-1.4.js
share/view/mootools-idle.js
share/view/mootools-mooswipe.js
share/view/mootools-more-1.4.js
share/view/noise.png
share/view/noscript.css
share/view/overview.css
share/view/overview.html
share/view/overview.js
share/view/overview.png
share/view/throbber.gif
t/album.t
t/album/Blaufußtölpel.jpg
t/album/Blaufußtölpel.txt
t/album/head.png
t/album/P3111190.JPG
t/album/P3111190.txt
t/album/P3111203.JPG
t/album/P3111203.txt
META.yml                                 Module YAML meta-data (added by MakeMaker)
META.json                                Module JSON meta-data (added by MakeMaker)

README.md  view on Meta::CPAN

`cmt` reads the caption from JPEG or PNG's built-in comment data. Both JPEG and
PNG have a built-in comment field, but it's not read by default as it's often
abused by editing software to put attribution or copyright information.

Captions can be controlled by the user using the speech bubble icon or by
pressing the `c` keyboard shortcut, which cycles between normal, always hidden
and always shown visualisation modes.

**-k** prevents the modification of the image files. The default is to
auto-orient images and to optimise JPEG and PNG files. Optimisation requires
`jpegoptim` or `pngcrush`.

**-o** prevents auto-orientation of images. Lossless auto-orientation requires
one of `exiftran` or `exifautotran`.

**-t** prevents sorting by time. Sorting by time is important if mixing the
pictures of multiple cameras.

**-t** reverses the album order.

**-p** prevents the inclusion of full-sized panoramas.

README.md  view on Meta::CPAN


To create the zip file: `7za` (which comes with _7-Zip_), or `zip`.

To convert previews and thumbnails to the sRGB colour space: `tificc` (which
comes with _LittleCMS2_).

To auto-orient images: `exiftran`, or `exifautotran`.

To optimise JPEG file size: `jpegoptim`.

To optimise PNG file size: `pngcrush`.

To center thumbnails on faces: `facedetect`.

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

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

`fcaption` is written in Python and requires either _PyQT4_ or _PySide2_
(Qt5). On Debian or Ubuntu, you can it with:

    sudo apt install python-pyside2

# ARCHITECTURE

_Sitelen Mute_ is composed of a backend (the `sitelen-mute` script which
generates the gallery) and a viewer (which is copied into the `view`

script/fcaption  view on Meta::CPAN

import locale

try:
    from PySide2 import QtCore, QtGui, QtWidgets
except ImportError:
    from PyQt4 import QtCore, QtGui
    QtWidgets = QtGui

APP_DESC = "Sitelen Mute image caption editor"
ENCODING = locale.getpreferredencoding()
FILE_EXT = ["jpg", "jpeg", "png", "tif", "tiff"]

if sys.version_info.major < 3:
    str = unicode


class ScaledImage(QtWidgets.QLabel):
    def __init__(self):
        super(ScaledImage, self).__init__()
        self._pixmap = QtGui.QPixmap()

script/sitelen-mute  view on Meta::CPAN

C<cmt> reads the caption from JPEG or PNG's built-in comment data. Both JPEG and
PNG have a built-in comment field, but it's not read by default as it's often
abused by editing software to put attribution or copyright information.

Captions can be controlled by the user using the speech bubble icon or by
pressing the C<c> keyboard shortcut, which cycles between normal, always hidden
and always shown visualisation modes.

B<-k> prevents the modification of the image files. The default is to
auto-orient images and to optimise JPEG and PNG files. Optimisation requires
C<jpegoptim> or C<pngcrush>.

B<-o> prevents auto-orientation of images. Lossless auto-orientation requires
one of C<exiftran> or C<exifautotran>.

B<-t> prevents sorting by time. Sorting by time is important if mixing the
pictures of multiple cameras.

B<-t> reverses the album order.

B<-p> prevents the inclusion of full-sized panoramas.

script/sitelen-mute  view on Meta::CPAN


To create the zip file: C<7za> (which comes with I<7-Zip>), or C<zip>.

To convert previews and thumbnails to the sRGB colour space: C<tificc> (which
comes with I<LittleCMS2>).

To auto-orient images: C<exiftran>, or C<exifautotran>.

To optimise JPEG file size: C<jpegoptim>.

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>

script/sitelen-mute  view on Meta::CPAN


# 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 = '';

script/sitelen-mute  view on Meta::CPAN


unless(cmd_exists('7za')) {
  $p7zip = 0;
  cmd_exists('zip') || fatal 'Missing 7z or zip command';
}
say "Found " . ($p7zip ? "7za" : "zip") if $verbose > 1;

$jpegoptim = 0 unless cmd_exists('jpegoptim');
say (($jpegoptim ? "Found" : "No") . " jpegoptim") if $verbose > 1;

$pngoptim = 0 unless cmd_exists('pngcrush');
say (($pngoptim ? "Found" : "No") . " pngcrush") if $verbose > 1;

fatal "Missing facedetect (see $facedetect_url), cannot use -f"
  if $facedet && !cmd_exists('facedetect');
say "Found facedetect" if $facedet && $verbose > 1;

fatal 'Missing tificc executable (from lcms2 library)'
  if $sRGB && !cmd_exists('tificc');
say "Found tificc" if $sRGB && $verbose > 1;
my $tificccmd = 'tificc';

script/sitelen-mute  view on Meta::CPAN

  unless ($use_orig) {
    if ($orient && $props{FileType} eq "JPEG" && ($props{Orientation} // 0)) {
      sys("$exiftrancmd '$absFout' 2>/dev/null");
      if (($props{Orientation} // 0) > 4) {
        ($props{ImageWidth}, $props{ImageHeight})
          = ($props{ImageHeight}, $props{ImageWidth});
      }
    }
    if ($jpegoptim && $props{FileType} eq "JPEG") {
      sys('jpegoptim', '-q', $absFout);
    } elsif ($pngoptim && $props{FileType} eq "PNG") {
      sys('pngcrush', '-s', $absFout, $absFtmp);
      rename($absFtmp, $absFout);
    }
  }
  chmod($filemode, $absFout);
  sys('touch', '-r', $file, $absFout);

  # intermediate sRGB colorspace conversion
  if ( !$sRGB || !defined($props{ProfileID})
              || ($props{ColorSpace} // 65535) == 1
              || ($props{DeviceModel} // '') eq 'sRGB') {

share/view/index.css  view on Meta::CPAN

  height: 100%;
}

#gallery #noise
{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url(noise.png);
  background-repeat: repeat;
}

#gallery #content
{
  position: absolute;
  top: 0;
  left: 0;
}

share/view/index.css  view on Meta::CPAN

{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#gallery #list .thumb.cut-left .ovr
{
  background: url(cut-left.png) top left repeat-y;
}

#gallery #list .thumb.cut-right .ovr
{
  background: url(cut-right.png) repeat-y top right;
}

#gallery #list .thumb.cut-left.cut-right .ovr
{
  background: url(cut-left.png) top left repeat-y, url(cut-right.png) repeat-y top right;
}

#gallery #list .thumb.cut-top .ovr
{
  background: url(cut-top.png) top left repeat-x;
}

#gallery #list .thumb.cut-bottom .ovr
{
  background: url(cut-right.png) repeat-x bottom left;
}

#gallery #list .thumb.cut-top.cut-bottom .ovr
{
  background: url(cut-left.png) top left repeat-x, url(cut-right.png) repeat-x bottom left;
}

#gallery #list .thumb.movie .ovr
{
  background: url(cut-mov.png) top left repeat-y, url(cut-mov.png) top right repeat-y;
}

/* noscript style */
#wrapper {
    display: grid;
    grid-gap: 5px;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    line-height: 0;
}

share/view/index.js  view on Meta::CPAN

    capst = 'always';
  else
    capst = 'normal';
  // update visual state
  if(capst == 'never')
    hideCap(true);
  else if(ecap.eidx == eidx)
    showCap(true);
  // update indicator
  var img = document.id('togglecap', ehdr);
  img.src = 'view/cap-' + capst + '.png';
  showHdr();
}

function setSlideshowOff()
{
  if(slideshow == 'off') return;
  idle.removeEvent('idle', next);
  showHdr();
  elist.setStyle('display', 'block');
  slideshow = 'off';

share/view/index.js  view on Meta::CPAN

  resize();
}

function setupHeader()
{
  ehdr.empty();
  var el;
  if(imgs.index)
  {
    el = new Element('a', { 'title': 'Back to index', 'href': encodeURI(imgs.index) });
    el.set('html', '<img src="view/back.png"/>');
    ehdr.adopt(el);
  }
  if(imgs.data[eidx].file)
  {
    var file = encodeURI(imgs.data[eidx].file[0]);
    el = new Element('a', { 'title': 'Download image', 'href': file });
    el.set('html', '<img src="view/eye.png"/>');
    ehdr.adopt(el);
  }
  if(imgs.download)
  {
    el = new Element('a', { 'title': 'Download album', 'href': imgs.download });
    el.set('html', '<img src="view/download.png"/>');
    ehdr.adopt(el);
  }
  if(imgs.captions)
  {
    el = new Element('a', { 'title': 'Toggle captions' });
    el.setStyle('cursor', 'pointer');
    el.addEvent('click', toggleCap);
    var img = new Element('img', { 'id': 'togglecap', 'src': 'view/cap-' + capst + '.png' });
    img.inject(el);
    el.inject(ehdr);
  }
  if(imgs.data[eidx].date)
    ehdr.adopt(new Element('span', { 'title': 'EXIF timestamp', 'html': imgs.data[eidx].date }));
  el = new Element('a', { 'title': 'Overview', 'href': 'view/overview.html' });
  el.set('html', '<img src="view/overview.png"/>');
  ehdr.adopt(el);
  ehdr.setStyle('display', (ehdr.children.length? 'block': 'none'));
  ehdr.removeEvent('click', toggleSlideshow);
}

function onMainReady()
{
  resizeMainImg(eimg);
  eimg.setStyle('opacity', 0);
  eimg.addClass('current');

share/view/index.js  view on Meta::CPAN

    isSuccess: function()
    {
      return (!this.status || (this.status >= 200 && this.status < 300));
    },
    onSuccess: initGallery,
    onFailure: initFailure
  }).get();

  // preload some resources
  Asset.images([
    'view/throbber.gif', 'view/overview.png', 'view/eye.png',
    'view/download.png', 'view/back.png', 'view/cap-normal.png',
    'view/cap-always.png', 'view/cap-never.png', 'view/cut-left.png',
    'view/cut-right.png', 'view/cut-top.png', 'view/cut-mov.png'
   ]);
}

window.addEvent('domready', init);



( run in 2.413 seconds using v1.01-cache-2.11-cpan-df04353d9ac )