2
0
mirror of https://github.com/thumbsup/thumbsup synced 2024-11-17 15:25:50 +00:00
Commit Graph

179 Commits

Author SHA1 Message Date
Romain
f66208e052 New options for the {{date}} helper: custom date format + how long ago 2017-11-29 21:11:12 +11:00
Romain
515ce3e8c1 Fix bug in #compare and #times Handlebars templates introduced in 3e0982e
When declared with () => instead of function (), the context is missing from child blocks.
2017-11-29 20:58:13 +11:00
Romain
d7d01adc82 Fix #78: ignore invalid photos / videos
The current code doesn't create an output structure for them, so we don't create thumbnails.
This is good since the thumbnail generation would likely fail.

However we still try to render thumbnails in the themes.
The themes could be smart enough to skip invalid files, but it's easier to ignore them from the start.
2017-11-28 21:54:26 +11:00
Romain
d19a230a6c Cleanup unused code 2017-11-28 21:50:44 +11:00
Romain
3e098e2328 Extract Handlebars helpers to prepare for theme structure + add unit tests 2017-11-28 07:53:51 +11:00
Romain
cbf8a1f3b4 Don’t index media from Synology thumbnail folders (@eaDir) nor folders starting with “.” 2017-11-26 22:32:03 +11:00
Romain
ac520d40ad Fix case insensitive glob + add unit tests for globbing 2017-11-26 21:21:15 +11:00
Romain
24b2f9bd7c Major optimisations: SQLite index + faster disk glob + new exiftool streaming
1. Move from a JSON index to a SQLite database.
  - This allows the indexing to be interrupted & resumed
  - Updating the index consumes less RAM than loading / saving an entire JSON object
  - Loading the index consumes less RAM since it can be streamed, only exacting the properties we need every time (instead of loading all EXIF data in memory, only to discard most of it later)
  - These make a big difference when processing 10,000+ photos

2. Switch from <glob> to a manual <readdir>
  - Glob would take several hundred or GB of RAM when asked to find several thousand files
  - Manual approach with <micromatch> library does the same thing in a fraction of the time / memory usage

3. Exiftool optimisations
  - Run 1 exiftool process per CPU, still in batch mode (divide all files to be read into 1 bucket per CPU)
  - Stream the exiftool output instead of buffering it in memory
2017-11-24 22:08:59 +11:00
Romain
30f203af4b Render progress using Listr + split the main process into "steps" which are easier to test 2017-11-06 00:02:42 +11:00
Romain
b92724472e Fix #71: read both Quicktime CreationDate and CreateDate 2017-08-13 21:28:00 +10:00
Romain
0b27d37881 Read metadata from Picasa.ini if present 2017-08-07 22:53:04 +10:00
Romain
3e64d2ab38 Create a Metadata model attached to input files
- for easier unit testing
- to enable input filtering (e.g. only include photos with this keyword)
2017-08-07 22:52:26 +10:00
Romain
d24c5110cc Fix #70: files in the root of the source folder get added to the root gallery (index.html)
Before, they were added to an album called “.” which didn’t look good,
and the corresponding “.html” file (no base name) caused issues on web servers
2017-07-22 21:25:43 +10:00
Romain
ac67a08da9 Use new “downsize” package that was split out (to make testing edge cases easier) 2017-07-15 20:22:46 +10:00
Romain
dc40fbac09 Fix inferring data from the filename: was getting confused if the folder contained digits 2017-06-14 17:43:38 +10:00
Romain
80f7a88c35 Fix #61: new options to avoid copying original photos to the output folder 2017-06-03 21:25:41 +10:00
Romain
6fde22e9d1 Fix #62: crash prevented the error message from showing when migrating from V1 to V2 2017-05-24 17:49:43 +10:00
Romain
1df4ee48f3 Fix #63: run ffmpeg using <spawn> and don't buffer stdout/stderr 2017-04-03 17:33:27 +10:00
Romain
3531f1e533 Try to infer dates from the filename if there is no "date" metadata 2017-04-01 00:07:04 +11:00
Romain
a7ad8dc9fc Fix reading the original creation date of QuickTime and H264 movies 2017-03-19 00:12:21 +11:00
Romain
9a24acc6df Fix copying of --original-photos 2017-03-15 23:56:37 +11:00
Romain
91e55daf9b Upgrade VideoJS to 5.17 2017-03-11 10:05:27 +11:00
Romain
9c78c1cd79 Rename album sorting function for clarity (they don't take a raw File, but a Media object) 2017-03-09 23:22:12 +11:00
Romain
fb77791c80 Fix #33: new --cleanup option to remove unused generated thumbnails/media 2017-03-09 22:40:41 +11:00
Romain
39ee2adf05 Read XMP ratings 2017-03-08 21:41:37 +11:00
Romain
449ee0b180 Read the caption from all standard EXIF/IPTC/XMP tags (issue #24) 2017-03-08 21:40:09 +11:00
Romain
7e73e6a10b Refactor album mapping code to be much simpler based on (media) => string 2017-03-08 20:12:05 +11:00
Romain
07ec7702cd Fix #f7451db when counting available CPUs (missing array length) 2017-03-07 22:13:46 +11:00
Romain
f7451db36e Run as many photo/video tasks as CPUs 2017-03-07 17:42:42 +11:00
Romain
59b9bdbbd2 Use <standard> for code style, which removed lots of unused variables/requires 2017-03-06 23:46:46 +11:00
Romain
e71e5d4207 Replace custom "make" DSL with the output task list (#60) 2017-03-06 23:27:44 +11:00
Romain
e719bf15b1 Single source of truth for input/outputs + view model for display (#58) 2017-03-06 22:16:36 +11:00
Romain
794c76c232 Copy missing VideoJS fonts (still using version 4.12.15, current is 5.16.0) 2017-02-28 23:35:45 +11:00
Romain
0c125e90df Thumbnails are back to matching the source extension for now, for compat with V1
Before changing it back, need to list the rules for extension changes. For example:

- should GIF thumbnail should be JPG, to avoid animations on the album page?
- what about transparent GIFs, will they look weird in JPG?
- maybe GIFs should stay as GIFs, but kept to a single frame only for thumbnails
- same thing for pngs, which might be better kept as PNG for transparency
- all other non-browser-friendy formats should become JPG

These rules will be a lot easier to implement when the new input data structure is in place
2017-02-28 23:35:40 +11:00
Romain
d3781b8fcf Fix parsing of MIME Type into Media type (image/video)
This fixes download links, and being able to right-click on a video and save-as
2017-02-28 21:40:51 +11:00
Romain
3a01c678eb Support for IPTC captions 2017-02-28 20:35:09 +11:00
Romain
4e8277b279 Improve progress bar to include ETA , e.g. "3min left" 2017-02-28 18:08:05 +11:00
Romain
cc280a2180 Set the DEBUG env var to print verbose logs (including GraphicsMagick commands etc) 2017-02-28 18:07:25 +11:00
Romain
8dccb88f25 Use [exiftool-json-db] to maintain the JSON database of media files 2017-02-28 00:13:45 +11:00
Romain
e36464a76a New --albums-output-folder option to write all albums to a subfolder (cleaner output)
The main changes are
- this introduces relative paths, since some HTML files have to go ".." to get to public/media
- it also introduces the difference between album.path (OS dependent) and album.url (forward slashes)
2017-02-07 23:37:52 +11:00
Romain
e930af7f49 Add GIF support, fixes #22.
One major change here is that thumbnails will always be generated as ".jpg".
This is potentially a breaking change, in the sense that all "png" or "jpeg" thumbnails
would be to re-calculated and re-uploaded.
2017-02-06 21:37:36 +11:00
Romain
6772e9c9d9 Fix final options for nested albums, not being passed recursively 2017-02-05 15:39:52 +11:00
Romain
7575da7474 New <footer> config setting to add a line of text (or HTML) at the bottom 2017-01-27 17:41:59 +11:00
Romain
dc7a7b5848 Must pass options when finalising album hierarchy. Fixes album sorting. 2017-01-27 17:40:34 +11:00
Romain
277fe126f7 Video model also includes 'large' URL so it's a superset of photos.
Without this, template code like {{previews.0.urls.large}} only works for photos.
2017-01-26 22:49:51 +11:00
Romain
f235675f86 Don't concatenate the root album name to be 100% compatible with existing version for flat albums 2016-11-17 22:07:04 +11:00
Romain
0208babae1 Pick 10 previews per album, to make the mosaic theme work 2016-11-17 12:34:58 +11:00
Romain
b905d62ac3 Fix unit tests (album.finalise argument should be optional) 2016-11-12 15:23:47 +11:00
Romain
eb95cc929c Fix #30 Fix #31 use <mtime> instead of <ctime> which is more relevant
Also means we can use <touch> to force a file to rebuild, since touch changes <mtime>
2016-11-03 16:04:56 +11:00
Romain
315e08e0e5 Fix #30 Fix #31 allow asc/desc order when sorting albums and media 2016-11-03 16:02:25 +11:00
Romain
58c37bd429 Fix model paths 2016-11-02 12:00:14 +11:00
Romain
d91fdbf525 Cleanup output + group photo/video processing 2016-11-02 11:35:55 +11:00
Romain
fd9bf181fd Extract model from website generation 2016-11-02 11:35:27 +11:00
Romain
b023b72cc0 Extract album creation as separate step + consolidate progress bar logic 2016-11-01 14:12:38 +11:00
Romain
7c0fb8a3bf Enable --albums-from = [ folders | date ] and --albums-date-format 2016-10-26 21:57:06 +11:00
Romain
b64843a8a1 Re-implement "classic" theme = same as thumbsup v1 2016-10-26 21:56:20 +11:00
Romain
707e25ca34 Increase preview count for the Mosaic theme 2016-10-26 08:30:21 +11:00
Romain
6d162bd110 Fix sorting of albums & media 2016-10-26 08:30:08 +11:00
Romain Prieto
72fd69bb79 by-date generator supports nested albums + custom album title format 2016-10-17 18:34:45 +11:00
Romain
942f673670 Merge pull request #46 from rprieto/nested-albums
Nested albums
2016-10-17 08:26:11 +11:00
Romain Prieto
d8f8a0c1fe Add handy Handlebars helper to repeat a block N times
Usage: {{#times 4}}hello{{/times}
Can also use any variables in context, e.g. {{#times things.length}}
2016-10-16 22:26:12 +11:00
Romain Prieto
f69d2e3d48 Add support for nested folders 2016-10-16 22:24:07 +11:00
Romain Prieto
9c0071c00d Work in progress: support multiple themes 2016-10-15 23:22:22 +11:00
Romain Prieto
c2f290bbd6 thumbsup v2: rewrite the website around 'albums' 2016-10-13 18:49:15 +11:00
Romain Prieto
035b960c4a Fix rotation bug for images and videos (more details in PR) 2016-10-08 22:16:28 +11:00
Navneet Karnani
c8c5947c9b Add support for custom start file 2016-09-18 23:59:17 +05:30
Romain Prieto
98d98c40bc Fix relative path to LightGallery (npm dedupe issue) 2016-01-22 23:20:10 +11:00
Romain Prieto
b4378356f1 Update all packages, now compatible with Node 5 2016-01-22 12:27:26 +11:00
Romain Prieto
837f5eee5c Align progress bar for the static website 2016-01-22 12:27:05 +11:00
Romain Prieto
f7c6e70b29 Read EXIF captions, and display at the bottom of the slideshow. 2015-09-22 21:41:32 +10:00
Romain Prieto
7d6afac2d0 Upgrade to LightGallery 1.2.2, and use VideoJS for playing videos 2015-09-22 19:46:52 +10:00
Romain Prieto
9473462871 Move to lightgallery instead of blueimp (had video player issues) 2015-08-24 23:22:09 +10:00
Romain Prieto
543e9148b0 Fix bug reading EXIF metadata (error spawn EMFILE)
When too many files needed to be processed, it would try to spin up the EXIF tool (ffprobe) on all files in parallel.
Setting the parallel limit to 100 fixes it.
2015-08-17 00:31:39 +10:00
Romain Prieto
718210b378 Fix #23: URLs should only have forward slashes + catch EXIF errors 2015-02-15 08:57:49 +11:00
Romain Prieto
1ca3cfe7df Support for "m2ts" format (and smaller video example) 2014-12-02 00:07:58 +11:00
Romain Prieto
e74733f52d Homepage with grid of 4 images per gallery 2014-12-01 23:27:13 +11:00
Romain Prieto
82c560d96f Big refactor / cleanup to support multiple pages on the website 2014-12-01 20:49:37 +11:00
Romain Prieto
5de02a543f Always display all build steps, with "up to date" if nothing to do 2014-11-30 21:25:05 +11:00
Romain Prieto
beb9bf403d Refactor view model URLs 2014-11-30 20:59:19 +11:00
Romain Prieto
6f53b594c5 Bug fix #18: download link points to "large size" if original is not available 2014-11-30 20:20:54 +11:00
Romain Prieto
745779fa9f Fix EXIF date parsing 2014-11-30 20:19:55 +11:00
Romain Prieto
b031d043f6 Fix #20, rotate video previews if the video itself has rotation EXIF data
note: no need to rotate the video itself, the player reads it properly
2014-11-30 01:59:31 +11:00
Romain Prieto
1bd5ac8298 Always print an empty progress bar first, in case the first file take a while to process 2014-11-30 01:35:34 +11:00
Romain Prieto
cb835d0ed2 Part of #20, auto-rotates photos based on the EXIF data 2014-11-29 22:11:06 +11:00
Romain Prieto
ef294ad513 Fix #18: don't upload original media by default, add new command line options 2014-11-29 18:30:57 +11:00
Romain Prieto
c72f46e463 Fix #19: support for MTS files, with full-frame mp4 export 2014-11-29 17:06:46 +11:00
Romain Prieto
92c6d6b9d3 Fix #12, add support for --google-analytics config (uses latest GA tracking code) 2014-10-05 22:48:49 +11:00
Romain Prieto
2037bf4455 Remove deleted media from the generated HTML pages 2014-09-14 23:29:05 +10:00
rprieto
58f1cb5c5e Fix error in new options 2014-06-10 22:29:33 +10:00
rprieto
f1f09adc14 Sort folders by date or by name 2014-06-10 22:15:20 +10:00
rprieto
3c8ecce018 Use <yargs> to parse command line args, and support JSON config 2014-06-10 21:28:47 +10:00
rprieto
436d126050 Remove <regen> dependency (faster builds)
Since we read all the file metadata for EXIF dates, and we need it as well for the view model,
we should use it to generate the thumbnails and save many calls to glob() and fs.stat()
2014-06-10 08:36:38 +10:00
rprieto
a13b94ea3e Fix view model for videos 2014-06-04 22:22:50 +10:00
rprieto
7f7b36ab7b Improve metadata collection (single file stat, ...) 2014-06-04 22:09:21 +10:00
rprieto
8fc19fab97 Metadata fake progress report 2014-06-04 20:03:25 +10:00
rprieto
63ee950684 Use the pre-built metadata to create the galleries view model
Fixes #4 : sorts the files by either EXIF date (photos) or file date (videos)
2014-06-04 19:18:41 +10:00
rprieto
11575c65d4 Read and cache EXIF data into <metadata.json> 2014-06-04 19:16:28 +10:00
rprieto
ba8c4a59f3 Fix website generation (bad refactor) 2014-05-23 21:18:46 +10:00
rprieto
1687999976 Fix #1 : report progress of operations in the console 2014-05-19 22:23:59 +10:00
rprieto
d7d9a9e3a9 Fix #3. Display web-friendly videos (smaller size, and keeps original) 2014-05-18 20:30:06 +10:00