[EP-tech] File Icons

John Salter J.Salter at leeds.ac.uk
Fri Apr 26 12:13:57 BST 2019


Hi James,
In the default EPrints 'summary page' citation, the $doc.icon method is used to display a thumbnail if one exists. See: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2F3.3%2Flib%2Fdefaultcfg%2Fcitations%2Feprint%2Fsummary_page.xml%23L33&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C48780992f820488b51f908d6ca3848c9%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=TPYCpjJP4Mz2zs5KGMQGCLdx9XxjhZFWJMB5mYUHyC4%3D&reserved=0
The thumbnails are generated by the indexer - and this may not be enabled for your repository.

You're looking in the right place - the convert plugin.
If you want to test what the thumbnails will do by default, look at the 'call_convert' method in EPrints::Plugin::Convert::Thumbnails.
From this you should be able to deduce what command-line will be called to generate the thumbnails - and therefore be able to test it on your server.

Some of the parts might need explaining - e.g. what "$geom^" compared to "$geom>" means (it's in the ImageMagick documentation somewhere).

Most of the Thumbnail plugin is overridable in the repository configuration - so if you needed to change the thumbnail sizes, how they're cropped etc., you can do that without subclassing the module.

The most important piece might be the second half of this line:
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2F3.3%2Fperl_lib%2FEPrints%2FPlugin%2FConvert%2FThumbnails.pm%23L41&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C48780992f820488b51f908d6ca3848c9%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=hKAHF5BqEuvrxiQcSkzxqZmNwtoHvAgjF%2FKORpHLEvY%3D&reserved=0

For our repo, in [EPRINTS_ROOT]/lib/syscfg.d/executables.pl, we have:
my %executables = (
…
    'convert' => '/usr/bin/convert',
    'ffmpeg' => '/usr/bin/ffmpeg',
…
);

Cheers,
John

From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of James Kerwin via Eprints-tech
Sent: 26 April 2019 10:31
To: eprints-tech at ecs.soton.ac.uk
Subject: [EP-tech] File Icons

Hi All,

The files in the repository currently display as generic icons, I think there is some difference depending on whether they're .docx,.pdf,.jpg etc.

I have noticed some other repositories have icons that are the front page of the document they represent. Can anybody please nudge me in the right direction for setting this up at Liverpool?

I've so far been reading about imagemagick, Convert plugins and these pages:

https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FHow_to_write_plugins%23Convert_Plugin&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C48780992f820488b51f908d6ca3848c9%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=roeYYKFZ1NO%2Fg3ApgnnksWdYhiTkt2kPHZGL5ff8N9w%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FHow_to_write_plugins%23Convert_Plugin&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C48780992f820488b51f908d6ca3848c9%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=roeYYKFZ1NO%2Fg3ApgnnksWdYhiTkt2kPHZGL5ff8N9w%3D&amp;reserved=0>
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2Fw%2FAPI%3AEPrints%2FPlugin%2FConvert&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C48780992f820488b51f908d6ca3848c9%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=MZad0Q2QuT2sCDPQtV8Y9pFxpqk18cYpBekzg45u5kw%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2Fw%2FAPI%3AEPrints%2FPlugin%2FConvert&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C48780992f820488b51f908d6ca3848c9%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=MZad0Q2QuT2sCDPQtV8Y9pFxpqk18cYpBekzg45u5kw%3D&amp;reserved=0>

The wider scope of this is part of our PhD thesis digitisation project. I want to try to display the files in a nicer way and maybe place them in a carousel on their abstract pages. There is talk about each thesis chapter being its own file so I want to display them as neatly as possible.

Thanks,
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20190426/5a3f28ef/attachment-0001.html 


More information about the Eprints-tech mailing list