列印

附件數位圖片加上 exif 資訊 for 6.0

附件數位圖片加上 exif 資訊 for 6.0

from: http://www.alan888.com/Discuz/viewthread.php?tid=127297

作  者: alan888
適用版本: Discuz 6.0
演  示: http://www.alan888.com/Discuz/
說  明: 此插件能在開啟浮水印功能可以自動識別不加浮水印避免引至數位資訊遺失, 並適用於開啟防盜狀態下使用
備  注: php 必須打開 php 的 exif extension 功能才能實現



修改文件
1. include/image.class.php
複製內容到剪貼簿
代碼:
var $animatedgif = 0;
在下面加上
複製內容到剪貼簿
代碼:
        var $photoexif = 0;
複製內容到剪貼簿
代碼:
$this->animatedgif = strpos($targetfilecontent, 'NETSCAPE2.0') === FALSE ? 0 : 1;
                }
在下面加上
複製內容到剪貼簿
代碼:
                if($this->attachinfo['mime'] == 'image/pjpeg' || $this->attachinfo['mime'] == 'image/jpeg') {
                        if(function_exists("read_exif_data")){
                                $photodata = @read_exif_data ($targetfile,0,true);
                                $this->photoexif = $photodata[IFD0][Make] ? 1 : 0;
                        }
                }
複製內容到剪貼簿
代碼:
if($watermarkstatus && function_exists('imagecopy') && function_exists('imagealphablending') && function_exists('imagecopymerge')
在後面插入
複製內容到剪貼簿
代碼:
&& !$this->photoexif
2. 修改 include/attachment.func.php
複製內容到剪貼簿
代碼:
$attach['payed'] = $attach['payed'] || $forum['ismoderator'] || $attach['uid'] == $discuz_uid ? 1 : 0;
在上面加上
複製內容到剪貼簿
代碼:
                        if((function_exists("read_exif_data")) && $attach['attachimg']){
                                $attach['photourl']= "$attachurl/$attach[attachment]";
                                $attach['exif'] = @read_exif_data ($attach[photourl],0,true);
                                if ($attach[exif][IFD0][Make]){
                                $attach['ISORec'] = $attach['exif']['EXIF']['ISOSpeedRatings'] ? $attach['exif']['EXIF']['ISOSpeedRatings'] : '沒有記錄';
                                $attach['dateshot'] = substr($attach['exif']['EXIF']['DateTimeOriginal'], 0,16);
                        $attach['postexif']= "<p>相機:".$attach[exif][IFD0][Make]."    型號: ".$attach[exif][IFD0][Model]."    光圈:".$attach[exif][COMPUTED][ApertureFNumber]." </p><p> 快門:".$attach[exif][EXIF][ExposureTime]."    ISO:$attach[ISORec] \n    拍攝日期:$attach[dateshot]</p>";
                }
        }
3. discuzcode 模板
複製內容到剪貼簿
代碼:
<!--{if $attach[description]}-->$attach[description]
<!--{/if}-->
在下面加上
複製內容到剪貼簿
代碼:
                        <!--{if $attach['postexif']}-->$attach['postexif']<!--{/if}-->
複製內容到剪貼簿
代碼:
<!--{if !$attach['price'] || $attach['payed']}-->
在上面加上
複製內容到剪貼簿
代碼:
                        <!--{if $attach['postexif']}-->數位 Exif 資訊: $attach['postexif']<!--{/if}-->
演示: http://www.alan888.com/D6/thread-136-1-1.html

~完成~
附件: 您所在的用戶組無法下載或查看附件
Hack 安裝錯誤, 80% 來自粗心, 請專心安裝
Linux0911 打造您的個性論壇

本人現在忙於研究所, 沒多的時間管論壇, 有問題別發 pm 給我, 謝謝~
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

備  注: php 必須打開 php 的 exif extension 功能才能實現

可否詳細說明
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

引用:
原帖由 藍雨 於 2007-10-24 11:13 PM 發表
備  注: php 必須打開 php 的 exif extension 功能才能實現

可否詳細說明
複製內容到剪貼簿
代碼:
<?php

phpinfo();

?>
另存為 XXX.php 上傳到根目錄

看看是否有 EXIF 模組
附件: 您所在的用戶組無法下載或查看附件
Hack 安裝錯誤, 80% 來自粗心, 請專心安裝
Linux0911 打造您的個性論壇

本人現在忙於研究所, 沒多的時間管論壇, 有問題別發 pm 給我, 謝謝~
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

沒有
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

引用:
原帖由 藍雨 於 2007-10-30 11:24 PM 發表
沒有
沒有沒辦法使用此插件

叫廠商加裝或是你是獨立主機, 參閱:
http://linux0911.no-ip.info/my_style/doc/fixed/apache_4.php
Hack 安裝錯誤, 80% 來自粗心, 請專心安裝
Linux0911 打造您的個性論壇

本人現在忙於研究所, 沒多的時間管論壇, 有問題別發 pm 給我, 謝謝~
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP



論壇聲明
  • 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
    如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
    請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!
最佳瀏覽解析度:不低於 1024 (最佳 1280 以上).(支援 IE 7, Mozilla Firefox, Safari, Chrome)
The Best Surfing Resolution: No Lower than 1024 (Best: above 1280).(IE 7, Mozilla Firefox, Safari, Chrome Supported)