http://qs321.pair.com?node_id=11116709


in reply to Shrink Images and PDFs

Thanks for your post.

I installed the Perl script in the scripts directory for nemo running on Mint, and although the script showed up in the context menu, it didn't run (I added some code to write to a file as a test). A bash script in the same location and with the same user/group/permissions did run OK.

My thought was that there was an environment issue. To get the perl script to work I added a perl libraries path like this:

use lib '/home/<myusername>/perl5/lib/perl5/';

I don't know if this was an issue with Mint/nemo or with my installation of perl, but this may help someone else who has the same problem.

Now shrink works from the context menu - at least for images - I haven't tried any pdf's yet.

It was just what I had been looking for when preparing images to share with others, so much easier than opening an image manipulation program and manually having to edit and save a new file. Thanks again.

Replies are listed 'Best First'.
Re^2: Shrink Images and PDFs
by haukex (Archbishop) on May 12, 2020 at 16:47 UTC

    Thanks very much for the feedback, I'm glad to hear it's helpful. As for the @INC issue, my guess would be that your local::lib configuration is set in your ~/.bashrc or ~/.profile, and that doesn't get run for these scripts. So thank you for providing a workaround for anyone who might run into the same issue.