{"id":2260,"date":"2010-06-21T14:38:05","date_gmt":"2010-06-21T18:38:05","guid":{"rendered":"http:\/\/headsetchatter.com\/blog\/?p=2260"},"modified":"2010-06-21T14:38:05","modified_gmt":"2010-06-21T18:38:05","slug":"resize-images-for-the-web-using-folder-actions","status":"publish","type":"post","link":"http:\/\/headsetchatter.com\/blog\/2010\/06\/resize-images-for-the-web-using-folder-actions\/","title":{"rendered":"Resize Images for the Web Using Folder Actions"},"content":{"rendered":"<p>One repetitive task I do a lot is resizing images to be placed on the website.  On the blog I don&#8217;t have to worry so much about it because WordPress handles all that stuff in the image uploader, but for the main site, I have a couple standard sizes I use.<\/p>\n<p>No image on the site is ever wider than 500px. If it is, then a smaller images is created at 500px and I will build a link to the bigger picture.  Sometimes I want more of a thumbnail, and the size can vary a bit, but 150px is kind of my standard.<\/p>\n<p>Today I decided to play around with folder actions a bit.  A folder action in Mac OS X is basically a script that runs when you drag a file onto a folder, that does something to that file. This seemed like a good project for a simple one.<\/p>\n<p>I created the folder action using Automator, which is the GUI scripting tool that comes with OS X. It&#8217;s pretty simple to drag and drop different actions to perform basic tasks.  Here&#8217;s what my folder action looks like:<br \/>\n<a href=\"http:\/\/headsetchatter.com\/blog\/wp-content\/uploads\/2010\/06\/500px_automator.jpg\"><img loading=\"lazy\" src=\"http:\/\/headsetchatter.com\/blog\/wp-content\/uploads\/2010\/06\/500px_automator-500x409.jpg\" alt=\"\" title=\"500px_automator\" width=\"500\" height=\"409\" class=\"aligncenter size-large wp-image-2261\" srcset=\"http:\/\/headsetchatter.com\/blog\/wp-content\/uploads\/2010\/06\/500px_automator-500x409.jpg 500w, http:\/\/headsetchatter.com\/blog\/wp-content\/uploads\/2010\/06\/500px_automator-300x245.jpg 300w, http:\/\/headsetchatter.com\/blog\/wp-content\/uploads\/2010\/06\/500px_automator.jpg 616w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><br \/>\nThe other one is the same except it reduces the image to 150px, and adds &#8220;_thumb&#8221; to the end of the filename.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One repetitive task I do a lot is resizing images to be placed on the website. On the blog I don&#8217;t have to worry so much about it because WordPress handles all that stuff in the image uploader, but for the main site, I have a couple standard sizes I use. No image on the [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,13],"tags":[239,168,86],"_links":{"self":[{"href":"http:\/\/headsetchatter.com\/blog\/wp-json\/wp\/v2\/posts\/2260"}],"collection":[{"href":"http:\/\/headsetchatter.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/headsetchatter.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/headsetchatter.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"http:\/\/headsetchatter.com\/blog\/wp-json\/wp\/v2\/comments?post=2260"}],"version-history":[{"count":2,"href":"http:\/\/headsetchatter.com\/blog\/wp-json\/wp\/v2\/posts\/2260\/revisions"}],"predecessor-version":[{"id":2263,"href":"http:\/\/headsetchatter.com\/blog\/wp-json\/wp\/v2\/posts\/2260\/revisions\/2263"}],"wp:attachment":[{"href":"http:\/\/headsetchatter.com\/blog\/wp-json\/wp\/v2\/media?parent=2260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/headsetchatter.com\/blog\/wp-json\/wp\/v2\/categories?post=2260"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/headsetchatter.com\/blog\/wp-json\/wp\/v2\/tags?post=2260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}