thelounge-plugin-image-preview
v1.0.0
Published
An image and media preview plugin for The Lounge IRC client that overrides prefetch limits and handles known image hosting sites.
Maintainers
Readme
The Lounge Image Preview Plugin
thelounge-plugin-image-preview is a plugin for The Lounge IRC client that automatically detects and inlines image and media previews from links. It overrides default prefetch limits, supports popular image hosting sites, and works even when the global prefetch setting is disabled.
Features
- Direct Image Previews: Automatically detects direct URLs (e.g.
.png,.jpg,.jpeg,.gif,.webp,.bmp,.svg) and renders them inline. - Image Host Support: Supports major image hosts like Imgur, Catbox, Gyazo, Giphy, and Tenor.
- Custom Prefetch Bypass: Operates independently of the server's global
prefetch: falseconfiguration to only prefetch images, protecting privacy and saving bandwidth. - Configurable Settings: Define a custom maximum image size limit and selectively toggle image hosts.
- Premium Styling: Glassmorphic borders, nice rounding, and subtle hover transition effects.
Installation
Depending on how you run The Lounge, choose one of the installation methods below:
Method 1: standard/local installation (CLI)
If you run The Lounge directly on your host machine, install it via the official CLI command:
thelounge install thelounge-plugin-image-previewAlternatively, you can install it using npm inside your Lounge packages folder (usually ~/.thelounge):
cd ~/.thelounge/packages
npm install thelounge-plugin-image-previewThen restart The Lounge server.
Method 2: using Docker (thelounge/thelounge container)
If you run The Lounge in a Docker container, install it using one of the options below:
Option A: install via container CLI (recommended)
Execute the installation command directly inside your running container:
docker exec -it thelounge thelounge install thelounge-plugin-image-previewOnce installed, restart your container to load the plugin:
docker restart theloungeOption B: manual host installation (mounted volumes)
If you have mounted The Lounge's configuration directory to a host path (e.g., /home/user/.thelounge or /var/opt/thelounge):
- Navigate to the
packagesdirectory on your host:cd ~/.thelounge/packages - Manually add the dependency to
package.jsonunderdependencies:"dependencies": { "thelounge-plugin-image-preview": "^1.0.0" } - Run npm install from your host (using Node.js matching the container's version) or simply restart the container—The Lounge's entrypoint will automatically install any missing dependencies listed in your
package.json.
Commands
Control settings dynamically from any chat query:
/imagepreview status— Show current plugin status and limits./imagepreview toggle— Toggle the plugin on or off./imagepreview size <kb>— Update the maximum allowed preview image size in kilobytes.
Configuration
Custom configuration options can be adjusted in your persistent storage directory:
~/.thelounge/packages/thelounge-plugin-image-preview/config.json
{
"enabled": true,
"maxImageSize": 2048,
"previewImgur": true,
"previewCatbox": true,
"previewGyazo": true,
"previewGiphy": true,
"previewTenor": true,
"previewAllThumbnails": false
}License
This project is licensed under the MIT License. See the LICENSE file for details.
