{"id":2944,"date":"2023-09-12T12:10:00","date_gmt":"2023-09-12T03:10:00","guid":{"rendered":"https:\/\/comcent.co.jp\/blog\/?p=2944"},"modified":"2023-09-07T17:09:08","modified_gmt":"2023-09-07T08:09:08","slug":"%e7%94%bb%e5%83%8f%e6%93%8d%e4%bd%9c%e3%81%ae%e6%99%82%e3%81%ab%e3%82%b9%e3%83%9e%e3%83%9b%e7%b8%a6%e7%94%bb%e5%83%8f%e3%81%8c%e5%9b%9e%e8%bb%a2%e3%81%97%e3%81%a6%e4%bf%9d%e5%ad%98%e3%81%95%e3%82%8c","status":"publish","type":"post","link":"https:\/\/comcent.co.jp\/blog\/archives\/2944\/","title":{"rendered":"\u753b\u50cf\u64cd\u4f5c\u306e\u6642\u306b\u30b9\u30de\u30db\u7e26\u753b\u50cf\u304c\u56de\u8ee2\u3057\u3066\u4fdd\u5b58\u3055\u308c\u3066\u3057\u307e\u3046\u554f\u984c\u3092\u89e3\u8aac\u3010CodeIgniter4\u3011"},"content":{"rendered":"\n<p>CodeIgniter4\u306b\u306f\u3001\u753b\u50cf\u64cd\u4f5c\u306b\u95a2\u3057\u3066\u4fbf\u5229\u306a\u30d8\u30eb\u30d1\u30fc\u3084\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u753b\u50cf\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u5f8c\u306b\u30ea\u30b5\u30a4\u30ba\u3068\u5207\u308a\u629c\u304d\u3092\u884c\u304a\u3046\u3068\u3057\u305f\u3068\u304d\u306b\u3001\u64cd\u4f5c\u3059\u308b\u5143\u753b\u50cf\u306b\u3088\u3063\u3066\u95b2\u89a7\u3057\u3066\u3044\u308b\u3068\u304d\u306e\u753b\u50cf\u72b6\u614b\u304b\u308990\u5ea6\u56de\u8ee2\u3057\u3066\u3044\u308b\u7b49\u3001\u753b\u50cf\u306e\u89d2\u5ea6\u306b\u95a2\u3059\u308b\u554f\u984c\u304c\u8d77\u304d\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002\u8abf\u3079\u305f\u3068\u3053\u308d\u3001\u3053\u306e\u539f\u56e0\u306f\u5143\u753b\u50cf\u306eEXIF\u60c5\u5831(orientation)\u306b\u3042\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u3002\u4eca\u56de\u306f\u3053\u306e\u554f\u984c\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">EXIF\u3068\u306f\uff1f<\/h4>\n\n\n\n<p>EXIF\uff08Exchangeable Image File Format\uff09\u306f\u3001\u30c7\u30b8\u30bf\u30eb\u753b\u50cf\u306b\u4ed8\u52a0\u3055\u308c\u308b\u30e1\u30bf\u30c7\u30fc\u30bf\u306e\u4e00\u3064\u3067\u3059\u3002\u30ab\u30e1\u30e9\u3084\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306a\u3069\u3067\u64ae\u5f71\u3055\u308c\u305f\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u3001\u305d\u306e\u753b\u50cf\u306b\u95a2\u3059\u308b\u3055\u307e\u3056\u307e\u306a\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u60c5\u5831\u306f\u3001EXIF\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u4f7f\u3063\u3066\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306b\u57cb\u3081\u8fbc\u307e\u308c\u3001\u753b\u50cf\u3092\u51e6\u7406\u3057\u305f\u308a\u3001\u8868\u793a\u3057\u305f\u308a\u3059\u308b\u969b\u306b\u5229\u7528\u3055\u308c\u307e\u3059\u3002\u305d\u306e\u4e2d\u3067\u3082\u4eca\u56de\u5f71\u97ff\u3059\u308b\"orientation\"\u306f\u3001\u753b\u50cf\u304c\u64ae\u5f71\u3055\u308c\u305f\u969b\u306e\u30ab\u30e1\u30e9\u306e\u5411\u304d\u3084\u753b\u50cf\u306e\u56de\u8ee2\u60c5\u5831\u3092\u793a\u3059\u30d5\u30a3\u30fc\u30eb\u30c9\u3067\u3059\u3002\u3069\u306e\u3088\u3046\u306b\u56de\u8ee2\u88dc\u6b63\u3059\u308c\u3070\u6b63\u3057\u304f\u88dc\u6b63\u3067\u304d\u308b\u306e\u304b\u304c\u5024\u3068\u3057\u3066\u683c\u7d0d\u3055\u308c\u3066\u3044\u307e\u3059\u3002orientation\u306e\u5024\u306f\u3001\u6570\u5024\u3067\u8868\u3055\u308c\uff081\u304b\u30898\u307e\u3067\u306e\u6574\u6570\uff09\u3001\u4e00\u822c\u7684\u306a\u5024\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059<\/p>\n\n\n\n<p><strong>1: \u305d\u306e\u307e\u307e<\/strong><\/p>\n\n\n\n<p><img decoding=\"async\" width=\"1500\" height=\"1000\" loading=\"lazy\" class=\"wp-image-2957\" style=\"width: 300px\" src=\"https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif-1.jpg\" alt=\"\" srcset=\"https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif-1.jpg 1500w, https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif-1-300x200.jpg 300w, https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif-1-1024x683.jpg 1024w, https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif-1-768x512.jpg 768w\" sizes=\"auto, (max-width: 1500px) 100vw, 1500px\" \/><strong><br>3: 180\u5ea6\u56de\u8ee2<\/strong><\/p>\n\n\n\n<p><img decoding=\"async\" width=\"1500\" height=\"1000\" loading=\"lazy\" class=\"wp-image-2958\" style=\"width: 300px\" src=\"https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_3.jpg\" alt=\"\" srcset=\"https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_3.jpg 1500w, https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_3-300x200.jpg 300w, https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_3-1024x683.jpg 1024w, https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_3-768x512.jpg 768w\" sizes=\"auto, (max-width: 1500px) 100vw, 1500px\" \/><strong><br>6: \u6642\u8a08\u56de\u308a\u306b90\u5ea6\u56de\u8ee2<\/strong><\/p>\n\n\n\n<p><img decoding=\"async\" width=\"1000\" height=\"1500\" loading=\"lazy\" class=\"wp-image-2959\" style=\"width: 200px\" src=\"https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_6.jpg\" alt=\"\" srcset=\"https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_6.jpg 1000w, https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_6-200x300.jpg 200w, https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_6-683x1024.jpg 683w, https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_6-768x1152.jpg 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><strong><br>8: \u6642\u8a08\u56de\u308a\u306b270\u5ea6\u56de\u8ee2<\/strong><\/p>\n\n\n\n<p><img decoding=\"async\" width=\"1000\" height=\"1500\" loading=\"lazy\" class=\"wp-image-2960\" style=\"width: 200px\" src=\"https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_8.jpg\" alt=\"\" srcset=\"https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_8.jpg 1000w, https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_8-200x300.jpg 200w, https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_8-683x1024.jpg 683w, https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif_8-768x1152.jpg 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/p>\n\n\n\n<p>\u30c7\u30d0\u30a4\u30b9\u3084\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306f\u3001\u3053\u3061\u3089\u306eorientation\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u753b\u50cf\u3092\u6b63\u3057\u3044\u5411\u304d\u3067\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3066\u3044\u307e\u3059\u3002CI\u3067\u753b\u50cf\u64cd\u4f5c\u5f8c\u306b\u753b\u50cf\u3092\u4fdd\u5b58\u3059\u308b\u969b\u306b\u3001EXIF\u60c5\u5831\u3092\u53d6\u308a\u9664\u304b\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002\u305d\u306e\u7d50\u679c\u3001<strong>orientation\u306e\u5024\u304c\u6b20\u843d\u3057\u3066\u3057\u307e\u3044\u3001\u753b\u50cf\u306e\u5411\u304d\u304c\u9069\u5207\u306b\u88dc\u6b63\u3055\u308c\u306a\u304b\u3063\u305f<\/strong>\u3053\u3068\u304c\u539f\u56e0\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">\u5fc5\u8981\u306b\u5fdc\u3058\u3066orientation\u306e\u5024\u3092\u4fee\u6b63\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066<\/h4>\n\n\n\n<h5 class=\"wp-block-comcent-blog-miniheadline01 modSubheading\">1.EXIF\u60c5\u5831\u3092\u8aad\u307f\u53d6\u308b<\/h5>\n\n\n\n<p>PHP\u306b\u306f\u3001EXIF\u60c5\u5831\u3092\u8aad\u307f\u53d6\u308b\u305f\u3081\u306bexif_read_data()\u95a2\u6570\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u304b\u3089EXIF\u60c5\u5831\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"pageCodeArea\">\n<pre><code>\/\/ \u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\n$imageFilePath = 'path\/to\/image.jpg';\n\n\/\/ EXIF\u60c5\u5831\u306e\u8aad\u307f\u53d6\u308a\n$exifData = exif_read_data($imageFilePath);\n\n\/\/ \u3082\u3057orientation\u306e\u5024\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u305d\u306e\u5024\u3092\u53d6\u5f97\nif (isset($exifData['Orientation'])) {\n    $orientation = $exifData['Orientation'];\n    \/\/ \u3053\u3053\u3067orientation\u306e\u5024\u3092\u4f7f\u7528\u3057\u305f\u51e6\u7406\u3092\u884c\u3046\n}\n<\/code><\/pre>\n<\/div>\n\n\n\n<h5 class=\"wp-block-comcent-blog-miniheadline01 modSubheading\">2.orientation\u306e\u5024\u304b\u3089\u89d2\u5ea6\u3092\u88dc\u6b63\u3059\u308b<\/h5>\n\n\n\n<p>orientation\u306e\u5024\u306b\u3088\u3063\u3066\u305d\u308c\u305e\u308c\u89d2\u5ea6\u3092\u88dc\u6b63\u3059\u308b<br>1: \u305d\u306e\u307e\u307e<br>3: 180\u5ea6\u56de\u8ee2\u3057\u3066\u3044\u308b\u306e\u3067\u3001180\u5ea6\u56de\u8ee2\u3055\u305b\u308b<br>6: \u53cd\u6642\u8a08\u5468\u308a\u306b90\u5ea6\u56de\u8ee2\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u53cd\u6642\u8a08\u56de\u308a\u306b270\u5ea6\u56de\u8ee2\u3055\u305b\u308b<br>8: \u6642\u8a08\u5468\u308a\u306b90\u5ea6\u56de\u8ee2\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u53cd\u6642\u8a08\u56de\u308a\u306b90\u5ea6\u56de\u8ee2\u3055\u305b\u308b<\/p>\n\n\n\n<div class=\"pageCodeArea\">\n<pre><code>\/\/ \u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\n$imageFilePath = 'path\/to\/image.jpg';\n\n\/\/ EXIF\u60c5\u5831\u306e\u8aad\u307f\u53d6\u308a\n$exifData = exif_read_data($imageFilePath);\n\/\/ \u753b\u50cf\u306e\u5411\u304d\u306b\u5fdc\u3058\u3066\u56de\u8ee2\u3059\u308b\u89d2\u5ea6\u3092\u6c7a\u5b9a\n$degree = 0;\n\/\/ \u3082\u3057orientation\u306e\u5024\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u305d\u306e\u5024\u3092\u53d6\u5f97\nif (isset($exifData['Orientation'])) {\n    $orientation = $exifData['Orientation'];\n    \/\/ \u3053\u3053\u3067orientation\u306e\u5024\u3092\u4f7f\u7528\u3057\u305f\u51e6\u7406\u3092\u884c\u3046\n    switch ($orientation) {\n        \/\/180\u5ea6\u56de\u8ee2\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u53cd\u6642\u8a08\u56de\u308a\u306b180\u5ea6\u56de\u8ee2\u3055\u305b\u308b\n        case 3:\n          $degree = 180;\n          break;\n        \/\/\u53cd\u6642\u8a08\u5468\u308a\u306b90\u5ea6\u56de\u8ee2\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u53cd\u6642\u8a08\u56de\u308a\u306b270\u5ea6\u56de\u8ee2\u3055\u305b\u308b\n        case 6:\n          $degree = 270;\n          break;\n        \/\/\u6642\u8a08\u5468\u308a\u306b90\u5ea6\u56de\u8ee2\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u53cd\u6642\u8a08\u56de\u308a\u306b90\u5ea6\u56de\u8ee2\u3055\u305b\u308b\n        case 8:\n          $degree = 90;\n          break;\n      }\n}\n\n$imageSavePath = 'path\/save\/image_change.jpg';\n\/\/\u30ea\u30b5\u30a4\u30ba\u3068\u89d2\u5ea6\u88dc\u6b63\n$result = \\Config\\Services::image()\n            -&gt;withFile($dir . $name)\n            -&gt;resize($width, 0, true, 'width')\/\/\u30ea\u30b5\u30a4\u30ba\n            -&gt;rotate($degree)\/\/\u89d2\u5ea6\u88dc\u6b63\n            -&gt;save($path);\n<\/code><\/pre>\n<\/div>\n\n\n\n<p>\u3053\u306e\u624b\u9806\u3067\u89d2\u5ea6\u3092\u88dc\u6b63\u3057\u3066\u3042\u3052\u308c\u3070\u671f\u5f85\u3057\u305f\u89d2\u5ea6\u3067\u306e\u753b\u50cf\u64cd\u4f5c,\u4fdd\u5b58\u3092\u884c\u3046\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">\u307e\u3068\u3081<\/h4>\n\n\n\n<p>EXIF\u60c5\u5831\u5229\u7528\u3057\u3066\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c\u81ea\u52d5\u7684\u306b\u30e6\u30fc\u30b6\u30fc\u304c\u4f7f\u3044\u3084\u3059\u3044\u3088\u3046\u306a\u4fee\u6b63\u3092\u52a0\u3048\u3066\u304f\u308c\u3066\u3044\u307e\u3059\u3002\u4eca\u56de\u306e\u3088\u3046\u306b\u7de8\u96c6\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3084\u30b7\u30b9\u30c6\u30e0\u3092\u901a\u3059\u3068EXIF\u60c5\u5831\u304c\u5909\u66f4\u3055\u308c\u305f\u308a\u3059\u308b\u306e\u3067\u6ce8\u610f\u3057\u3066\u5236\u4f5c\u3092\u884c\u3044\u307e\u3057\u3087\u3046\u3002\u4ee5\u4e0a\u3067\u3059\u3001\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"has-text-align-right\"><a href=\"https:\/\/jp.freepik.com\/free-vector\/images-concept-illustration_5357829.htm\" data-type=\"URL\" data-id=\"https:\/\/jp.freepik.com\/free-vector\/images-concept-illustration_5357829.htm\">Designed by Pch.vector - Freepik.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CodeIgniter4\u306b\u306f\u3001\u753b\u50cf\u64cd\u4f5c\u306b\u95a2\u3057\u3066\u4fbf\u5229\u306a\u30d8\u30eb\u30d1\u30fc\u3084\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u753b\u50cf\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u5f8c\u306b\u30ea\u30b5\u30a4\u30ba\u3068\u5207\u308a\u629c\u304d\u3092\u884c\u304a\u3046\u3068\u3057\u305f\u3068\u304d\u306b\u3001\u64cd\u4f5c\u3059\u308b\u5143\u753b\u50cf\u306b\u3088\u3063\u3066\u95b2\u89a7\u3057\u3066\u3044\u308b\u3068\u304d\u306e\u753b\u50cf\u72b6\u614b\u304b\u308990\u5ea6\u56de\u8ee2\u3057\u3066 [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":2954,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[88,170,35,36,169],"coauthors":[49],"class_list":["post-2944","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backend","tag-codeigniter4","tag-exif","tag-php","tag-36","tag-169"],"author_meta":{"nickname":"K.D","position":"\u30d7\u30ed\u30b0\u30e9\u30de\u30fc","icon_url":"https:\/\/comcent.co.jp\/blog\/images\/authorKd-150x150.png","author_url":"https:\/\/comcent.co.jp\/blog\/archives\/author\/kimura\/"},"tag_names":["CodeIgniter4","EXIF","php","\u30d0\u30c3\u30af\u30a8\u30f3\u30c9","\u753b\u50cf\u64cd\u4f5c"],"thumbnail_url":"https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/07\/comcent_exif-300x200.jpg","_links":{"self":[{"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/posts\/2944","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=2944"}],"version-history":[{"count":23,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/posts\/2944\/revisions"}],"predecessor-version":[{"id":3099,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/posts\/2944\/revisions\/3099"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/media\/2954"}],"wp:attachment":[{"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=2944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=2944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=2944"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/coauthors?post=2944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}