{"id":67,"date":"2009-11-28T20:34:46","date_gmt":"2009-11-29T01:34:46","guid":{"rendered":"http:\/\/blog.alanporter.com\/2009-11-28\/gqview-plugins"},"modified":"2009-11-28T20:34:46","modified_gmt":"2009-11-29T01:34:46","slug":"gqview-plugins","status":"publish","type":"post","link":"https:\/\/alanporter.com\/blog\/2009\/11\/28\/gqview-plugins\/","title":{"rendered":"Plugging external commands into &#8216;gqview&#8217;"},"content":{"rendered":"<p>I have been taking digital photographs since 1998, and so one piece of software which I use quite a bit is my photo organizer.  I use a tool called &#8220;gqview&#8221;.  It&#8217;s a very nice browser that shows folders and thumbnails and a large image on the screen at the same time.  And it does a good job showing slide shows.<\/p>\n<p>One nice feature of gqview is that you can plug external programs into the &#8216;edit&#8217; menu.  When you install it (at least on Ubuntu systems), a few of the plug-in&#8217;s are populated already:<\/p>\n<ul>\n<li>edit in GIMP (external package: gimp)<\/li>\n<li>edit in xpaint (external package: xpaint)<\/li>\n<li>rotate clockwise (external package: libjpeg-progs)<\/li>\n<li>rotate counter-clockwise (external package: libjpeg-progs)<\/li>\n<\/ul>\n<p>I wanted to add a plug-in to shrink images a certain percentage.  I often find that I want to send a bunch of pictures to friends via email, and I really don&#8217;t want to send a 50 MB email, and I don&#8217;t want the pictures to be so big that the reader had to scroll to see it.<\/p>\n<p>It&#8217;s pretty easy to add the plug-in.  The actual shrinking can be handled easily with the &#8216;convert&#8217; command, which is part of the excellent &#8216;imagemagick&#8217; set of graphics tools.  Plugging <em>convert<\/em> into gqview is as easy as this:<\/p>\n<pre>%vif convert %p -scale 25% %p_tmp ; then\n    mv %p_tmp %p ; else rm %p_tmp ; fi<\/pre>\n<p>I didn&#8217;t make this up myself &#8212; I simply copied the &#8220;rotate&#8221; plug-in&#8217;s and changed what I needed to.  I am not sure what the <code>%v<\/code> is for, but it&#8217;s pretty clear that <code>%p<\/code> is the full path of the image file.<\/p>\n<p>Now I can highlight a whole bunch of photos and shrink them all with a single command.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been taking digital photographs since 1998, and so one piece of software which I use quite a bit is my photo organizer. I use a tool called &#8220;gqview&#8221;. It&#8217;s a very nice browser that shows folders and thumbnails and a large image on the screen at the same time. And it does a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,15],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-software","category-tips-tricks","count-0","even alt","author-alan","last"],"_links":{"self":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":0,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"wp:attachment":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}