https://github.com/rejetto/thumbnails
HFS plugin to show thumbnails for images in place of icons. Works best on "tiles mode" (enable it in frontend's options).
https://github.com/rejetto/thumbnails
hfs-plugin
Last synced: 3 months ago
JSON representation
HFS plugin to show thumbnails for images in place of icons. Works best on "tiles mode" (enable it in frontend's options).
- Host: GitHub
- URL: https://github.com/rejetto/thumbnails
- Owner: rejetto
- License: gpl-3.0
- Created: 2023-05-24T22:44:58.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-23T17:36:39.000Z (over 1 year ago)
- Last Synced: 2025-03-27T04:44:47.329Z (about 1 year ago)
- Topics: hfs-plugin
- Homepage:
- Size: 32.6 MB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Thumbnails
HFS plugin to show thumbnails for images in place of icons. Works best on "tiles mode" (enable it in frontend's options).
Plugin "sharp" will be automatically installed because it's necessary for this plugin to work.

# Extendable
This plugin is extendable: other plugins can add support for more formats without having to care of all details,
just the minimum.
Let's say you want to create a plugin that adds PDF support to thumbnails. You should do something like:
```js
exports.onDirEntry = ({entry}) => {
if (entry.n.endsWith('.pdf'))
entry._th = 1
}
exports.customApi = {
thumbnails_get({ ctx, path }) {
if (path.endsWith('.pdf')) {
const thumbnailImage = ...your code to generate the thumbnail
return thumbnailImage
}
}
}
```
There's an alternative way to the `onDirEntry`, and it's to define a `frontend_js` with this
```js
HFS.onEvent('thumbnails_supported', ({ entry }) =>
entry.n.endsWith('.pdf') )
```