Skip to content

Email. hello@digitalelite.co.uk | Tel. 020 8050 1385

Thumbnails

If you plan to using the plugin with a large number of images, or to create an image library, you'll want to enable thumbnail generation. This allows us to display file previews when you are managing files in the backend, and when your customers are viewing files in the front-end.

Normally 10 x 1mb image files on a single page would result in 10mb of data being loaded with the page. We automatically generate thumbnail images when you upload files and use these within the file listing views in order to prevent this from happening and allow a fast user experience and search. On clicking an image link to download the file, the original image file is downloaded.

File Types

Thumbnail generations works for all image files:

  • .JPEG
  • .PNG
  • .GIF
  • .PDF

PDF Files are cropped from the top as this is where the most context of a document is stored (title, author, date etc). Other images are cropped from the centre.

Missing Thumbnails

If for any reason we have been unable to generate thumbnails successfully for any of the files stored in WP Media Manager, you can type "no-thumbnails:" in the search box to find files that should have thumbnails but don't and then regenerate them manually if needed.

no-thumbnails:

Regenerate Thumbnails

Should you have any issues with thumbnail generation please use the "regenerate thumbnail" button.

Similarly if you manually change any image cropping details (i.e. where to crop from (top or middle), or the size of cropped images, then existing thumbnails will likely need to be regenerated.

Fallback Images

Thumbnail and preview images are generated on the first access attempt for each file, so you may see the fallback image once first.

In addition a Fallback thumbnail is used for file types other than those specific above (such as office documents) where we are unable to generate a capture an image of the file.

For file types where previews cannot be created we have pre-set fallback images.

  • Presentation
  • Spreadsheet
  • Video
  • Audio
  • Image
  • Text
  • Archive
  • PDF
  • Document

Technical Details (ImageMagick v GD)

Thumbnail generation is done using ImageMagik, with a fallback php thumbnail generation if ImageMagik is not installed on the server.

Creating image thumbnails requires an image processing library. Imagick and GD are popular image optimization libraries in PHP and both are available to WordPress on the condition that they were installed and configured along with PHP itself. This will be dependent on your hosting provider.

Note however that the WordPress core media.php file defaults to GD as its image editor of choice (see https://github.com/WordPress/WordPress/blob/master/wp-includes/media.php#L2941).

GD (http://www.php.net/manual/en/intro.image.php) has been included by default since PHP v4.3 hence exists in most server environments and is widely available. It supports JPG, PNG, GIF, WBMP, WebP, XBM and XPM files. GD is generally a slight bit faster when dealing with large images.

Imagick (http://www.php.net/manual/en/intro.imagick.php) is more dependent on your hosting provider and may not always be available. It offers more functionality with over 100 supported file types and a wider range of image transformation options. Imagick is usually better at producing higher quality images (although sometimes at the expense of file size).

In order to prevent memory issues with large folders of images we run the image thumbnail creation on one image at a time. In addition memory heavy tasks run after the image is generated.

The thumbnail software (ImageMagick) writes files to a temporary directory whilst the thumbnail is generated, details of this directory are show on the support page.

When you upload an image to WordPress, it's stored in PHP's $upload_tmp_dir (defaults to /tmp) to begin with, then moved to the proper directory.  The /tmp directory is a tmpfs filesystem (using the server's memory for speed), which defaults to half of your server's memory.

Scroll To Top