{"id":759,"date":"2021-10-21T13:01:37","date_gmt":"2021-10-21T04:01:37","guid":{"rendered":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/?p=759"},"modified":"2021-11-02T21:17:51","modified_gmt":"2021-11-02T12:17:51","slug":"post-759","status":"publish","type":"post","link":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/archives\/759","title":{"rendered":"\u5199\u771f\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u3064\u304f\u308b"},"content":{"rendered":"\n<p>\u305f\u304f\u3055\u3093\u64ae\u3063\u305f\u5199\u771f\u306e\u30b5\u30e0\u30cd\u30a4\u30eb\u3092HTML\u3067\u4f5c\u308a\u307e\u3059\u3002\u7279\u5b9a\u306e\u753b\u50cf\u7ba1\u7406\u30bd\u30d5\u30c8\u3092\u4f7f\u308f\u306a\u3044\u306e\u3067\u3001\u81ea\u7531\u306b\u30ec\u30a4\u30a2\u30a6\u30c8\u3057\u3066\u8aac\u660e\u3092\u52a0\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>ImageMagick\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<ol>\n<li>Windows Subsystem for Linux (WSL)\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/li>\n<li>Bash on Ubuntu on Windows\u3092\u8d77\u52d5<\/li>\n<li>sudo apt-get install imagemagic \u3068\u3057\u3066ImageMagick\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/li>\n<li>convert -version \u3068\u3057\u3066Version: ImageMagick 6.8.9-9&#8230; \u306a\u3069\u3068\u8868\u793a\u3055\u308c\u308c\u3070OK<\/li>\n<\/ol>\n<h3>\u30b5\u30e0\u30cd\u30a4\u30eb\u3092\u4f5c\u6210<\/h3>\n<p>ImageMagick\u306e\u753b\u50cf\u3092\u52a0\u5de5\u3059\u308b\u30b3\u30de\u30f3\u30c9\u306b\u306fconvert\u3068mogrify\u304c\u3042\u308a\u307e\u3059\u3002convert\u306f\u5143\u306e\u753b\u50cf\u3092\u52a0\u5de5\u3057\u3066\u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308a\u307e\u3059\u3002mogrify\u306f\u5143\u306e\u753b\u50cf\u3092\u52a0\u5de5\u5f8c\u306e\u753b\u50cf\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002\u7814\u7a76\u3067\u64ae\u3063\u305f\u5199\u771f\u306f\u5fc5\u305a\u5143\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3001convert\u3092\u4f7f\u3044\u307e\u3059\u3002\n<pre class='console'>$ identify original.tiff    # \u753b\u50cf\u306e\u60c5\u5831\u3092\u8abf\u3079\u308b\noriginal.tif[0] TIFF 1600x900 1600x900+0+0 16-bit Grayscale Gray 3.149MB 0.000u 0:00.000    # \u753b\u50cf\u306e\u5927\u304d\u3055(1600x900)\u304c\u308f\u304b\u308b\u3002\n$ convert -thumbnail 160x90 original.tiff thumbnail.jpg  # TIFF\u753b\u50cf\u304b\u3089160x90 px\u306e\u5927\u304d\u3055\u306eJPEG\u753b\u50cf\u3092\u3064\u304f\u308b\n<\/pre>\n<h3>\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u5168\u3066\u306e\u753b\u50cf\u304b\u3089\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u3064\u304f\u308b<\/h3>\n<p>\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u3064\u304f\u3063\u3066\u3001index.html\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\n<pre class='code'>#!\/bin\/bash\nEXT=.JPG\nOUT_DIR=thumbnail\nif [ ! -d $OUT_DIR ] ; then\n\tmkdir -p $OUT_DIR\nfi\n\ncat &lt;&lt;-HEADER\n&lt;html&gt;\n&lt;head&gt;&lt;style type='text\/css'&gt;&lt;!--\n.frame {\n  floag:left;\n}\n-->&lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\nHEADER\n\nls *$EXT | while read F ; do\n\tOUT=$OUT_DIR\/$(basename $F)\n\tif [ ! -f \"$OUT\" ] ; then\n\t\tconvert -thumbnail 160x90 $F $OUT\n\tfi\n\techo \"&lt;div class='frame'&gt;&lt;h4&gt;\"$(basename $F $EXT)\"&lt;\/h4&gt;&lt;img src='$OUT'&gt;&lt;\/div&gt;\"\ndone\ncat &lt;&lt;-FOOTER\n&lt;\/body&gt;\n&lt;\/html&gt;\nFOOTER\n<\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class='console'>$ cd working_dir    # \u5199\u771f\u306e\u3042\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3078\u79fb\u52d5\n$ .\/thumbnail.sh &gt;index.html\n<\/pre>\n<p>index.html\u3092\u7de8\u96c6\u3057\u3066\u597d\u307f\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u4ed5\u4e0a\u3052\u308b\u3002\u79c1\u306e\u597d\u307f\u306ffieldset\u3067\u5199\u771f\u3092\u30b0\u30eb\u30fc\u30d7\u306b\u3057\u3066\u3001legend\u3067\u305d\u306e\u540d\u524d\u3092\u3044\u308c\u308b\u65b9\u6cd5\u3067\u3059\u3002\u305d\u306e\u969b.frame\u306e\u30b9\u30bf\u30a4\u30eb\u3092\u524a\u9664\u3057\u3066\u3001fieldset\u306bdisplay: flex;\u3092\u3044\u308c\u308b\u3068\u3088\u3044\u3067\u3059\u3002<\/p>\n<p>\u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u6d88\u3057\u3066\u3057\u307e\u308f\u306a\u3044\u3088\u3046\u306b\u3001\u6700\u521d\u306f\u3069\u3053\u304b\u306b\u30b3\u30d4\u30fc\u3092\u3064\u304f\u3063\u3066\u8a66\u3059\u3068\u3044\u3044\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305f\u304f\u3055\u3093\u64ae\u3063\u305f\u5199\u771f\u306e\u30b5\u30e0\u30cd\u30a4\u30eb\u3092HTML\u3067\u4f5c\u308a\u307e\u3059\u3002\u7279\u5b9a\u306e\u753b\u50cf\u7ba1\u7406\u30bd\u30d5\u30c8\u3092\u4f7f\u308f\u306a\u3044\u306e\u3067\u3001\u81ea\u7531\u306b\u30ec\u30a4\u30a2\u30a6\u30c8\u3057\u3066\u8aac\u660e\u3092\u52a0\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 ImageMagick\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb Windows Subsystem for  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"_links":{"self":[{"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/posts\/759"}],"collection":[{"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/comments?post=759"}],"version-history":[{"count":22,"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/posts\/759\/revisions"}],"predecessor-version":[{"id":789,"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/posts\/759\/revisions\/789"}],"wp:attachment":[{"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/media?parent=759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/categories?post=759"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/tags?post=759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}