Ticket #3461 (closed enhancement: fixed)

Opened 5 years ago

Last modified 3 years ago

Reduce size of thumbnail images

Reported by: tdb01r Owned by:
Priority: Would be nice Milestone: EPrints 3.2.3
Component: Convert Plugins Version:
Severity: normal Keywords:
Cc:

Description (last modified by tdb01r) (diff)

I just installed ImageMagick on the server for non-EPrints usage and thought: why not get those thumbnails working as well. I was suprised by the filesize of these thumbnails (actually I wasn't since I already read about it on the EPrints lists before). There's a very simple way to reduce the thumbnail size though, just one small change in /perl_lib/EPrints/Plugin/Convert/ImageMagick/ThumbnailDocuments.pm

From:
system($convert, "-thumbnail","400x300>", '-bordercolor', 'rgb(128,128,128)', '-border', '1', $src.'[0]', $dir . '/' . $fn);
To:
system($convert, "-thumbnail","400x300>", '-bordercolor', 'rgb(128,128,128)', '-border', '1', $src.'[0]', 'PNG8:'.$dir . '/' . $fn);

The added PNG8: forces it to use 256 color PNG format instead of 16 million colors. I tried it with one PDF, the filesize decreased from 160kb to 20kb without any visual changes (it's only a thumbnail after all). Small code change, huge space savings ;-)

Dennis
University of Twente

Change History

Changed 4 years ago by cjg

  • milestone changed from EPrints 3.1.2 to EPrints 3.1.x

I'm not sure I'm comfortable changing this midstream as it is a format change and will also change the preview URLs. But big previews verges on a bug.

Changed 3 years ago by tdb01r

  • status changed from new to closed
  • resolution set to fixed
  • description modified (diff)

Fixed some time ago.

Note: See TracTickets for help on using tickets.