Not a bug

Preview files too large

meku 4 years ago updated by Vlad R 2 years ago 8

I noticed that the preview images of photos are being generated as PNG files at a size of 200-300KB each. This causes a page of thumbnails to load very slowly.

I expected it to use JPG as a default. Is there a setting to control the file type or quality for photo previews?

Not a bug

We do not see such large thumbnail files. Perhaps you have increased their default size. We do not expect it to use JPG. There is no control over type or quality.

I installed pngquant and now previews are down to 30-60KB, albeit with the loss of color and detail that it introduces. This makes the previews usable but it seems like a bad workaround when ImageMagick can create JPG previews that are smaller and better quality. ¯\_(ツ)_/¯

Do you mind providing a sample file? The full version of the file, so that we can check to see how FileRun is generating the thumbnail for it and if we can do something to improve that.

Here are two samples that are not well compressed to PNG. The attached previews are generated by Filerun, both demonstrate obvious dithering due to downsampling of the colors.

Sample: https://unsplash.com/photos/woC_8dJuWlM

Preview: https://imgur.com/uCdHUIm

Sample: https://unsplash.com/photos/DNQ-M93tHmA

Preview: https://imgur.com/QX0NTVM

FileRun would not generate a thumbnail for the second image, due to it's small file size.

The first one looks fine as well.

What FileRun version are you using, what ImageMagick, and do you have any custom settings set from config.php?

These previews are from Filerun. Perhaps you missed that on the sample urls I gave there is link to download the high resolution JPG.

Filerun 2018.11.11

ImageMagick 7.0.8

pngquant 2.12.2

As you say the PNG previews "looks fine" the issue appears to be that the developer thinks 256 colors is satisfactory for a photo preview.  ¯\_(ツ)_/¯

I would also say that we should have the options to set the format of the thumbnails and previews generation.

As I see also in my case I would prefer JPEG, as often in previews I have previews of around 2MB even when I set "Preview resolution to Small".

It could be an option under Cpanel: Thumbnails and preview -> format for generated images

When we will find a good reason for it, we will implement. At the moment we could not find a single one. Jpegs thumbnails are not smaller than the PNG FileRun uses.