{"id":6439,"date":"2024-08-31T11:47:58","date_gmt":"2024-08-31T02:47:58","guid":{"rendered":"https:\/\/taitan916.info\/blog\/?p=6439"},"modified":"2024-05-31T14:05:23","modified_gmt":"2024-05-31T05:05:23","slug":"post-6439","status":"publish","type":"post","link":"https:\/\/taitan916.info\/blog\/archives\/6439","title":{"rendered":"PHP\u3067\u30c0\u30df\u30fc\u753b\u50cf(\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u753b\u50cf)\u3092\u8868\u793a\u3059\u308b\u300cPHP-Dummy-Image-Generator\u300d\u306e\u5229\u7528\u65b9\u6cd5"},"content":{"rendered":"<p>\u5148\u65e5<a href=\"https:\/\/taitan916.info\/blog\/archives\/6237\" target=\"_blank\" rel=\"noopener\">JavaScript\u3067\u30c0\u30df\u30fc\u753b\u50cf(\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u753b\u50cf)\u3092\u8868\u793a\u3059\u308b\u300cHolder.js\u300d\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u5229\u7528\u65b9\u6cd5<\/a>\u3092\u30e1\u30e2\u3057\u305f\u304c\u3001PHP\u3067\u3082\u540c\u3058\u3088\u3046\u306a\u3053\u3068\u3092\u3057\u305f\u3044\u3002\u8abf\u3079\u305f\u3068\u3053\u308d\u300cPHP-Dummy-Image-Generator\u300d\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u30d5\u30a1\u30a4\u30eb1\u679a\u3067\u5c0e\u5165\u53ef\u80fd\u3067\u4f7f\u3044\u65b9\u3082\u7c21\u5358\u3060\u3063\u305f\u3002\u4ee5\u4e0b\u306b\u5229\u7528\u65b9\u6cd5\u3092\u30e1\u30e2\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>PHP-Dummy-Image-Generator<\/h2>\n<h3>GitHub<\/h3>\n<p><a href=\"https:\/\/github.com\/FabianBeiner\/PHP-Dummy-Image-Generator\/\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/FabianBeiner\/PHP-Dummy-Image-Generator\/<\/a><\/p>\n<h3>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p><a href=\"https:\/\/github.com\/FabianBeiner\/PHP-Dummy-Image-Generator\/blob\/master\/image.php\" target=\"_blank\" rel=\"noopener\">image.php<\/a>\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001\u30b5\u30fc\u30d0\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30d5\u30a9\u30f3\u30c8\u306b\u3064\u3044\u3066<\/h2>\n<h3>\u30d5\u30a9\u30f3\u30c8\u306e\u7528\u610f<\/h3>\n<p>GitHub\u4e0a\u3067\u306f<a href=\"https:\/\/github.com\/FabianBeiner\/PHP-Dummy-Image-Generator\/\" target=\"_blank\" rel=\"noopener\">RobotoMono-Regular.ttf<\/a>\u3068\u3044\u3046\u30d5\u30a9\u30f3\u30c8\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u304c\u3001\u3053\u308c\u3092\u4f7f\u3046\u3068\u65e5\u672c\u8a9e\u304c\u8868\u793a\u3067\u304d\u306a\u304b\u3063\u305f\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081<a href=\"https:\/\/fontfree.me\/\" target=\"_blank\" rel=\"noopener\">\u9069\u5f53\u306a\u30d5\u30ea\u30fc\u30d5\u30a9\u30f3\u30c8\u306e\u30b5\u30a4\u30c8<\/a>\u304b\u3089\u30d5\u30a9\u30f3\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001image.php\u3068\u540c\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u3066\u304a\u304f\u3002<\/p>\n<h3>\u30d5\u30a9\u30f3\u30c8\u306e\u9069\u7528<\/h3>\n<p>image.php\u306e104\u884c\u76ee\u4ed8\u8fd1\u3092\u4ee5\u4e0b\u306e\u901a\u308a\u66f8\u304d\u63db\u3048\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#\u5909\u66f4\u524d\r\n$fontFile = realpath(__DIR__) . DIRECTORY_SEPARATOR . 'RobotoMono-Regular.ttf';\r\n\r\n#\u5909\u66f4\u5f8c\r\n$fontFile = realpath(__DIR__) . DIRECTORY_SEPARATOR . '\u3010\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a9\u30f3\u30c8\u30d5\u30a1\u30a4\u30eb\u540d\u3011';<\/pre>\n<p>&nbsp;<\/p>\n<h2>\u5229\u7528\u65b9\u6cd5<\/h2>\n<h3>\u753b\u50cf\u306e\u8868\u793a<\/h3>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5f62\u3067\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u958b\u304f\u3068\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u308b\u7b48\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">https:\/\/test.com\/image.php?size=\u3010width\u306epx\u6570\u3011x\u3010height\u306epx\u6570\u3011&amp;type=\u3010jpg \/ png \/ gif\u3011&amp;bg=\u3010\u80cc\u666f\u8272\u306e\u30ab\u30e9\u30fc\u30b3\u30fc\u30c9\u3092\u30b7\u30e3\u30fc\u30d7\u629c\u304d\u3067\u8a18\u8ff0\u3011&amp;color=\u3010\u6587\u5b57\u306e\u30ab\u30e9\u30fc\u30b3\u30fc\u30c9\u3092\u30b7\u30e3\u30fc\u30d7\u629c\u304d\u3067\u8a18\u8ff0\u3011&amp;text=\u3010\u8868\u793a\u3057\u305f\u3044\u30c6\u30ad\u30b9\u30c8\u3011<\/pre>\n<p>img\u30bf\u30b0\u3067\u8868\u793a\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;img src=\"https:\/\/test.com\/image.php?size=\u3010width\u306epx\u6570\u3011x\u3010height\u306epx\u6570\u3011&amp;type=\u3010jpg \/ png \/ gif\u3011&amp;bg=\u3010\u80cc\u666f\u8272\u306e\u30ab\u30e9\u30fc\u30b3\u30fc\u30c9\u3092\u30b7\u30e3\u30fc\u30d7\u629c\u304d\u3067\u8a18\u8ff0\u3011&amp;color=\u3010\u6587\u5b57\u306e\u30ab\u30e9\u30fc\u30b3\u30fc\u30c9\u3092\u30b7\u30e3\u30fc\u30d7\u629c\u304d\u3067\u8a18\u8ff0\u3011&amp;text=\u3010\u8868\u793a\u3057\u305f\u3044\u30c6\u30ad\u30b9\u30c8\u3011\"&gt;<\/pre>\n<h3>\u753b\u50cf\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u6642\u306e\u30d5\u30a1\u30a4\u30eb\u540d<\/h3>\n<p>img\u30bf\u30b0\u7b49\u3067\u8868\u793a\u3057\u3001\u5f53\u8a72\u753b\u50cf\u3092\u4fdd\u5b58\u3059\u308b\u3068image.jpg\u3068\u3044\u3046\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u540d\u306b\u306a\u308b\u3068\u601d\u3046\u304c\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u5909\u66f4\u3057\u305f\u3044\u5834\u5408\u306fimage.php\u306e\u6700\u4e0b\u90e8\u4ed8\u8fd1\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8ffd\u8a18\u3059\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">switch ($type) {\r\n    case 'png':\r\n        header('Content-Type: image\/png');\r\n        header('Content-disposition: filename=\"\u30d5\u30a1\u30a4\u30eb\u540d.png\"');\r\n        imagepng($image);\r\n        break;\r\n    case 'gif':\r\n        header('Content-Type: image\/gif');\r\n        header('Content-disposition: filename=\"\u30d5\u30a1\u30a4\u30eb\u540d.gif\"');\r\n        imagegif($image);\r\n        break;\r\n    case 'jpg':\r\n    case 'jpeg':\r\n        header('Content-Type: image\/jpeg');\r\n        header('Content-disposition: filename=\"\u30d5\u30a1\u30a4\u30eb\u540d.jpg\"');\r\n        imagejpeg($image);\r\n        break;\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5148\u65e5JavaScript\u3067\u30c0\u30df\u30fc\u753b\u50cf(\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u753b\u50cf)\u3092\u8868\u793a\u3059\u308b\u300cHold ... <\/p>\n","protected":false},"author":1,"featured_media":1085,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[91,100],"class_list":["post-6439","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-image","tag-library"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/6439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/comments?post=6439"}],"version-history":[{"count":4,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/6439\/revisions"}],"predecessor-version":[{"id":6443,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/6439\/revisions\/6443"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media\/1085"}],"wp:attachment":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media?parent=6439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/categories?post=6439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/tags?post=6439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}