tgal
11 months agomason/dhandler (.thumbnail + callers): Pass in pre-scaled thumbnail.
Mark Wooding [Mon, 12 Jun 2023 10:33:57 +0000 (11:33 +0100)]
mason/dhandler (.thumbnail + callers): Pass in pre-scaled thumbnail.

The objective here is to give the caller control over the order in which
image scaling occurs.  In particular, by loading an image once and
generating the required scaled versions, we can potentially save a lot
of memory, which is a significant factor when dealing with full-size
DSLR images.

11 months agomason/dhandler (.contact): Recurse into first folder to find index image.
Mark Wooding [Mon, 12 Jun 2023 10:30:35 +0000 (11:30 +0100)]
mason/dhandler (.contact): Recurse into first folder to find index image.

This isn't always the best choice, but it's better than the plain folder
icon.

11 months agomason/.perl-lib/TrivGal.pm (listdir): Delete redundant package qualifier.
Mark Wooding [Mon, 12 Jun 2023 10:25:28 +0000 (11:25 +0100)]
mason/.perl-lib/TrivGal.pm (listdir): Delete redundant package qualifier.

11 months agomason/dhandler (.image): Compare references rather than filenames.
Mark Wooding [Sun, 11 Jun 2023 17:47:45 +0000 (18:47 +0100)]
mason/dhandler (.image): Compare references rather than filenames.

... for determining whether this is the focus image.

11 months agomason/.perl-lib/TrivGal.pm (Image::scale): Return encoded URL.
Mark Wooding [Sun, 11 Jun 2023 17:42:02 +0000 (18:42 +0100)]
mason/.perl-lib/TrivGal.pm (Image::scale): Return encoded URL.

Also, apply HTML-encoding as necessary, because I'd failed to do that.

11 months agomason/dhandler (.contact): Strip out the multiple-size machinery.
Mark Wooding [Sun, 11 Jun 2023 17:07:08 +0000 (18:07 +0100)]
mason/dhandler (.contact): Strip out the multiple-size machinery.

Also, use the same size consistently throughout.

11 months agomason/dhandler (.contact): Reformat a overly-long line.
Mark Wooding [Sun, 11 Jun 2023 16:58:27 +0000 (17:58 +0100)]
mason/dhandler (.contact): Reformat a overly-long line.

11 months agomason/dhandler (.contact): Slightly reformat trailing-`/' redirect code.
Mark Wooding [Sun, 11 Jun 2023 16:55:33 +0000 (17:55 +0100)]
mason/dhandler (.contact): Slightly reformat trailing-`/' redirect code.

11 months agomason/.perl-lib/TrivGal.pm: Append `/' to folder names.
Mark Wooding [Sun, 11 Jun 2023 16:51:46 +0000 (17:51 +0100)]
mason/.perl-lib/TrivGal.pm: Append `/' to folder names.

Probably pedantically technical.  I was considering doing this anyway,
and then noticed that folders listed in an index file (a) must have a
trailing `/' to be recognized as a folder, and (b) this doesn't get
removed in the generated contact page.

11 months agomason/.perl-lib/TrivGal.pm (Image::scale): Put `-' in temporary file name.
Mark Wooding [Sun, 11 Jun 2023 16:48:42 +0000 (17:48 +0100)]
mason/.perl-lib/TrivGal.pm (Image::scale): Put `-' in temporary file name.

After all, this what `clean_temp_files' is looking for.

11 months agomason/.perl-lib/TrivGal.pm (listdir): Set item before setting index.
Mark Wooding [Sun, 11 Jun 2023 16:45:31 +0000 (17:45 +0100)]
mason/.perl-lib/TrivGal.pm (listdir): Set item before setting index.

Otherwise we set the index to the /previous/ item, which doesn't go so
well.  I don't know why I never noticed this before.

11 months agomason/.perl-lib/TrivGal.pm: Expand a couple of compicated regices.
Mark Wooding [Sun, 11 Jun 2023 15:35:10 +0000 (16:35 +0100)]
mason/.perl-lib/TrivGal.pm: Expand a couple of compicated regices.

Yes, that is the correct plural.  Fight me.

11 months agomason/.perl-lib/TrivGal.pm (listdir): Anchor regex to line start.
Mark Wooding [Sun, 11 Jun 2023 15:29:37 +0000 (16:29 +0100)]
mason/.perl-lib/TrivGal.pm (listdir): Anchor regex to line start.

I don't think this is actually a problem, because the pattern
irrefutably matches at the start of the line anyway.  But for form's
sake, it should be properly anchored.

11 months agomason/.perl-lib/TrivGal.pm: Settle on `#' as the emergency regex delimiter.
Mark Wooding [Sun, 11 Jun 2023 15:26:49 +0000 (16:26 +0100)]
mason/.perl-lib/TrivGal.pm: Settle on `#' as the emergency regex delimiter.

11 months agomason/.perl-lib/TrivGal.pm: Remove spurious `$e'.
Mark Wooding [Sun, 11 Jun 2023 10:06:47 +0000 (11:06 +0100)]
mason/.perl-lib/TrivGal.pm: Remove spurious `$e'.

Must have been a copy-and-paste from below.

11 months agomason/.perl-lib/TrivGal.pm: Fix image flipping again, but properly.
Mark Wooding [Sun, 11 Jun 2023 10:05:33 +0000 (11:05 +0100)]
mason/.perl-lib/TrivGal.pm: Fix image flipping again, but properly.

Brown paper bag time.

11 months agomason/dhandler: Add a `scale' parameter to images.
Mark Wooding [Fri, 9 Jun 2023 21:12:00 +0000 (22:12 +0100)]
mason/dhandler: Add a `scale' parameter to images.

Just ensures that a cached thumbnail of the requested size exists and
redirects to it.  Useful for references from other pages.

11 months agomason/dhandler: Build the image a little earlier.
Mark Wooding [Fri, 9 Jun 2023 21:10:55 +0000 (22:10 +0100)]
mason/dhandler: Build the image a little earlier.

Just in case we have another use for it in mind.  Maybe.

11 months agomason/dhandler: Pass arguments to the subcomponent.
Mark Wooding [Fri, 9 Jun 2023 21:11:46 +0000 (22:11 +0100)]
mason/dhandler: Pass arguments to the subcomponent.

11 months agomason/dhandler: Delete stray debugging code.
Mark Wooding [Fri, 9 Jun 2023 21:11:28 +0000 (22:11 +0100)]
mason/dhandler: Delete stray debugging code.

11 months agomason/.perl-lib/TrivGal.pm: Flip the image correctly when asked.
Mark Wooding [Fri, 9 Jun 2023 21:09:39 +0000 (22:09 +0100)]
mason/.perl-lib/TrivGal.pm: Flip the image correctly when asked.

2 years agomason/dhandler: Announce source code through `X-AGPL-Source' HTTP header.
Mark Wooding [Thu, 12 May 2022 10:52:07 +0000 (11:52 +0100)]
mason/dhandler: Announce source code through `X-AGPL-Source' HTTP header.

2 years agomason/dhandler, mason/.perl-lib/TrivGal: Publish and use `$SRCURL'.
Mark Wooding [Thu, 12 May 2022 10:51:42 +0000 (11:51 +0100)]
mason/dhandler, mason/.perl-lib/TrivGal: Publish and use `$SRCURL'.

2 years agomason/dhandler: Add a `license' relationship to the AGPL link.
Mark Wooding [Thu, 12 May 2022 10:44:26 +0000 (11:44 +0100)]
mason/dhandler: Add a `license' relationship to the AGPL link.

There's also a `license' relation on the Creative Commons link in my
custom footer.  Let's hope this isn't too confusing.

2 years agomason/.perl-lib/TrivGal.pm: Handle EXIF `Orientation'.
Mark Wooding [Fri, 29 Apr 2022 16:50:33 +0000 (17:50 +0100)]
mason/.perl-lib/TrivGal.pm: Handle EXIF `Orientation'.

Apparently Imlib2 doesn't do this for me. :-( OpenCamera hard-rotates
its images rather than using EXIF metadata, so I didn't notice before,
but my Nikon cameras don't do this.

2 years agomason/.perl-lib/TrivGal.pm: Fix behaviour for `unreadable' directories.
Mark Wooding [Fri, 29 Apr 2022 16:49:44 +0000 (17:49 +0100)]
mason/.perl-lib/TrivGal.pm: Fix behaviour for `unreadable' directories.

They can be listed in the parent, but their contents is secret.

2 years agoIntroduce multiple thumbnail strips, and select one in a sensible way.
Mark Wooding [Fri, 24 Dec 2021 17:50:56 +0000 (17:50 +0000)]
Introduce multiple thumbnail strips, and select one in a sensible way.

Significantly, there are now multiple thumbnail strips and `focus'
thumbnails, so we need to be more intelligent about scrolling them.

2 years agomason/dhandler, static/tgal.css: Embrace idea of multiple thumbnail sets.
Mark Wooding [Fri, 24 Dec 2021 17:32:57 +0000 (17:32 +0000)]
mason/dhandler, static/tgal.css: Embrace idea of multiple thumbnail sets.

Rather than a single row of thumbnails, the code is now structured so
that it might have several at the same time, with different sizes.  CSS
media queries can control which one actually gets displayed.

Internally, we make two passes over a directory, fetching the images the
first time through, and making scaled thumbnails afterwards, and
introduce loops over the available sizes (though currently there's only
the one).

We're actually just making the same display as before, so there's still
no functional change.

2 years agomason/{.perl-lib/TrivGal,dhandler}: Make an image object.
Mark Wooding [Fri, 24 Dec 2021 17:28:03 +0000 (17:28 +0000)]
mason/{.perl-lib/TrivGal,dhandler}: Make an image object.

The objective here is to separate image loading from scaling, so that we
can make several scaled output images without having to load and decode
the original image each time.

The `.thumbnail' module now takes an image object rather than a
pathname.  There's no functional change.

2 years agoEmbrace the idea of multiple thumbnail sizes.
Mark Wooding [Thu, 23 Dec 2021 19:53:43 +0000 (19:53 +0000)]
Embrace the idea of multiple thumbnail sizes.

This is all prep work for a forthcoming change.

  * Rename the `thumb' sized to be `bigthumb', contemplating other
    thumbnail sizes.

  * Pass a `$size' argument to the `.thumbnail' module.

  * Attach the thumbnail size name as an additional class to the
    `figure' and `figcaption' classes.  (We'll add it to `thumbstrip'
    and `gallery' too, later.)

2 years agomason/dhandler: Remove pointless `/' concatenation from `join_paths' call.
Mark Wooding [Wed, 22 Dec 2021 18:25:06 +0000 (18:25 +0000)]
mason/dhandler: Remove pointless `/' concatenation from `join_paths' call.

2 years agomason/.perl-lib/TrivGal.pm: Remove final `;' after `package' blocks.
Mark Wooding [Wed, 22 Dec 2021 18:19:06 +0000 (18:19 +0000)]
mason/.perl-lib/TrivGal.pm: Remove final `;' after `package' blocks.

2 years agomason/dhandler: Mark thumbnail images as loading lazily.
Mark Wooding [Sat, 18 Dec 2021 12:59:09 +0000 (12:59 +0000)]
mason/dhandler: Mark thumbnail images as loading lazily.

2 years agostatic/tgal.css: Use flex layout for folder galleries.
Mark Wooding [Thu, 23 Dec 2021 21:59:36 +0000 (21:59 +0000)]
static/tgal.css: Use flex layout for folder galleries.

Space the elements evenly in each row.  Alas, it's hard to arrange for
lines to be broken so that each row has about the same number of items,
so that's a project for later.

2 years agostatic/tgal.css: Explicitly centre text in `figcaption'.
Mark Wooding [Thu, 23 Dec 2021 21:51:56 +0000 (21:51 +0000)]
static/tgal.css: Explicitly centre text in `figcaption'.

Don't rely on this being set up in some parent element -- 'cos it won't
be.

2 years agomason/dhandler, static/tgal.css: Use `figure' and `figcaption' elements.
Mark Wooding [Sat, 18 Dec 2021 14:00:51 +0000 (14:00 +0000)]
mason/dhandler, static/tgal.css: Use `figure' and `figcaption' elements.

2 years agomason/dhandler, static/tgal.css: Use `thumb' class, not `pic'.
Mark Wooding [Sat, 18 Dec 2021 13:59:34 +0000 (13:59 +0000)]
mason/dhandler, static/tgal.css: Use `thumb' class, not `pic'.

I don't know what I was thinking.

2 years agostatic/tgal.css: Adjust the height of the arrows again.
Mark Wooding [Sat, 25 Dec 2021 16:07:01 +0000 (16:07 +0000)]
static/tgal.css: Adjust the height of the arrows again.

*sigh*.  I really want a better approach for this.

2 years agostatic/tgal.css: Centre the thumbstrip horizontally if it's short.
Mark Wooding [Thu, 23 Dec 2021 21:57:16 +0000 (21:57 +0000)]
static/tgal.css: Centre the thumbstrip horizontally if it's short.

Using `justify-content' clips thumbnails on the left, if there are too
many to fit.  Instead, (a) set `max-width' rather than `width', and use
`align-self' to centre in the outer flex box.

2 years agostatic/tgal.css: Remove pointless `white-space: normal'.
Mark Wooding [Thu, 23 Dec 2021 20:44:24 +0000 (20:44 +0000)]
static/tgal.css: Remove pointless `white-space: normal'.

No longer neended now that `thumbstrip' uses flex layout.

2 years agostatic/tgal.css: Use flex layout for the thumbnail strip.
Mark Wooding [Thu, 16 Dec 2021 02:32:33 +0000 (02:32 +0000)]
static/tgal.css: Use flex layout for the thumbnail strip.

Using flow layout respects the whitespace between the thumbnails, which
leaves me with an annoying choice between strictly-correct rendering and
moderately well-formatted source text.

2 years agostatic/tgal.css: Enlarge the left/right arrow boxes.
Mark Wooding [Thu, 16 Dec 2021 01:11:09 +0000 (01:11 +0000)]
static/tgal.css: Enlarge the left/right arrow boxes.

I wish I could arrange to have them centred automatically, but I don't
know how to do that.  I've tried the obvious things, and they cause the
buttons to come out near the centre, but slightly offset -- by an amount
dependent on the font.  Making the arrows be images won't work properly
with Dark Reader or similar extensions.

2 years agoInitial commit.
Mark Wooding [Wed, 15 Dec 2021 12:35:30 +0000 (12:35 +0000)]
Initial commit.