Commit Graph

242 Commits (master)

Author SHA1 Message Date
Romain f088615caa feat(cli): now option to set the home album name
Part of #176
5 years ago
Romain 066155f0fb Uses more web-friendly and robust slugs for album filenames (no quotes, no colons…)
Fixes #164
5 years ago
Romain 4d8dfcb7b7 fix(cli): can explicitly set the log level to “default” for the Listr renderer
Fixes #154
5 years ago
Romain 77ba7f09ab [feat] Support HEIC images, including iOS single / burst / live photos 5 years ago
Romain a09ff03f2e [feat] new option to pass settings to a theme, from a JSON file
Fixes #168
5 years ago
Romain 9c581bbd0b feat(albums): optionally generate a ZIP file for each album
Fixes #125
5 years ago
Romain f10544a6a9 fix(model): remove unnecessary ./ for files in the root folder 5 years ago
Romain 5571e0e6bf Expose width and height in the file metadata
Fixes #149
5 years ago
Andrew McOlash 282713f273 Allow generating rectangular thumbnails (#146)
Add rectangular thumbnail
5 years ago
Romain c4719328af fix(database): add support for AVI and WMV videos
fixes #147
5 years ago
Romain 2e875e7448 test(theme): add tests for escaping of single and double quotes 5 years ago
Andrew McOlash 11da4850c8 Add in escaping of quotes for relative paths (#145)
* Add in escaping of quotes for relative paths

* Add double quote escaping

* Fix lint errors

* Always escape relative paths
5 years ago
Romain 220b2137ec feat(media): support suffix based generated paths instead of folder groups
Fixes #32, Fixes #111
5 years ago
Romain 96bb3ad902 feat(resize): new options to control preview images (resize, copy, symlink…)
Fixes #115
5 years ago
Romain 9bda0a4835 feat(database): new include/exclude arguments to filter the input folder 5 years ago
Romain f30eddb6dd feat(options): new flags to selectively include photos / videos / raw photos
fixes #128
5 years ago
Romain 2c2c518f4b New options --video-format, --video-quality and --video-bitrate 5 years ago
Nikolai Kim 6b7df75ea4 Use Slugify for Albun names 5 years ago
Romain 9425604dd7 chore(dependencies): upgrade Standard from v11 to v12 which introduces a style change 6 years ago
Romain 4030025bc9 feat(index): support m4v files, video format used when exporting from Apple Photos 6 years ago
hnizdil 7c0b87cbae
GA code fix in GA template 6 years ago
Andrew McOlash ac41a925b5 Fix CI test 6 years ago
Andrew McOlash cbbb067957 Change metadata to only have exif when needed, rename exif flag 6 years ago
Andrew McOlash b14a255bc5 Pass exif data to template optionally 6 years ago
Romain b15b10fbb9 fix(metadata): support the ContentCreateDate field for videos 6 years ago
Romain 37ea6c6ba3 fix(themes): resolve built-in theme paths instead of hardcoding node_modules path
The previous method only worked locally inside the repo, but not once the package is published to npm.
Once published, built-in themes are flattened instead of nested.
6 years ago
Romain 83831274ff refactor(themes): remove themes from core + use the new extracted modules 6 years ago
Romain bf60ae4677 refactor(components): bring ListrWorkQueue into this repo to simplify the build process
- This component was not published to the rpm registry anyway
- We depended on the repo’s master branch which can break things for everyone
- Its repo was not getting much attention which meant
  * no tests, no coverage report
  * no linting
  * no package linting (e.g. had 2 dependencies that weren’t actually used)

It will be simpler to manage this way
6 years ago
Romain 39591c70a1 feat(theme): support for themes published within a subfolder
If a theme has a build process, it will likely publish a subfolder (e.g. “dist”) to npm.
It can simply set “thumbsup.themeRoot” in its package.json so thumbsup looks in the right place.
6 years ago
Romain 79dd36f77b test(core): add unit tests for the relationship/action mapping, e.g. “photo:large” 6 years ago
Romain 7dd714c957 refactor(tests): dynamically generate test folders to check more edge cases 6 years ago
Romain 3fa8867757 test(all): add unit tests for theme + cleanup logic 6 years ago
Felix Eckhofer 81a85004c2 Fix behavior for non-traversable directories (#108)
fix(index): Continue on errors during find

This ensures the gallery is created even when some files are
inaccessible (for example due to invalid names or file permissions).

Requires running the test in Docker as non-root to allow file access test
6 years ago
Romain bd86ab6535 test(themes): add integration tests using a mock file system
This replaces the basic unit tests that used private methods
and didn’t have a very clear intent
6 years ago
Romain deee049650 refactor(themes): extract the {{relative}} helper to be standalone + add some tests 6 years ago
Felix Eckhofer 383f77e0d4 fix(core): Use correct base for calculating the relative path
Fixes #109
6 years ago
Felix Eckhofer 7dc914f924 fix(index): skip non-existing files
This can happen when files have invalid names or they are being deleted
while thumbsup is running.

Fixes #106
6 years ago
Romain e9beb830a2 feat(core): skip files that can’t be processed + show a summary at the end
Thumbsup used to stop at the first problem processing a file.
This was a problem on large galleries where you’d need to run it again and again, fixing files as you went.
This change:
- skips problematic files and shows a summary at the end
- logs all warnings/errors to <thumbsup.log> when running the default output

Also refactor and cleanup of the logging logic.
6 years ago
Romain 8bbe1186c5 fix(core): custom album mappers using file:// can use a relative path 6 years ago
Romain 0adef54dc8 feat(core): add support for static and animated GIFs
GraphicsMagick can’t process animated GIFs well unless all frames are coalesced, which creates very large files.
This means there is a new dependency on Gifsicle which is very good at working with animated GIFs.

- Thumbnails are still processed through GraphicsMagick (more options, e.g. centre-crop)
- Large previews of animated GIFs go through Gifsicle

The startup checks are updated to check for the Gifsicle binary.

Fixes #96.
6 years ago
Romain e1517d2fbd feat(core): when building thumbnails, fallback to JPG if the source is not a browser-friendly format
If the source is browser-friendly (jpg, jpeg, png) then keep the exact original extension.
6 years ago
Romain 24790c075c chore(cleanup): remove old code and console.log() 6 years ago
Romain 9612ca0048 feat(core): load an external theme from a given path using --theme-path 6 years ago
Romain 03a9c9a319 refactor: themes are now standalone folders, to prepare for external loading
Every theme is made of { Handlebars + Less + Partials + Helpers + Public }
6 years ago
Romain 36d935a787 feat(core): new option to add watermarks to the gallery
Watermarks only apply to large images, not thumbnails.
6 years ago
Romain 3c946621ec feat(core): new --gm-args flag to pass additional options to GraphicsMagick
Example: thumbsup --gm-args ‘modulate 120’ --gm-args ‘equalize’
Closes #89.
6 years ago
Romain f7d7b827e5 feat(cli): --concurrency also controls the number of batch exiftool processes 6 years ago
Romain a5740fb94e feat(cli): Expose --photo-quality to control the quality of the converted images 6 years ago
Romain 8f76013539 fix(dependencies) Upgrade downsize for the width/height mixup
The end behaviour stays the same since `--large-size`
always referred to the image height in the docs.
6 years ago
Brandon Lopez 205ec2f3cb Add concurrency argument (#92)
Add concurrency option
6 years ago
Romain 03c3b38e82 fix(model): ignore the EXIF date if it’s not valid e.g. 0000:00:00
Closes #94
6 years ago
Felix Yan 0ff1699c5c Correct a typo in step-index.js 6 years ago
Romain cd3d699b34 feat(cli): new --dry-run option to skip resizing the files / creating the website
The index is still updated, and the media folder is still scanned to log how many tasks are required.
This is useful to know what thumbsup is about to do, without actually running the expensive tasks.
7 years ago
Romain e5f6df3d28 refactor(cli): deprecated options logic now handled in <options> module 7 years ago
Romain 286dc8d15f feat(albums): --albums-from can be a list of patterns with special keywords
- %path expands to the path of the photo/video
- %keywords expands to the IPTC keywords of the photo
- {format} expands to the photo's EXIF date, e.g. {YYYY MM}
7 years ago
Romain fce8d8d8af refactor(model): album mappers can also return '/' to mean the root album 7 years ago
Romain a5486687e7 feat(log): print more debug logs about how the number of files and tasks 7 years ago
Romain 81ee517062 feat(index): ignore files in a root #recycle folder (Synology recycle bin) 7 years ago
Romain d0bbf94b1c fix(index): don’t crash when trying to parse exiftool output for a badly encoded file 7 years ago
Romain a2042f3128 Fix logging option for non-TTY + highlight URL in welcome / error messages 7 years ago
Romain 47a924883e New --log option to print a full text log with different verbosity levels 7 years ago
Romain 06ecd2edad Add usage reporting with Google Analytics + greeting/error messages
This will help understand usage patterns to know what to focus on, e.g.
- are many people using thumbsup on Windows?
- are there many galleries with > 10,000 photos?
7 years ago
Romain 3152361e65 Fix #83: handle IPTC keywords returned as string or array 7 years ago
Romain f66208e052 New options for the {{date}} helper: custom date format + how long ago 7 years ago
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.
7 years ago
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.
7 years ago
Romain d19a230a6c Cleanup unused code 7 years ago
Romain 3e098e2328 Extract Handlebars helpers to prepare for theme structure + add unit tests 7 years ago
Romain cbf8a1f3b4 Don’t index media from Synology thumbnail folders (@eaDir) nor folders starting with “.” 7 years ago
Romain ac520d40ad Fix case insensitive glob + add unit tests for globbing 7 years ago
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
7 years ago
Romain 30f203af4b Render progress using Listr + split the main process into "steps" which are easier to test 7 years ago
Romain b92724472e Fix #71: read both Quicktime CreationDate and CreateDate 7 years ago
Romain 0b27d37881 Read metadata from Picasa.ini if present 7 years ago
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)
7 years ago
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
7 years ago
Romain ac67a08da9 Use new “downsize” package that was split out (to make testing edge cases easier) 7 years ago
Romain dc40fbac09 Fix inferring data from the filename: was getting confused if the folder contained digits 7 years ago
Romain 80f7a88c35 Fix #61: new options to avoid copying original photos to the output folder 7 years ago
Romain 6fde22e9d1 Fix #62: crash prevented the error message from showing when migrating from V1 to V2 7 years ago
Romain 1df4ee48f3 Fix #63: run ffmpeg using <spawn> and don't buffer stdout/stderr 7 years ago
Romain 3531f1e533 Try to infer dates from the filename if there is no "date" metadata 7 years ago
Romain a7ad8dc9fc Fix reading the original creation date of QuickTime and H264 movies 7 years ago
Romain 9a24acc6df Fix copying of --original-photos 7 years ago
Romain 91e55daf9b Upgrade VideoJS to 5.17 7 years ago
Romain 9c78c1cd79 Rename album sorting function for clarity (they don't take a raw File, but a Media object) 7 years ago
Romain fb77791c80 Fix #33: new --cleanup option to remove unused generated thumbnails/media 7 years ago
Romain 39ee2adf05 Read XMP ratings 7 years ago
Romain 449ee0b180 Read the caption from all standard EXIF/IPTC/XMP tags (issue #24) 7 years ago
Romain 7e73e6a10b Refactor album mapping code to be much simpler based on (media) => string 7 years ago
Romain 07ec7702cd Fix #f7451db when counting available CPUs (missing array length) 7 years ago
Romain f7451db36e Run as many photo/video tasks as CPUs 7 years ago
Romain 59b9bdbbd2 Use <standard> for code style, which removed lots of unused variables/requires 7 years ago
Romain e71e5d4207 Replace custom "make" DSL with the output task list (#60) 7 years ago
Romain e719bf15b1 Single source of truth for input/outputs + view model for display (#58) 7 years ago
Romain 794c76c232 Copy missing VideoJS fonts (still using version 4.12.15, current is 5.16.0) 7 years ago
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
7 years ago
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
7 years ago
Romain 3a01c678eb Support for IPTC captions 7 years ago
Romain 4e8277b279 Improve progress bar to include ETA , e.g. "3min left" 7 years ago