2013年12月24日火曜日

FCKeditor 久々にいじってみた

何度も利用したことがあるのですが、久々に組み込んでみた。

本家の方はどんどんバージョンアップしていくが、ファイルマネージャが有料なので、フォークした日本版を使う。 メンテナーのかたはおひとりで奮闘されています。感謝です。

http://sourceforge.jp/projects/fckeditor/

エディタの高さがうまく調節できなかったのでですが、結局全画面で編集すれば済みます。

ツールバーもたくさんありすぎるので、カスタマイズします。


2013年12月19日木曜日

2013年12月13日金曜日

GD で png 画像を透過、リサイズ

http://yoo-s.com/topic/detail/388

function resize_image($org_path, $new_path, $to_width, $to_height) {
    list($org_width , $org_height) = getimagesize($org_image_path);
    $src_image = imagecreatefrompng($org_path);
 
    $rate = 1;
    if ($org_width > $org_height) {
        $rate = $to_width / $org_width;
    } elseif ($org_width < $org_height) {
        $rate = $to_height / $org_height;
    } else {
        if ($to_width > $to_height) {
            $rate = $to_height / $org_height;
        } else {
            $rate = $to_width / $org_width;
        }
    }
    $to_width = $rate * $org_width;
    $to_height = $rate * $org_height;
 
    // 再サンプル
    $new_image = imagecreatetruecolor($to_width, $to_height);
    imagealphablending($new_image, false);
    imagesavealpha($new_image, true);
 
    imagecopyresampled($new_image, $src_image, 0, 0, 0, 0, $to_width, $to_height, $org_width, $org_height);
 
    imagepng($new_image, $new_image_path);
 
    imagedestroy($src_image);
    imagedestroy($new_image);
}
 
 
png 透過の手順は、
(1) imagecreatetruecolor() で画像作成
(2) imagealphablending(), imagesavealpha() でアルファチャンネルの作成
(3) imagepng() で画像の書き出し

リサイズの手順は
(1) getimagesize() で取得したサイズ配列から
(2) 比率を計算(サンプルの計算はちょっとあやしいかも)
(3) imagecopyresampled() でリサンプリング

2013年2月20日水曜日

COLOR

CMSV5 Color scheme Combination:TRIAL 02

No color Code Dark Bright Code
001 xxx A60000 DB853B
101 xxx A64A00 DB853B
201 xxx A66F00 DBA53B
301 xxx A68A00 DBC03B
401 xxx A6A600 DBDA3B
501 xxx 679B00 98CB37
601 xxx 008500 2FAF2F
701 xxx 006064 248581
801 xxx 06276F 325192
901 xxx 1F0772 3714B0
A01 xxx 48036F 6E2D92
B01 xxx 85004B AF2F78