{"id":2995,"date":"2018-02-16T12:31:04","date_gmt":"2018-02-16T03:31:04","guid":{"rendered":"http:\/\/ad114l2yb6.smartrelease.jp\/aiold\/?p=2995"},"modified":"2018-02-16T12:36:22","modified_gmt":"2018-02-16T03:36:22","slug":"cpi_upload","status":"publish","type":"post","link":"https:\/\/ad114l2yb6.smartrelease.jp\/aiold\/cpi_upload\/","title":{"rendered":"CPI ACE01\u74b0\u5883\u3067\u753b\u50cf\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u6a5f\u80fd\u3092\u4f5c\u308b"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002<br \/>\n\u30aa\u30ea\u30b8\u30ca\u30eb\u306eCMS\u3092\u4f5c\u308b\u5834\u5408\u3001\u7d76\u5bfe\u306b\u5fc5\u8981\u306a\u6a5f\u80fd\u306e\u4e00\u3064\u304c\u753b\u50cf\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u6a5f\u80fd\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u305d\u306e\u4f5c\u308a\u65b9\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<br \/>\n\u74b0\u5883\u306fCPI ACE01\u306e\u74b0\u5883\u3067\u3059\u3002<\/p>\n<h4 class=\"blog-h4\">\u521d\u3081\u306b<\/h4>\n<p>\u307e\u305a\u306f\u5358\u7d14\u306a\u753b\u50cf\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u6a5f\u80fd\u3092\u4f5c\u308a\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4eca\u56de\u306f\u8272\u3005\u306a\u8aac\u660e\u3092\u5439\u304d\u98db\u3070\u3057\u3066\u3001\u5358\u7d14\u306a\u753b\u50cf\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u95a2\u6570\u3092\u4f5c\u308a\u307e\u3059\u3002<br \/>\n\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u30a2\u30c3\u30d7\u3055\u308c\u305f\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u30d5\u30a9\u30eb\u30c0\u306b\u30a2\u30c3\u30d7\u3057\u307e\u3059\u3002<\/p>\n<pre><code>$file = $_FILES[&quot;form_image&quot;];\r\nimguploader($file);\r\nfunction imguploader($temp_file){\r\n    if(preg_match(&#039;\/\\.gif$|\\.png$|\\.jpg$|\\.jpeg$\/i&#039;, $temp_file[&quot;name&quot;])){\r\n        $add_img=$temp_file[&quot;name&quot;];\r\n        move_uploaded_file($temp_file[&quot;tmp_name&quot;], &quot;..\/gallery\/&quot; .$add_img);\r\n        $result = $add_img;\r\n    }else{\r\n        $result = &quot;failed&quot;;\r\n    }\r\n    return $result;\r\n}\r\n<\/code><\/pre>\n<p>\u753b\u50cf\u30a2\u30c3\u30d7\u3092\u4f5c\u308b\u3060\u3051\u306a\u3089\u7d50\u69cb\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u3002<br \/>\n\u307e\u305a\u3001\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u53d7\u3051\u53d6\u308a\u3001\u305d\u308c\u3089\u304c\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<br \/>\n\u305d\u306e\u5f8c\u3001$move_uploaded_file\u95a2\u6570\u3092\u7528\u3044\u3001\u6307\u5b9a\u306e\u30d5\u30a9\u30eb\u30c0\u306b\u683c\u7d0d\u3002<br \/>\n\u306d\u3001\u7c21\u5358\u3067\u3057\u3087\uff1f<\/p>\n<h4 class=\"blog-h4\">\u601d\u308f\u306c\u843d\u3068\u3057\u7a74<\/h4>\n<p>\u843d\u3068\u3057\u7a74\u306f\u5b58\u5728\u3059\u308b\u3082\u306e\u3067\u3001\u4e0a\u8a18\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u306b\u306f\u753b\u50cf\u51e6\u7406\u304c\u5165\u3063\u3066\u3044\u307e\u305b\u3093\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u5229\u7528\u8005\u304c\u5927\u304d\u306a\u753b\u50cf\u3092\u5165\u308c\u3066\u3057\u307e\u3063\u305f\u308a\u3059\u308b\u3068\u3001\u30da\u30fc\u30b8\u304c\u91cd\u304f\u306a\u3063\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001iPhone\u7b49\u3067\u64ae\u5f71\u3055\u308c\u305f\u3001exif\u60c5\u5831\u304c\u7279\u6b8a\u306a\u753b\u50cf\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u3068\u753b\u50cf\u304c\u5909\u306a\u65b9\u5411\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u3068\u306f\u3044\u3048\u3001\u753b\u50cf\u51e6\u7406\u306f\u4e00\u304b\u3089\u4f5c\u308b\u3068\u7d50\u69cb\u5927\u5909\u3067\u3059\u3002<br \/>\ngd\u95a2\u6570\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u3061\u3089\u3082\u66f8\u304f\u5185\u5bb9\u304c\u591a\u304f\u3001\u9762\u5012\u304f\u3055\u3044\u3067\u3059\u3002<br \/>\n\u3053\u3053\u3067\u5f79\u306b\u7acb\u3064\u306e\u304c\u3001\u300cImageMagick\u300d\u3067\u3059\u3002<\/p>\n<h4 class=\"blog-h4\">ImageMagick\u3092\u7528\u3044\u3066\u753b\u50cf\u51e6\u7406\u3092\u884c\u3046<\/h4>\n<p>ImageMagick\u306fPHP\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u753b\u50cf\u51e6\u7406\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3042\u308a\u3001\u591a\u304f\u306e\u30ec\u30f3\u30bf\u30eb\u30b5\u30fc\u30d0\u30fc\u3067\u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3001CPI ACE01\u3067\u306fphp.ini\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u5165\u3059\u308b\u3053\u3068\u3067\u4f7f\u7528\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code>extension=imagick.so<\/code><\/pre>\n<p>\u4e0a\u8a18\u3092\u8e0f\u307e\u3048\u3001\u95a2\u6570\u90e8\u5206\u306b\u5909\u66f4\u3092\u884c\u3063\u305f\u3082\u306e\u304c\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<pre><code>function imguploader($temp_file){\r\n    if(preg_match(&#039;\/\\.gif$|\\.png$|\\.jpg$|\\.jpeg$\/i&#039;, $temp_file[&quot;name&quot;])){\r\n        $add_img=$temp_file[&quot;name&quot;];\r\n        move_uploaded_file($temp_file[&quot;tmp_name&quot;], &quot;..\/gallery\/&quot; .$add_img);\r\n        \r\n        \/\/\u3053\u3053\u304b\u3089\u8ffd\u52a0\r\n        $changeimg = &quot;..\/gallery\/$add_img&quot;;\r\n        list($width,$height) = getimagesize($changeimg);\r\n        if($width &gt;= 1921){\r\n            $imgchanger=&quot;\/usr\/local\/bin\/mogrify -auto-orient -resize 1920x -quality 80 $changeimg&quot;;\r\n            exec($imgchanger);\r\n            exec(&#039;mogrify&#039;,$out);\r\n        }else{\r\n            $imgchanger=&quot;\/usr\/local\/bin\/mogrify -auto-orient -quality 80 $changeimg&quot;;\r\n            exec($imgchanger);\r\n            exec(&#039;mogrify&#039;,$out);\r\n        }\r\n        \/\/\u3053\u3053\u307e\u3067\u8ffd\u52a0\r\n        \r\n        $result = $add_img;\r\n    }else{\r\n        $result = &quot;failed&quot;;\r\n    }\r\n    return $result;\r\n}\r\n<\/code><\/pre>\n<p>\u65b9\u6cd5\u3068\u3057\u3066\u306f\u3001\u4e00\u5ea6\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u305f\u753b\u50cf\u3092\u4e0a\u66f8\u304d\u4fdd\u5b58\u3059\u308b\u3068\u3044\u3046\u5f62\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n$changeimg\u3067\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u305f\u3070\u304b\u308a\u306e\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3002<br \/>\n\u305d\u3057\u3066\u3001\u5927\u304d\u306a\u753b\u50cf\u3060\u3063\u305f\u5834\u5408\u306e\u307f\u30ea\u30b5\u30a4\u30ba\u3092\u884c\u3044\u305f\u3044\u306e\u3067\u3001\u30b5\u30a4\u30ba\u3082\u53d6\u5f97\u3057\u307e\u3059\u3002<br \/>\n\u30b5\u30a4\u30ba\u306e\u53d6\u5f97\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089ImageMagick\u306e\u6a5f\u80fd\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<br \/>\n&#8220;\/usr\/local\/bin\/\uff5e&#8221;;\u3068\u66f8\u304f\u3053\u3068\u3067\u6e96\u5099\u304c\u53ef\u80fd\u3067\u3001\u4eca\u56de\u306e\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092\u76db\u308a\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002<br \/>\n\u3010mogrify\u3011\u65e2\u5b58\u30d5\u30a1\u30a4\u30eb\u3092\u4e0a\u66f8\u304d\u3057\u307e\u3059\u3088\uff5e\u3068\u3044\u3046\u8a18\u8ff0\u3067\u3059\u3002<br \/>\n\u3010-auto-orient\u3011exif\u60c5\u5831\u304c\u3064\u3044\u305f\u5199\u771f\u306e\u5411\u304d\u3092\u88dc\u6b63\u3057\u3066\u304f\u308c\u307e\u3059\u3002<br \/>\n\u3010-resize 1920x\u3011\u753b\u50cf\u30b5\u30a4\u30ba\u3092\u6a2a1920\u57fa\u6e96\u3067\u30ea\u30b5\u30a4\u30ba\u3057\u307e\u3059\u3002\uff08\u753b\u50cf\u30b5\u30a4\u30ba1921\u4ee5\u4e0a\u306e\u3068\u304d\u306e\u307f\u8a18\u8ff0\uff09<br \/>\n\u3010-quality 80\u3011\u753b\u8cea\u309280\uff05\u306b\u843d\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ed6\u306b\u3082\u69d8\u3005\u306a\u6a5f\u80fd\u304c\u3042\u308b\u306e\u3067\u3001\u6c17\u306b\u306a\u308b\u65b9\u306f\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u3092\u304a\u3059\u3059\u3081\u3067\u3059\u3002<br \/>\nImageMagick \u30b3\u30de\u30f3\u30c9\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<br \/>\n<a href=\"http:\/\/image-magick.com\/\">http:\/\/image-magick.com\/<\/a><\/p>\n<p>\u3053\u308c\u3067\u3001\u901a\u5e38\u901a\u308a\u4f7f\u3046\u5834\u5408\u306b\u304a\u3044\u3066\u3001\u56f0\u308b\u3053\u3068\u306f\u5c11\u306a\u304f\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u6700\u5f8c\u306bexec\u95a2\u6570\u3067\u3001$imgchanger\u5909\u6570\u306e\u4e2d\u8eab\u3092\u5b9f\u884c\u3001\u3053\u308c\u3067\u30a2\u30c3\u30d7\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u30ea\u30b5\u30a4\u30ba\u3055\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h4 class=\"blog-h4\">\u307e\u3068\u3081<\/h4>\n<p>ImageMagick\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u753b\u50cf\u51e6\u7406\u3092\u7c21\u5358\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u5f8c\u306e\u51e6\u7406\u306b\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u4f7f\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002 \u30aa\u30ea\u30b8\u30ca\u30eb\u306eCMS\u3092\u4f5c\u308b\u5834\u5408\u3001\u7d76\u5bfe\u306b\u5fc5\u8981\u306a\u6a5f\u80fd\u306e\u4e00\u3064\u304c\u753b\u50cf\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u6a5f\u80fd\u3067\u3059\u3002 \u4eca\u56de\u306f\u305d\u306e\u4f5c\u308a\u65b9\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002 \u74b0\u5883\u306fCPI ACE01\u306e\u74b0\u5883\u3067\u3059\u3002 \u521d\u3081\u306b \u307e\u305a\u306f\u5358\u7d14\u306a\u753b\u50cf\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u6a5f\u80fd\u3092\u4f5c\u308a\u307e\u3057\u3087\u3046&#8230;<\/p>\n","protected":false},"author":3,"featured_media":2996,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[8,21,15],"tags":[],"_links":{"self":[{"href":"https:\/\/ad114l2yb6.smartrelease.jp\/aiold\/wp-json\/wp\/v2\/posts\/2995"}],"collection":[{"href":"https:\/\/ad114l2yb6.smartrelease.jp\/aiold\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ad114l2yb6.smartrelease.jp\/aiold\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ad114l2yb6.smartrelease.jp\/aiold\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ad114l2yb6.smartrelease.jp\/aiold\/wp-json\/wp\/v2\/comments?post=2995"}],"version-history":[{"count":4,"href":"https:\/\/ad114l2yb6.smartrelease.jp\/aiold\/wp-json\/wp\/v2\/posts\/2995\/revisions"}],"predecessor-version":[{"id":6281,"href":"https:\/\/ad114l2yb6.smartrelease.jp\/aiold\/wp-json\/wp\/v2\/posts\/2995\/revisions\/6281"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ad114l2yb6.smartrelease.jp\/aiold\/wp-json\/wp\/v2\/media\/2996"}],"wp:attachment":[{"href":"https:\/\/ad114l2yb6.smartrelease.jp\/aiold\/wp-json\/wp\/v2\/media?parent=2995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ad114l2yb6.smartrelease.jp\/aiold\/wp-json\/wp\/v2\/categories?post=2995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ad114l2yb6.smartrelease.jp\/aiold\/wp-json\/wp\/v2\/tags?post=2995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}