{"id":16938583,"url":"https://github.com/dsnet/generate-gallery","last_synced_at":"2025-04-11T19:20:19.365Z","repository":{"id":57615796,"uuid":"382967829","full_name":"dsnet/generate-gallery","owner":"dsnet","description":"Tool for generating static .html files with thumbnails for all images and videos in a directory ","archived":false,"fork":false,"pushed_at":"2021-07-12T20:53:25.000Z","size":517,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T15:12:00.053Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-04T23:32:10.000Z","updated_at":"2024-11-05T17:44:03.000Z","dependencies_parsed_at":"2022-08-27T00:43:18.004Z","dependency_job_id":null,"html_url":"https://github.com/dsnet/generate-gallery","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnet%2Fgenerate-gallery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnet%2Fgenerate-gallery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnet%2Fgenerate-gallery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnet%2Fgenerate-gallery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsnet","download_url":"https://codeload.github.com/dsnet/generate-gallery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248465348,"owners_count":21108244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T21:01:07.043Z","updated_at":"2025-04-11T19:20:19.342Z","avatar_url":"https://github.com/dsnet.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Static Gallery Generator\n\nThis program generates a static `.html` file containing previews of all images\nand videos in a directory. The previews are embedded within the HTML itself\nusing the [data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme)\nto avoid generating separate preview files for every item in the gallery.\nEach preview is a link to the original media file.\n\nExample of rendered HTML:\n![example](doc/example.png)\n\nExample of encoded HTML:\n```html\n\u003chtml data-magic=\"generate-gallery\" data-gallery=...\u003e\n\u003cbody\u003e\n\u003ca href=\"tsai-family/IMG_1362.JPG\" target=\"_blank\"\u003e\u003cimg src=\"data:image/jpeg;base64,\"... title=\"IMG_1362.JPG; 2021-05-09 03:57:26\" data-media=.../\u003e\u003c/a\u003e\n\u003ca href=\"tsai-family/IMG_1360.JPG\" target=\"_blank\"\u003e\u003cimg src=\"data:image/jpeg;base64,\"... title=\"IMG_1360.JPG; 2021-05-09 18:44:14\" data-media=.../\u003e\u003c/a\u003e\n\u003ca href=\"tsai-family/IMG_1379.JPG\" target=\"_blank\"\u003e\u003cimg src=\"data:image/jpeg;base64,\"... title=\"IMG_1379.JPG; 2021-05-17 23:31:44\" data-media=.../\u003e\u003c/a\u003e\n\u003ca href=\"tsai-family/IMG_1425.JPG\" target=\"_blank\"\u003e\u003cimg src=\"data:image/jpeg;base64,\"... title=\"IMG_1425.JPG; 2021-06-07 02:07:04\" data-media=.../\u003e\u003c/a\u003e\n\u003ca href=\"tsai-family/IMG_1464.JPG\" target=\"_blank\"\u003e\u003cimg src=\"data:image/jpeg;base64,\"... title=\"IMG_1464.JPG; 2021-06-17 19:01:05\" data-media=.../\u003e\u003c/a\u003e\n\u003ca href=\"tsai-family/IMG_1463.JPG\" target=\"_blank\"\u003e\u003cimg src=\"data:image/jpeg;base64,\"... title=\"IMG_1463.JPG; 2021-06-19 00:28:51\" data-media=.../\u003e\u003c/a\u003e\n\u003ca href=\"tsai-family/IMG_1492.JPG\" target=\"_blank\"\u003e\u003cimg src=\"data:image/jpeg;base64,\"... title=\"IMG_1492.JPG; 2021-06-29 21:26:45\" data-media=.../\u003e\u003c/a\u003e\n\u003ca href=\"tsai-family/IMG_1494.JPG\" target=\"_blank\"\u003e\u003cimg src=\"data:image/jpeg;base64,\"... title=\"IMG_1494.JPG; 2021-06-30 22:30:37\" data-media=.../\u003e\u003c/a\u003e\n\u003ca href=\"tsai-family/IMG_1495.JPG\" target=\"_blank\"\u003e\u003cimg src=\"data:image/jpeg;base64,\"... title=\"IMG_1495.JPG; 2021-07-01 07:03:33\" data-media=.../\u003e\u003c/a\u003e\n\u003ca href=\"tsai-family/IMG_1538.JPG\" target=\"_blank\"\u003e\u003cimg src=\"data:image/jpeg;base64,\"... title=\"IMG_1538.JPG; 2021-07-08 21:14:07\" data-media=.../\u003e\u003c/a\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Usage \n\nThe tool can be installed with:\n```\n$ go install github.com/dsnet/generate-gallery@latest\n```\n\nThe tool can be invoked as follows, where the program is passed a directory\ncontaining image and video files to process:\n```\n$ generate-gallery $DIR\n```\n\nThe tool reads and decodes all image and video files in the directory and\nproduces a downsampled preview image for each media item in the gallery.\nIt emits a `$DIR.html` file that is the statically generated gallery.\nIf a previously generated `.html` file already exists,\nit is parsed and any preview images within it are reused\nbefore being overwitten by the newly generated `.html` file.\nTo prevent reuse of previously generated `.html` files,\nsimply remove the `.html` file before running the tool.\n\n## Supported formats\n\nThe set of supported formats are based on those that are commonly supported\nby most modern browsers:\n\n* [JPEG](https://en.wikipedia.org/wiki/JPEG)\n* [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics)\n* [GIF](https://en.wikipedia.org/wiki/GIF)\n* [WebP](https://en.wikipedia.org/wiki/WebP)\n* [WebM](https://en.wikipedia.org/wiki/WebM)\n* [MP4](https://en.wikipedia.org/wiki/MPEG-4_Part_14)\n\nRegarding the list above, there are some caveats:\n\n* Reading metadata for creation date is only supported for JPEG and MP4.\n\n* Decoding of animated WebP images is only supported to the degree\n  that they are supported by `ffmpeg`.\n  As of 2021-07-04, animated WebP images are not supported\n  (see https://trac.ffmpeg.org/ticket/4907).\n\n* The MP4 format is a container for video and audio streams that can be encoded\n  with a number of various codecs. A valid MP4 file may not be playable in\n  a given browser because it lacks support for the codecs used.\n  For maximum compatibility, we recommend using\n  [H.264](https://en.wikipedia.org/wiki/Advanced_Video_Coding)\n  for the video encoding and\n  [AAC](https://en.wikipedia.org/wiki/Advanced_Audio_Coding)\n  for the audio encoding.\n\n  An existing MP4 file can be transcoded for better compatibility with:\n  ```\n  $ ffmpeg -i $IN_FILE -vcodec h264 -acodec aac $OUT_FILE\n  ```\n\n## Binary dependencies\n\nThis program invokes `ffmpeg` and `ffprobe` in order to handle the\nGIF, WebP, WebM, and MP4 file formats. In particular, `ffmpeg` needs to support\nencoding of animated WebP images for previews of movie files.\nSupport for encoding WebP can be checked by running:\n\n```\n$ ffmpeg -v quiet -codecs | grep webp\n DEVILS webp                 WebP (encoders: libwebp_anim libwebp )\n```\n\nThe `E` flag in `DEVILS` indicates that encoder support is available for WebP.\n\nIf `ffmpeg` is not available or the currently installed version\ndoes not support encoding WebP images, then you can download the latest\nversion of `ffmpeg` as a static binary from https://ffmpeg.org/download.html.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsnet%2Fgenerate-gallery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsnet%2Fgenerate-gallery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsnet%2Fgenerate-gallery/lists"}