Compare commits

...

3 Commits

Author SHA1 Message Date
Přemysl Eric Janouch 9e22bd0e20
gallery: improve the README
Alpine 3.19 Success Details
Debian Bookworm Success Details
2024-01-27 18:30:57 +01:00
Přemysl Eric Janouch d27d8655bb
gallery: make it reverse proxy friendly 2024-01-27 18:09:48 +01:00
Přemysl Eric Janouch 6d75ec60bf
gallery: go back to ImageMagick v6
To cater to Debian.
2024-01-27 18:09:07 +01:00
3 changed files with 30 additions and 8 deletions

View File

@ -8,10 +8,32 @@ and query your collections in various ways.
All media is content-addressed by its SHA-1 hash value, and at your option
also perceptually hashed. Duplicate search is an essential feature.
Prerequisites: Go, ImageMagick v7, xdg-utils
The gallery is designed for simplicity, and easy interoperability.
sqlite3, curl, jq, and the filesystem will take you a long way.
Prerequisites: Go, ImageMagick, xdg-utils
ImageMagick v7 is preferred, it doesn't shoot out of memory as often.
Getting it to work
------------------
# apt install build-essential git golang imagemagick xdg-utils
$ git clone https://git.janouch.name/p/gallery.git
$ cd gallery
$ make
$ ./gallery init G
$ ./gallery sync G ~/Pictures
$ ./gallery thumbnail G # parallelized, with memory limits
$ ./gallery -threads 1 thumbnail G # one thread only gets more memory
$ ./gallery dhash G
$ ./gallery web G :8080
The intended mode of use is running daily automated sync/thumbnail/dhash/tag
batches in a cron job, or from a system timer. See _test.sh_ for usage hints.
batches in a cron job, or from a systemd timer.
The _web_ command needs to see the _public_ directory,
and is friendly to reverse proxying.
Demo
----
https://holedigging.club/gallery/

View File

@ -1377,7 +1377,7 @@ func syncIsImage(path string) (bool, error) {
}
func syncPingImage(path string) (int, int, error) {
out, err := exec.Command("magick", "identify", "-limit", "thread", "1",
out, err := exec.Command("identify", "-limit", "thread", "1",
"-ping", "-format", "%w %h", path+"[0]").Output()
if err != nil {
return 0, 0, err
@ -2321,7 +2321,7 @@ func makeThumbnail(load bool, pathImage, pathThumb string) (
//
// TODO: See if we can optimize resulting WebP animations.
// (Do -layers optimize* apply to this format at all?)
cmd := exec.Command("magick", "-limit", "thread", "1",
cmd := exec.Command("convert", "-limit", "thread", "1",
// Do not invite the OOM killer, a particularly unpleasant guest.
"-limit", "memory", memoryLimit,

View File

@ -10,7 +10,7 @@ function call(method, params) {
callActive++
return m.request({
method: "POST",
url: `/api/${method}`,
url: `api/${method}`,
body: params,
}).then(result => {
callActive--
@ -98,7 +98,7 @@ let Thumbnail = {
if (!e.thumbW || !e.thumbH)
return m('.thumbnail.missing', {...vnode.attrs, info: null})
return m('img.thumbnail', {...vnode.attrs, info: null,
src: `/thumb/${e.sha1}`, width: e.thumbW, height: e.thumbH,
src: `thumb/${e.sha1}`, width: e.thumbW, height: e.thumbH,
loading})
},
}
@ -494,7 +494,7 @@ let View = {
view(vnode) {
const view = m('.view', [
ViewModel.sha1 !== undefined
? m('img', {src: `/image/${ViewModel.sha1}`,
? m('img', {src: `image/${ViewModel.sha1}`,
width: ViewModel.width, height: ViewModel.height})
: "No image.",
])