Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

NodeBB Upload Compressor

Best-effort compression for NodeBB image and file uploads larger than COMPRESS_UPLOAD_MAX_SIZE (default 500 KiB).

Install

Install from npm after the package is published:

npm install nodebb-plugin-compress-upload
./nodebb restart

Activate Compress Uploads in the NodeBB ACP. The package owner must publish it to npm (npm login, then npm publish); GitHub does not publish it automatically. Until published, install from GitHub:

npm install amer-raba/nodebb-plugin-compress-upload

Configure size limit

Set the maximum in bytes in the NodeBB process environment:

COMPRESS_UPLOAD_MAX_SIZE=204800 ./nodebb start

Default: 512000 bytes. COMPRESS_UPLOAD_TOOL_TIMEOUT sets the external encoder timeout in milliseconds (default 300000). FFMPEG_PATH and GHOSTSCRIPT_PATH can point to the FFmpeg and Ghostscript executables.

Strategies

  • JPEG, PNG, WebP, AVIF, TIFF images: Sharp reduces quality and dimensions. Animated and unsupported images are preserved unchanged to avoid losing frames or content.
  • Video: Optional FFmpeg lossy conversion to H.264/AAC MP4. Converted files use .mp4.
  • Audio: Optional FFmpeg lossy conversion to MP3. Converted files use .mp3.
  • PDF: Optional Ghostscript /screen compression. Output remains PDF.
  • Other files: Lossless gzip, used only when it reduces size. Output uses .gz and must be decompressed to recover the original.

Only a candidate smaller than the original replaces it. The limit is a target, not a guarantee: a codec may be unavailable, the file may already be compressed, or it may not be compressible. Format conversions can discard features or reduce quality. Keep originals of important files. Install FFmpeg and Ghostscript separately if you want their optional media/PDF support; the plugin does not bundle these tools.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages