Ticket #3461 (closed enhancement: fixed)
Reduce size of thumbnail images
|Reported by:||tdb01r||Owned by:|
|Priority:||Would be nice||Milestone:||EPrints 3.2.3|
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.'', $dir . '/' . $fn); To: system($convert, "-thumbnail","400x300>", '-bordercolor', 'rgb(128,128,128)', '-border', '1', $src.'', '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
Note: See TracTickets for help on using tickets.