{"id":248,"date":"2014-10-31T00:48:15","date_gmt":"2014-10-30T15:48:15","guid":{"rendered":"http:\/\/blog.tkouen.mydns.jp\/wordpress\/?p=248"},"modified":"2014-11-06T22:16:58","modified_gmt":"2014-11-06T13:16:58","slug":"%e3%83%a1%e3%83%a2%e3%82%a2%e3%83%8b%e3%83%a1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3gif%e3%81%ae%e3%83%81%e3%82%a7%e3%83%83%e3%82%afphp","status":"publish","type":"post","link":"https:\/\/devlog.nb3.jp\/wordpress\/248","title":{"rendered":"[\u30e1\u30e2]\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3gif\u306e\u30c1\u30a7\u30c3\u30af[php]"},"content":{"rendered":"<p>\u304a\u3072\u3055\u3057\u3076\u308a\u3067\u3059\u3002<\/p>\n<p>\u30bf\u30a4\u30c8\u30eb\u306e\u901a\u308a\u3001\u30c1\u30a7\u30c3\u30af\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3gif\u304b\u305d\u3046\u3058\u3083\u306a\u3044\u304b\u306e\u30c1\u30a7\u30c3\u30af\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30fb\u30fb\u30fb<\/p>\n<p>\u3067\u3001\u3068\u307b\u307b\u3055\u3093\u306e<a href=\"http:\/\/www.tohoho-web.com\/wwwgif.htm\" target=\"_blank\">GIF\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u8a73\u7d30<\/a>\u3092\u53c2\u8003\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: php; gutter: true; first-line: 1; highlight: []; html-script: false\">\r\n\/**\r\n * \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3GIF\u304b\u30c1\u30a7\u30c3\u30af\r\n *\r\n * @params string $img_file   \u753b\u50cf\u30d5\u30a1\u30a4\u30eb\uff08\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u307e\u3067\u306ePATH\u4ed8\u304d\uff09\r\n * @return bool               true\uff1a\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3GIF false\uff1a\u305d\u308c\u4ee5\u5916\r\n *\/\r\nfunction checkAnimationGif($img_file) {\r\n    if (!file_exists($img_file)) {\r\n        \/\/ \u30d5\u30a1\u30a4\u30eb\u304c\u7121\u3044\r\n        return false;\r\n    }\r\n    if (!($fp = fopen($img_file, &quot;rb&quot;))) return false;\r\n    $head = fread($fp, 6);\r\n    if (!preg_match(&quot;\/^GIF89a\/&quot;, $head)) {\r\n        \/\/ GIF89a \u4ee5\u5916\r\n        return false;\r\n    }\r\n    \/\/ \u30ab\u30a6\u30f3\u30c8\u521d\u671f\u5316\r\n    $gce_cnt = 0;\r\n    while (!feof($fp)) {\r\n        if (bin2hex(fread($fp, 1)) != &quot;21&quot;) continue;\r\n        switch (bin2hex(fread($fp, 2))) {\r\n            \/*\r\n            \/\/ 2014-11-06 \u524a\u9664\r\n            case &quot;ff0b&quot;: \/\/ Application Extension\r\n                fclose($fp);\r\n                return true;\r\n                break;\r\n            *\/\r\n            case &quot;f904&quot;: \/\/ Graphic Control Extension\r\n                $gce_cnt++;\r\n                if ($gce_cnt &gt; 1) {\r\n                    fclose($fp);\r\n                    unset($gce_cnt);\r\n                    return true;\r\n                }\r\n                break;\r\n        }\r\n    }\r\n    fclose($fp);\r\n    unset($gce_cnt);\r\n    return false;\r\n}\r\n<\/pre>\n<p>\u591a\u5206\u3053\u308c\u3067\u3001\u30c1\u30a7\u30c3\u30af\u3067\u304d\u308b\u306f\u305a\u30fb\u30fb\u30fb<\/p>\n<p>\u8ffd\u8a18\uff1a2014-11-06<br \/>\nadobe\u306e\u30d5\u30a9\u30c8\u30b7\u30e7\u30c3\u30d7\u3067\u4f5c\u6210\u3055\u308c\u305fgif\u3067Application Extension\u304c\u542b\u307e\u308c\u308b\u901a\u5e38\u306egif\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u306e\u3067<br \/>\n\u4e0a\u8a18\u306e\u30bd\u30fc\u30b9\u3092\u4fee\u6b63\u3057\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u304a\u3072\u3055\u3057\u3076\u308a\u3067\u3059\u3002 \u30bf\u30a4\u30c8\u30eb\u306e\u901a\u308a\u3001\u30c1\u30a7\u30c3\u30af\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3gif\u304b\u305d\u3046\u3058\u3083\u306a\u3044\u304b\u306e\u30c1\u30a7\u30c3\u30af\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30fb\u30fb\u30fb \u3067\u3001\u3068\u307b\u307b\u3055\u3093\u306eGIF\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u8a73\u7d30\u3092\u53c2\u8003\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002 \/** * \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3GI &hellip; <a href=\"https:\/\/devlog.nb3.jp\/wordpress\/248\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,9,28,1],"tags":[83,84,20,85,109],"class_list":["post-248","post","type-post","status-publish","format-standard","hentry","category-php","category-program","category-28","category-1","tag-animation-gif","tag-check","tag-php-2","tag-gif","tag-109"],"_links":{"self":[{"href":"https:\/\/devlog.nb3.jp\/wordpress\/wp-json\/wp\/v2\/posts\/248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devlog.nb3.jp\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devlog.nb3.jp\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devlog.nb3.jp\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/devlog.nb3.jp\/wordpress\/wp-json\/wp\/v2\/comments?post=248"}],"version-history":[{"count":0,"href":"https:\/\/devlog.nb3.jp\/wordpress\/wp-json\/wp\/v2\/posts\/248\/revisions"}],"wp:attachment":[{"href":"https:\/\/devlog.nb3.jp\/wordpress\/wp-json\/wp\/v2\/media?parent=248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devlog.nb3.jp\/wordpress\/wp-json\/wp\/v2\/categories?post=248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devlog.nb3.jp\/wordpress\/wp-json\/wp\/v2\/tags?post=248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}