{"id":3824,"date":"2021-06-13T07:19:29","date_gmt":"2021-06-12T22:19:29","guid":{"rendered":"https:\/\/ecpplus.net\/weblog\/?p=3824"},"modified":"2021-06-20T23:45:01","modified_gmt":"2021-06-20T14:45:01","slug":"convert-to-jpeg-on-finder","status":"publish","type":"post","link":"https:\/\/ecpplus.net\/weblog\/convert-to-jpeg-on-finder\/","title":{"rendered":"Finder \u3067 .heic \u3092 .jpg \u306b\u5909\u63db\u3059\u308b"},"content":{"rendered":"<p>iPhone \u3067\u5199\u771f\u3092\u64ae\u308b\u3068 <code>.heic<\/code> (<a target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/High_Efficiency_Image_File_Format\" rel=\"noreferrer noopener\">High Efficiency Image File Format (Wikipedia)<\/a>) \u306b\u306a\u308a\u307e\u3059\u3002macOS \u4e0a\u3067\u898b\u308b\u5206\u306b\u306f\u554f\u984c\u306a\u3044\u3093\u3067\u3059\u304c\u3001\u5171\u6709\u3059\u308b\u6642\u306b JPEG \u306b\u3057\u305f\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>Finder \u3092\u62e1\u5f35\u3059\u308b<\/h2>\n<p>macOS \u6a19\u6e96\u6a5f\u80fd\u306e Quick Actions \u3068 Automator \u3092\u4f7f\u3063\u3066\u3001Finder \u4e0a\u3067\u7c21\u5358\u306b\u5909\u63db\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u5b8c\u6210\u3057\u305f Workflow \u3092 GitHub \u306b\u7f6e\u3044\u3066\u304a\u304d\u307e\u3059\u3002 <a target=\"_blank\" href=\"https:\/\/github.com\/ecpplus\/shell-utils\/tree\/master\/MacOS\/Services\" rel=\"noreferrer noopener\">GitHub repo(ecpplus\/shell-utils)<\/a><\/p>\n<p>\u4ee5\u4e0b\u3001\u4f5c\u6210\u65b9\u6cd5\u306e\u8aac\u660e\u3067\u3059\u3002<\/p>\n<h2>\u6e96\u5099<\/h2>\n<h3>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u5909\u63db\u65b9\u6cd5\u3092\u78ba\u8a8d\u3059\u308b<\/h3>\n<h4>sips \u30b3\u30de\u30f3\u30c9<\/h4>\n<p>macOS \u306b\u6a19\u6e96\u3067\u5165\u3063\u3066\u3044\u308b <code>sips<\/code> \u30b3\u30de\u30f3\u30c9\u3067\u753b\u50cf\u5909\u63db\u304c\u51fa\u6765\u307e\u3059\u3002 <code>\/usr\/bin\/sips<\/code> \u306b\u3042\u308a\u307e\u3059\u3002\u69d8\u3005\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u5909\u66f4\u306e\u307f\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u4efb\u610f\u306e\u753b\u50cf\u3092 jpeg \u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u5909\u66f4\u3059\u308b\u306b\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">sips -s format jpeg $input_path --out $output_path<\/code><\/pre>\n<h4>\u51fa\u529b\u5148\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6574\u3048\u308b<\/h4>\n<p>\u51fa\u529b\u30d5\u30a1\u30a4\u30eb\u540d\u306f <code>foobar.jpg<\/code> \u306e\u3088\u3046\u306b <code>.jpg<\/code> \u3067\u7d42\u308f\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3067\u3059. \u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u7c21\u5358\u306b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u51fa\u6765\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">INPUT=&quot;\/foo\/bar\/IMG_1234.heic&quot;\necho ${INPUT%%.*}.jpg\n\n=&gt; \/foo\/bar\/IMG_1234.jpg<\/code><\/pre>\n<h4>\u8907\u6570\u753b\u50cf\u3092\u4e00\u6c17\u306b\u5909\u63db\u3057\u305f\u3044<\/h4>\n<p><code>for<\/code> \u30eb\u30fc\u30d7\u3092\u4f7f\u3063\u3066\u8907\u6570\u753b\u50cf\u3092\u307e\u3068\u3081\u3066\u51e6\u7406\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">for f in &quot;$@&quot;\ndo\n  sips -s format jpeg &quot;$f&quot; --out &quot;${f%%.*}&quot;.jpg\ndone<\/code><\/pre>\n<h2>Automator workflow \u3092\u4f5c\u6210<\/h2>\n<p>\u4e0a\u8a18\u306e\u6e96\u5099\u3092 Automator \u306e workflow \u306b\u307e\u3068\u3081\u307e\u3059\u3002<\/p>\n<ol>\n<li><code>Automator.app<\/code> \u3092\u8d77\u52d5\u3057\u307e\u3059\u3002 (<code>\/Applications\/<\/code> \u4ee5\u4e0b\u306b\u3042\u308a\u307e\u3059)<\/li>\n<li><code>File<\/code> (\u2318N) \u304b\u3089 <code>Create a new workflow<\/code> \u3067\u65b0\u898f\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/li>\n<li><code>Quick Action<\/code> \u3092\u9078\u629e\u3057\u307e\u3059\u3002 <img decoding=\"async\" data-src=\"https:\/\/ecpplus.net\/weblog\/wp-content\/uploads\/2021\/06\/automator1-700x625.jpg\" alt=\"New\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 700px; --smush-placeholder-aspect-ratio: 700\/625;\" \/><\/li>\n<li>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b workflow \u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002 <img decoding=\"async\" data-src=\"https:\/\/ecpplus.net\/weblog\/wp-content\/uploads\/2021\/06\/automator2-700x311.jpg\" alt=\"Workflow\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 700px; --smush-placeholder-aspect-ratio: 700\/311;\" \/><\/p>\n<ol>\n<li>actions \u304b\u3089 <code>Run Shell Script<\/code> \u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/li>\n<li>Workflow receives current <code>image files<\/code> in <code>Finder.app<\/code> \u3068\u306a\u308b\u3088\u3046\u306b\u9078\u629e\u3057\u307e\u3059\u3002<\/li>\n<li>\u4e0b\u8a18\u306e shell script \u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n<pre><code class=\"language-bash\">for f in $@\ndo\nsips -s format jpeg $f --out ${f%%.*}.jpg\ndone<\/code><\/pre>\n<\/li>\n<li>\u540d\u524d\u3092\u4ed8\u3051\u3066\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/li>\n<li>\u3053\u308c\u3067\u5b8c\u6210\u3067\u3059\u3002Finder \u304b\u3089\u4f7f\u3048\u307e\u3059\u3002<\/li>\n<\/ol>\n<h2>\u4f7f\u3044\u65b9<\/h2>\n<h3>\u30b3\u30f3\u30c6\u30af\u30b9\u30c8\u30e1\u30cb\u30e5\u30fc\u304b\u3089<\/h3>\n<ol>\n<li>1\u3064\u3082\u3057\u304f\u306f\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3057\u3001\u53f3\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/li>\n<li><code>Service &gt; Convert to JPEG<\/code> \u3092\u9078\u629e\u3057\u307e\u3059 (\u4fdd\u5b58\u3057\u305f\u6642\u306b\u4ed8\u3051\u305f\u540d\u524d) <img decoding=\"async\" data-src=\"https:\/\/ecpplus.net\/weblog\/wp-content\/uploads\/2021\/06\/automator3-700x850.jpg\" alt=\"From\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 700px; --smush-placeholder-aspect-ratio: 700\/850;\" \/><\/li>\n<\/ol>\n<h3>\u30d7\u30ec\u30d3\u30e5\u30fc\u30a8\u30ea\u30a2\u304b\u3089<\/h3>\n<p>\u30d7\u30ec\u30d3\u30e5\u30fc\u30a8\u30ea\u30a2\u306b\u3082\u81ea\u52d5\u7684\u306b\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" data-src=\"https:\/\/ecpplus.net\/weblog\/wp-content\/uploads\/2021\/06\/automator4-700x463.jpg\" alt=\"From\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 700px; --smush-placeholder-aspect-ratio: 700\/463;\" \/><\/p>\n<hr \/>\n<p>\u8272\u3005\u3068 CUI \u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u3057\u307e\u3044\u304c\u3061\u3060\u3051\u3069\u3001GUI \u306e\u65b9\u304c\u4fbf\u5229\u306a\u3082\u306e\u306f Automator \u3092\u4f7f\u3063\u3066\u5b9f\u88c5\u3059\u308b\u306e\u306f\u826f\u3044\u30a2\u30a4\u30c7\u30a2\u306a\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\ud83d\udc4c\ud83c\udffb<\/p>\n","protected":false},"excerpt":{"rendered":"<p>iPhone \u3067\u5199\u771f\u3092\u64ae\u308b\u3068 .heic () \u306b\u306a\u308a\u307e\u3059\u3002macOS \u4e0a\u3067\u898b\u308b\u5206\u306b\u306f\u554f\u984c\u306a\u3044\u3093\u3067\u3059\u304c\u3001\u5171\u6709\u3059\u308b\u6642\u306b JPEG \u306b\u3057\u305f\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002 Finder \u3092\u62e1\u5f35\u3059\u308b macOS \u6a19\u6e96\u6a5f\u80fd\u306e Quick Ac [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3832,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[12],"class_list":["post-3824","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development","tag-mac"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/3824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/comments?post=3824"}],"version-history":[{"count":10,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/3824\/revisions"}],"predecessor-version":[{"id":4184,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/3824\/revisions\/4184"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/media\/3832"}],"wp:attachment":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/media?parent=3824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/categories?post=3824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/tags?post=3824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}