Image Attachments

Last Update: Oct 16, 2022

This addon is 100% hooks based requiring no source edits to install.

Works with ElkArte: 1.0-1.1


This adds the ability to run the free tier WPMU DEV Smush API service on your attachments. uses optimization techniques specific to each image format to remove unnecessary bytes from image files. It is a “lossless” tool, which means it optimizes the images without changing their look or visual quality. Typical savings are in the 5-20% file size reduction. After runs it will report how many bytes have been saved as well as the percent reduction for each file. Smaller files save bandwidth, disk space and make your forum faster.


  • Ability to run on all current attachments in a batch mode (based on attachment age/size)
  • Admin->Forum->Attachments & Avatars->File Maintenance
  • Ability to selectively run on any single or selection of attachments
  • Admin->Forum->Attachments & Avatars->Browse->
  • Can run as a scheduled task to attachments added in the last 24hrs
  • Admin->Maintenance->Scheduled Tasks

##Important Notes

  • The service will not accept files >2M in size, as such no size reduction on those files is possible with this addon
  • Unable to copy the file back to the attachment directory: This generally indicates that the original attachment file was saved with permissions (or owner/group) that will not allow the forum to replace it. This can occur if the attachments were FTP-ed to the site or your site changed how PHP is run. You will need to change the file permissions as needed (664 or 666)
  • returned the following error: Failed to create a temp dir: This means what it says, e.g. is unavailable at the current time, all you can do is try again later
  • I ran and now the file does not show up in the browse list! This means the file was reduced in size below your lower size setting (admin -> configuration -> modification settings -> misc -> Attempt to all attachments larger than)


Download a package by URL

  • Download a package by URL is a quick way to download a package from the web to your forum. Using (Package Manager -> Download Package) enter the below link under the “Download a package by url” field and select Download. This will save the package to your server where you can install it.

Upload a Package

  • Alternatively, download the package using the below link and then using (Package Manager -> Upload Package) browse to where you saved the package on your computer and upload it to the server. You may also FTP the downloaded file directly to your packages directory.


This ElkArte Addon is subject to the terms of the Mozilla Public License version 1.1 (the “License”). You can obtain a copy of the License at