{"id":1030,"date":"2017-11-03T10:44:07","date_gmt":"2017-11-03T18:44:07","guid":{"rendered":"https:\/\/accretiondisc.com\/blog\/?p=1030"},"modified":"2017-11-03T10:44:07","modified_gmt":"2017-11-03T18:44:07","slug":"mini-magick","status":"publish","type":"post","link":"https:\/\/accretiondisc.com\/blog\/2017\/11\/03\/mini-magick\/","title":{"rendered":"Mini Magick"},"content":{"rendered":"<p>I just discovered <a href=\"https:\/\/github.com\/minimagick\/minimagick\">MiniMagick<\/a>. It is exactly what I was looking for in a ruby-language wrapper for ImageMagick.<\/p>\n<p>I&#8217;ve been using <a href=\"https:\/\/www.imagemagick.org\/script\/index.php\">ImageMagick<\/a> forever. Like, more than 20 years foreer. Maybe 30 years;\u00c2\u00a0 I don&#8217;t know when it was first developed, or how old it was when I discovered it.<\/p>\n<p>Some of the time, I use ImageMagick from the command line: just <em>convert<\/em> a file or <em>montage<\/em> a couple of them, or whatever. But sometimes, I do the same three things to an image and expect to do it over and over again for multiple images, I&#8217;ll write a shell script.<\/p>\n<p>Writing shell scripts is hard. (Like, do you use <a href=\"http:\/\/tldp.org\/LDP\/Bash-Beginners-Guide\/html\/sect_12_02.html\">trap<\/a>? Of course you don&#8217;t.)<\/p>\n<p>Writing <a href=\"https:\/\/www.ruby-lang.org\/en\/\">Ruby<\/a> is easy. But the only Ruby wrapper for ImageMagick I knew about was <a href=\"https:\/\/github.com\/rmagick\/rmagick\">RMagick<\/a>, which is big and complex and the first couple of times I tried to use it I had build problems (this was back before gems and github).<\/p>\n<p>So there I was. Use bash and keep it simple, or use ruby with some crazy backtick <code>`convert foo.png foo.jpg`<\/code> shell escape there instead of doing it right.<\/p>\n<p>But MiniMagick is just a well-designed wrapper around those backticks. Kudos!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just discovered MiniMagick. It is exactly what I was looking for in a ruby-language wrapper for ImageMagick. I&#8217;ve been using ImageMagick forever. Like, more than 20 years foreer. Maybe 30 years;\u00c2\u00a0 I don&#8217;t know when it was first developed, or how old it was when I discovered it. Some of the time, I use [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[23,52],"tags":[781,415,977,976,200,469,978],"class_list":["post-1030","post","type-post","status-publish","format-standard","hentry","category-life","category-technology","tag-bash","tag-imagemagick","tag-mini_magick","tag-rmagick","tag-ruby-2","tag-shell","tag-trap"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paRqpr-gC","_links":{"self":[{"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/posts\/1030","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/comments?post=1030"}],"version-history":[{"count":0,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/posts\/1030\/revisions"}],"wp:attachment":[{"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/media?parent=1030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/categories?post=1030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/tags?post=1030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}