鐵之狂傲

 取回密碼
 註冊
搜尋

切換到指定樓層
1#
<?php
        $dir = ".";

        $dh = opendir($dir);

        while(false !== ($fileName = readdir($dh)))
        {
                if(!is_dir($fileName))
                {
                        if(strcasecmp(substr($fileName, -4), ".jpg") == 0 or strcasecmp(substr($fileName, -4), ".png") == 0)
                        {
                                $fileList[] = $fileName;
                        }
                }
        }

        $im = $fileList[array_rand($fileList)];

        switch(substr($im, -3))
        {
                case "jpg":
                {
                        Header('Content-type: image/JPEG');
                        $img_src = imagecreatefromjpeg($im);

                        $width = imagesx($img_src);
                        $height = imagesy($img_src);

                        //$img_dst = imagecreatetruecolor($width,$height);
                        //imagecopyresampled($img_dst, $img_src, 0, 0, 0, 0, $width, $height, $width, $height);

                        imageJPEG($img_src, '', 100);
                }
                case "png":
                {
                        Header('Content-type: image/PNG');
                        $img_src = imagecreatefrompng($im);

                        $width = imagesx($img_src);
                        $height = imagesy($img_src);

                        //$img_dst = imagecreatetruecolor($width,$height);
                        //imagecopyresampled($img_dst, $img_src, 0, 0, 0, 0, $width, $height, $width, $height);

                        imagePNG($img_src);
                }
        }

        imageDestroy($im2);
        imagedestroy($img_dst);
?>
 
[img]http://www.joshchen.net/pictures/yumisignature500.jpg[/img]
轉播0 分享0 收藏0

回覆 使用道具 檢舉

感謝...不過電腦怪怪的(不是我的)
等回自己的窩在弄吧...
 

回覆 使用道具 檢舉

做法:
1. 請打開notepad然侯把上面的code複製到notepad裡面。
2. 存檔 xxxx.php *請注意用php的檔尾*
3. 上傳到你的伺服器 *伺服器要能支援php語法*
4. 放在跟你想要所有的圖檔的獨立檔案夾裡 *這個code是找出檔案夾內任何的 jpg gif png檔案*
5. 去改你的簽名檔圖檔的URL吧
 

回覆 使用道具 檢舉

[QUOTE=柏拉圖水晶]做法:
1. 請打開notepad然侯把上面的code複製到notepad裡面
2. 存檔 xxxx.php *請注意用php的檔尾*
3. 上傳到你的伺服器 *伺服器要能支援php語法*
4. 放在獨立的檔案夾裡 *這個code是找出任何的 jpg gif png檔案*
5. 去改你的簽名檔圖檔的URL吧[/QUOTE]
不知啥...懇請解惑
 

回覆 使用道具 檢舉

notepad就是windows中最基本的文書處理程式。
不好意思來美國十年從來沒用中文windows
說不定有大大會來解釋~
 

回覆 使用道具 檢舉

該不好意思的是我..XD
 

回覆 使用道具 檢舉

謝謝呢...

你們兩個有點好笑說...

不好意思來.不好意思去...
 

回覆 使用道具 檢舉

推薦一個支援Php空間的比較重要吧= =....
 
我是個獸控,今夜如此,夜夜皆然。

回覆 使用道具 檢舉

名望的英雄

LIVE FIGHTER

自家伺服器XD

我用公司的XD
 
尋衣
2003 NBA All-Star Game WEST 21 Kevin Garnett
0405 River Plate Home & 3rd Jersey 胸前須有贊助商Budweiser(燙Higuain可)
0506、0607、0708 Panathinaikos Home 任一年皆可
有意出售者請務必聯絡我,感謝 m(_ _)m

回覆 使用道具 檢舉

[QUOTE=芳野 雪彥]自家伺服器XD

我用公司的XD[/QUOTE]
很貴的阿....

一個20Mb的租一年也要3000多阿.......

好貴的簽名檔...
 

回覆 使用道具 檢舉

你需要登入後才可以回覆 登入 | 註冊

存檔|手機版|聯絡我們|新聞提供|鐵之狂傲

GMT+8, 25-3-5 12:12 , Processed in 0.021949 second(s), 16 queries , Gzip On.

回頂部