niol / lazygal Goto Github PK
View Code? Open in Web Editor NEWStatic web gallery generator
Home Page: https://sml.zincube.net/~niol/repositories.git/lazygal/about/
License: GNU General Public License v2.0
Static web gallery generator
Home Page: https://sml.zincube.net/~niol/repositories.git/lazygal/about/
License: GNU General Public License v2.0
If you have a thumbnail page of mixed landscape and portrait photos, the right hand side of the thumbnails is jagged and not a straight line.
It would be more enjoyable to look at if the thumbnails could be justified somehow or spaced so that this did not occur.
This page http://stackoverflow.com/questions/9700213/justify-alignment-of-images-in-rows-ala-google-images has a solution.
I have a lot of video files from old cameras with no audio. The GStreamer conversion to webm fails on those files. If I add a silent audio track using ffmpeg, the conversion works but I don't want to have to do that for all the files.
On small screens like mobile phones, when viewing a main image (not an index of images), the next/previous images appear on top of the main image. I was able to make next/previous images invisible if they overlap the main image by adding this to SHARED_basic.css:
div#image_img img {
position: relative;
z-index: 1;
}
This is for lazygal version 0.10.2.
Lazygal does not seem to support HEIF images. HEIF
Newer Apple devices such as iPhone or iPads take photos in the HEIF format[1]. These photos are using the .heic extension.
Lazygal does not seem to include the .heic files in the generated gallery.
Lazygal seems to use the Pillow module for image manipulation. Pillow seems to support the HEIF format[2], so I see no reason that lazygal shouldn't automatically include .heic images present in the source folder.
The pyheif package seems to enable HEIF support with Pillow.
I have upgraded to 0.9.4 (for the no-video
option: nice work!) and got the following error message on running:
Theme inverted: manifest.json reference error: files not found:
/usr/local/share/lazygal/themes/inverted/jquery.js
The following actions may fix this:
- Running ./setup.py dl_asset
- Installing deps from your distribution
It took me a while to work out that the correct command is dl_assets
with the "s" on the end.
This typo is in themes.py
line 136 at time of writing.
this is one of the best gallery generators i've found that handles images/videos and its very simple.
my request being adding support for the -hwaccel flag for ffmpeg to use GPU to speed up transcoding greatly.
i tried modifying the mediautils.py to add in the -hwaccel flag but i'm not much familar with python but it seems like it would be easy to specify hwaccel and possibly more flags for nvidia specific cards.
I'm new to lazygal so I might have misunderstood something, but if I generate exactly from the same source directory, it works, but not with --webalbum-pic-bg
:
$ lazygal -o TARGET_DIR --webalbum-pic-bg=#000 --check-all-dirs --webalbum-pic-type messy SOURCE_DIR
[Entering %ALBUMROOT%/]
DUMPJSON index.json
MKDIR %WEBALBUMROOT%/
BREAKING web gallery into multiple pages
RESIZE 5269_IMG_small.jpg
[...]
XHTML 5223_IMG_medium.html
XHTML index_medium.html
DIRPIC index.jpg
Progress: dir 0/1 (0%), media 70/70 (100%)Traceback (most recent call last):
File "/usr/lib64/python3.9/site-packages/PIL/JpegImagePlugin.py", line 610, in _save
rawmode = RAWMODE[im.mode]
KeyError: 'RGBA'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/bin/lazygal", line 294, in <module>
album.generate(progress=progress)
File "/usr/lib/python3.9/site-packages/lazygal/generators.py", line 943, in generate
destgal.make()
File "/usr/lib/python3.9/site-packages/lazygal/generators.py", line 667, in make
super().make(force)
File "/usr/lib/python3.9/site-packages/lazygal/make.py", line 123, in make
d.make() # dependency building not forced
File "/usr/lib/python3.9/site-packages/lazygal/make.py", line 124, in make
self.call_build()
File "/usr/lib/python3.9/site-packages/lazygal/make.py", line 133, in call_build
self.build()
File "/usr/lib/python3.9/site-packages/lazygal/genmedia.py", line 290, in build
self.dirpic.write(self.path)
File "/usr/lib/python3.9/site-packages/lazygal/eyecandy.py", line 142, in write
self.picture_mess.save(output_file)
File "/usr/lib64/python3.9/site-packages/PIL/Image.py", line 2164, in save
save_handler(self, fp, filename)
File "/usr/lib64/python3.9/site-packages/PIL/JpegImagePlugin.py", line 612, in _save
raise OSError(f"cannot write mode {im.mode} as JPEG") from e
OSError: cannot write mode RGBA as JPEG
I tried different colors: black, Black, #000, DarkBlue, all give the same result (I removed the target directory before each try)
lazygal-0.10.2-1.fc34.noarch (Fedora 34), Python 3.9 and the following dependencies:
$ rpm -qa | grep -i -e pillow -e genshi -e gexiv2 -e ffmpeg
python3-genshi-0.7.5-3.fc34.noarch
libgexiv2-0.12.2-2.fc34.x86_64
python3-gexiv2-0.12.2-2.fc34.x86_64
compat-ffmpeg28-2.8.17-4.fc34.x86_64
python3-pillow-8.1.2-3.fc34.x86_64
ffmpeg-libs-4.4-4.fc34.x86_64
ffmpeg-4.4-4.fc34.x86_64
It would be nice if lazygal supported gif images.
I've got a new phone recently that can create looping videos easily that can then be converted to looping gif images. But as far as I can tell, lazygal can't currently process them - if there are gif images in the input folder together with jpegs and mp4 files, the gif images will be ignored and left out of the generated gallery.
In general, nothing fancy would be needed - just including the images 1:1 in the gallery should be enough, no scaling and etc. is really necessary.
Hi,
when building lazygal with python 3.10, I get this warning:
$ python3 ./setup.py
/home/ubuntu/git/packages/lazygal/lazygal/./setup.py:20: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
from distutils.core import setup, Command
/home/ubuntu/git/packages/lazygal/lazygal/./setup.py:21: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
import distutils.sysconfig
PEP-632 is at https://www.python.org/dev/peps/pep-0632/
Porting from distutils: https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html
The advice for disutils.sysconfig
is to use the stdlib sysconfig
module.
The code in mediautils.py:35 appears to "detect" FFmpeg presence, but doesn't seem to use the result of the test. The testsuite is then failing if ffmpeg
or ffprobe
binaries are not in PATH
:
======================================================================
ERROR: test_video (lazygaltest.test_metadata.TestFileMetadata)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/lazygal-0.10/lazygaltest/test_metadata.py", line 260, in test_video
vid_md = metadata.VideoInfoTags(self.get_sample_path(sample))
File "/builddir/build/BUILD/lazygal-0.10/lazygal/metadata.py", line 444, in __init__
videoinfo = mediautils.VideoInfo(path).inspect()
File "/builddir/build/BUILD/lazygal-0.10/lazygal/mediautils.py", line 103, in inspect
info = subprocess.check_output(['ffprobe', '-v', 'error',
File "/usr/lib64/python3.9/subprocess.py", line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib64/python3.9/subprocess.py", line 501, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib64/python3.9/subprocess.py", line 947, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib64/python3.9/subprocess.py", line 1819, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe'
======================================================================
ERROR: test_withvideo (lazygaltest.test_generators.TestGenerators)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/lazygal-0.10/lazygaltest/test_generators.py", line 604, in test_withvideo
silencer.convert(os.path.join(source_subgal.path, 'vid-silent.mov'))
File "/builddir/build/BUILD/lazygal-0.10/lazygal/mediautils.py", line 86, in convert
logging.debug('RUNNING %s' % ' '.join(runcmd))
TypeError: sequence item 0: expected str instance, NoneType found
I guess I'm requesting for the above two tests to be skipped if FFmpeg is not installed. FFmpeg can't be included in official Fedora repositories for legal reasons, so I don't have the option to have FFmpeg installed when building the official Fedora lazygal package.
How about allowing to import from multiple sources? I would much rather point lazygal
at a couple of existing directories with photos than first having to copy those all to a temporary directory just for running lazygal
once.
It shall be possible to access arbitrary metadata tags from the templates.
Lazygal v 0.10.5
If I run lazygal multiple times on the same directory tree, the number of images reported for each subdir in the main index page is incremented every time although no pictures were added. Only way to reset the counters seems to be to manually remove the index.json file.
lazygal version 0.10 from debian testing repo.
Generating from a directory, the program starts adding files and then raises an exception:
> lazygal /target
[Entering %ALBUMROOT%/]
[...]
Progress: dir 0/1 (0%), media 0/403 (0%)Traceback (most recent call last):
File "/usr/bin/lazygal", line 294, in <module>
album.generate(progress=progress)
File "/usr/lib/python3/dist-packages/lazygal/generators.py", line 943, in generate
destgal.make()
File "/usr/lib/python3/dist-packages/lazygal/generators.py", line 667, in make
super().make(force)
File "/usr/lib/python3/dist-packages/lazygal/make.py", line 120, in make
self.call_populate_deps()
File "/usr/lib/python3/dist-packages/lazygal/make.py", line 43, in call_populate_deps
self.populate_deps()
File "/usr/lib/python3/dist-packages/lazygal/generators.py", line 367, in populate_deps
media_task = WebalbumImageTask(self, media)
File "/usr/lib/python3/dist-packages/lazygal/generators.py", line 260, in __init__
super().__init__(webgal, image)
File "/usr/lib/python3/dist-packages/lazygal/generators.py", line 216, in __init__
self.browse_pages[size_name] = self.get_browse_page(size_name)
File "/usr/lib/python3/dist-packages/lazygal/generators.py", line 247, in get_browse_page
return genpage.WebalbumBrowsePage(self.webgal, size_name, self)
File "/usr/lib/python3/dist-packages/lazygal/genpage.py", line 96, in __init__
self.add_dependency(self.webalbum_media.original)
File "/usr/lib/python3/dist-packages/lazygal/make.py", line 57, in add_dependency
raise RuntimeError('adding same dep twice')
All dependencies have been installed: apt install -t testing ffmpeg exiv2 doc-base python-genshi-doc python-pil-doc python3-pil-dbg
I have not looked into this very deeply, sorry.
It shall possible to exclude some tags using the '!' char, for instance using --filter-by-tag=!baby
should exclude baby pics.
I'm not sure what's going on here, but the test_usercomment_empty_and_encoding
appears to be failing on Fedora rawhide:
======================================================================
FAIL: test_usercomment_empty_and_encoding (lazygaltest.test_metadata.TestFileMetadata)
Exif.Photo.UserComment: charset="Ascii"
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/lazygal-0.10/lazygaltest/test_metadata.py", line 184, in test_usercomment_empty_and_encoding
self.assertEqual(im_md.get_comment(), u'Jasper the Bear')
AssertionError: 'binary comment' != 'Jasper the Bear'
- binary comment
+ Jasper the Bear
I'm using python 3.9.0rc1 and gexiv2 0.12.1 here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.