{
  "entries": [
    
    {
      "title": "a-blog cmsでPNGからJPGに変換する校正オプション",
      "body": [
        
        {

        

        

        
         "outerClass": "column-media-auto js_notStyle acms-col-sm-12",
        "type": "image", "href": "", "src": "https://gradation.me/media/001/201906/mode3_w700-9e853d01d87d6f87ca59939e121539c8.jpg", "caption": ""
        
        

        },
        
        {

        
        
        
        
        
        
        
        
        
        
        
        
        
         "type": "text", "tag": "", "class": "", "text": "<p>a-blog cms\u3067\u69cb\u7bc9\u3057\u3066\u304a\u5ba2\u69d8\u306b\u7d0d\u5165\u3057\u305f\u30b5\u30a4\u30c8\u3067\u3059\u304c\u3001\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306e\u30e1\u30a4\u30f3\u30d3\u30b8\u30e5\u30a2\u30eb\u30a8\u30ea\u30a2\u3084\u8a18\u4e8b\u306e\u30b5\u30e0\u30cd\u30a4\u30eb\u306bPNG\u5f62\u5f0f\u3067\u5199\u771f\u306e\u3088\u3046\u306a\u753b\u50cf\u3092\u767b\u9332\u3057\u3066\u3044\u3066\u3001\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u304c\u5408\u8a0814,200KB\u307b\u3069\u306b\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n<p>\u6025\u304e\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u753b\u50cf\u3092PNG\u304b\u3089JPG\u306b\u5909\u63db\u3059\u308b\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a<a href=\"https:\/\/developer.a-blogcms.jp\/document\/reference\/proofreading.html\">\u6821\u6b63\u30aa\u30d7\u30b7\u30e7\u30f3<\/a>\u3092\u4f5c\u6210\u3057\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6539\u5584\u3092\u884c\u3063\u305f\u3068\u3053\u308d\u30013,700KB\u307b\u3069\u306b\u53ce\u307e\u308a\u307e\u3057\u305f\u3002<\/p>\n\n<h2>HTML\u30bd\u30fc\u30b9\u306b\u6821\u6b63\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0<\/h2>\n\n<pre><code>&amp;lt;img src=&amp;quot;%{ROOT_DIR}{path}[resizeImg(460,300)|png2jpg]&amp;quot; alt=&amp;quot;&amp;quot;&amp;gt;\n<\/code><\/pre>\n\n<h2>\/extension\/acms\/Corrector.php<\/h2>\n\n<pre><code>    \/**\n     * png2jpg\n     * JPG\u3092PNG\u3092\u7f6e\u63db\u3059\u308b\n     *\n     * @param  string $path  - PNG\u306e\u30d1\u30b9\uff08\/archives\/001\/201905\/9c2c7c442a531f334c0ee6debd5b82ab.png\uff09\n     * @return string       - JPG\u306e\u30d1\u30b9\uff08\/archives\/001\/201905\/9c2c7c442a531f334c0ee6debd5b82ab.png.jpg\uff09\n     *\/\n    function png2jpg($path)\n    {\n        \/\/ PNG\u306e\u7d76\u5bfe\u30d1\u30b9\u3092\u53d6\u5f97\n        $real_path = __DIR__ . &amp;#039;\/..\/..\/archives\/&amp;#039; . $path;\n        \/\/ PNG\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308c\u3070\u5b9f\u884c\n        if( strpos($real_path, &amp;#039;.png&amp;#039;) )\n        {\n            \/\/ JPG\u30d5\u30a1\u30a4\u30eb\u304c\u751f\u6210\u6e08\u307f\u3067\u306a\u3051\u308c\u3070\u5b9f\u884c\n            if( ! file_exists($real_path . &amp;#039;.jpg&amp;#039; ) )\n            {\n                \/\/ PNG\u306b\u5909\u63db\n                $image = imagecreatefrompng($real_path);\n                $bg = imagecreatetruecolor(imagesx($image), imagesy($image));\n                imagefill($bg, 0, 0, imagecolorallocate($bg, 255, 255, 255));\n                imagealphablending($bg, TRUE);\n                imagecopy($bg, $image, 0, 0, 0, 0, imagesx($image), imagesy($image));\n                imagedestroy($image);\n                $quality = 90; \/\/ 0 = worst \/ smaller file, 100 = better \/ bigger file \n                imagejpeg($bg, $real_path . &amp;quot;.jpg&amp;quot;, $quality);\n                imagedestroy($bg);\n            }\n            \/\/ JPG\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u8fd4\u3059\n            return $path . &amp;quot;.jpg&amp;quot;;\n        }\n        else\n        {\n            \/\/ \u305d\u306e\u307e\u307e\u306e\u30d1\u30b9\u3092\u8fd4\u3059\n            return $path;\n        }\n    }\n<\/code><\/pre>\n\n<p>\u203b\u3053\u306e\u6a5f\u80fd\u3092\u4f7f\u3046\u5834\u5408\u306f\u3001a-blog cms\u306e\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\uff08index.php\uff09\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u30b0\u30eb\u30fc\u30d7\u3082\u8aad\u307f\u8fbc\u307f\u53ef\uff08644\u306a\u3069\uff09\u3068\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n"
        
        

        

        

        },
        
        {}
      ]
    },
    
    {}
  ]
}

