{"id":393,"date":"2011-01-11T11:00:05","date_gmt":"2011-01-11T10:00:05","guid":{"rendered":"https:\/\/hoover.gplrank.de\/?p=393"},"modified":"2011-01-11T11:01:53","modified_gmt":"2011-01-11T10:01:53","slug":"batch-scaling-a-directory-of-jpeg-images-using-imagemagicks-convert-cli-tool","status":"publish","type":"post","link":"https:\/\/hoover.gplrank.de\/?p=393","title":{"rendered":"Batch-Scaling a directory of jpeg images using ImageMagick&#8217;s &#8220;convert&#8221; cli tool"},"content":{"rendered":"<p>Recently, I had to scale down a series of images in different resolutions down to a web-friendly 600xsomething size so I could upload them to Zope&#8217;s internal Medusa ftp server without having to wait hours or breaking the resulting picture page with humongous images. Here&#8217;s how I did it, assuming the pics reside in a directory called &#8220;picdir&#8221; in my home directory:<\/p>\n<pre>cd ~\/picdir<\/pre>\n<pre>mkdir web # create a temporary dir to hold the scaled down images<\/pre>\n<pre>for f in *jpg *JPG ; do<\/pre>\n<pre> convert -geometry 600x \"$f\" web\/\"$f\"<\/pre>\n<pre> #convert to 600px width at most, let convert figure out the rest<\/pre>\n<pre>  echo $file<\/pre>\n<pre>done<\/pre>\n<p>Of course, this only works for landscape format pics, portrait format pictures will end up slightly larger because of their greater vertical size.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, I had to scale down a series of images in different resolutions down to a web-friendly 600xsomething size so I could upload them to Zope&#8217;s internal Medusa ftp server without having to wait hours or breaking the resulting picture page with humongous images. Here&#8217;s how I did it, assuming the pics reside in 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":[8],"tags":[],"class_list":["post-393","post","type-post","status-publish","format-standard","hentry","category-it"],"_links":{"self":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts\/393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=393"}],"version-history":[{"count":3,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts\/393\/revisions"}],"predecessor-version":[{"id":397,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts\/393\/revisions\/397"}],"wp:attachment":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}