x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
iptc.pl - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\LITTLELEV\ImageFolioLite\if_lib\iptc.pl
旋转
特效
属性
历史版本
############################################################################### # BizDesign ImageFolio Lite Edition 4.2 (Four-dot-Two) ############################################################################### # # ## ### VERSION : 4.2 # #### ## ## RELEASED ON : 02/15/2007 # ## ## ## LAST MODIFIED : 02/15/2007 # ########## ## # ## ### ## # ## ### ######## # ############################################################################### # Released by BizDesign, Inc. # written by Dirk Koppers and Greg Raaum of BizDesign # # Purchasing : http://imagefolio.com/purchase/ # Support : http://imagefolio.com/support/ # Phone : (214) 642-9787 # Email : sales@bizdesign.com ############################################################################### # COPYRIGHT AND LICENSE INFORMATION : # # Copyright (c) 1999-2007 BizDesign, Inc. All rights reserved. # # Selling or distributing the code for this program without prior written # consent is expressly forbidden. # # One licensed copy of the program may reside on a single server, in use by a # single domain. For each installed instance of the program, a separate # license is required. # # Licensed users may alter or modify this software, at their own risk, of # course. They may also hire others to modify their own copy of the code, as # long as the code is not transferred to or retained by the individual who is # hired (unless he/she is also a license holder). Although license-holders # may modify the code for their use, modified code may NOT be resold or # distributed. # # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BIZDESIGN, # INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # BizDesign, Inc. is not liable for any conduct associated with image gallery # activity, nor for any binary media posted using this program, including but # not imited to images, photographs, movies, and clipart. # # The user must assume the entire risk of using the program. Although this # program has been thoroughly tested on BizDesign's servers, BizDesign does not # warrant that it works on all servers and will not be held liable for anything, # including but not limited to, misusage, error, or loss of data. ANY # LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT # OR REFUND OF PURCHASE PRICE. Use at your own risk! ############################################################################### # Do not modify below this line unless you know what you are doing. ############################################################################### ############################################################################################## ######### NO EDITTING NEEDED BELOW THIS LINE ######### ############################################################################################## use Image::IPTCInfo; use Image::Info qw(image_info); use Image::Size; #eval "use Encode;1;" or $no_decode_encode = 1; # uncomment this if you want to use the decode_encode routine #$decode_charset = "MacRoman"; # uncomment this if you want to use the decode_encode routine $encode_charset = "ISO-8859-1"; # "UTF-8" or "ISO-8859-1" &Error('You will need to download and install the Perl Module
Encode.pm
on your server. Ask your host for help if needed.') if $decode_charset && $no_decode_encode; $if_javascript .= qq|
| if $decode_charset; sub decode_encode { my $input = shift; #$input =~ s/\015\012?/\n/g; # (CRLF to LF) and (CR to LF) #$input =~ s/\\usepackage\[applemac\]\{inputenc\}/\\usepackage\[latin1\]\{inputenc\}/g; return encode($encode_charset,decode($decode_charset,$input)); } ############################################################################################## ######### CREATE THE TABLE ######### ############################################################################################## sub iptc_create_table{ my ($base) = $iptc_image =~ m,^(.*)\.\w+$,; my ($ext) = ($iptc_image =~ /\.([^.]+)$/); if ($ext =~ /jpg/i) { $iptc_image_path = qq|$image_directory/$iptc_category/$iptc_image|; $iptc_image_found = 1; } elsif (-e "$image_directory/$iptc_category/$mypattern$base.jpg") { $iptc_image_path = qq|$image_directory/$iptc_category/$mypattern$base.jpg|; $iptc_image_found = 1; } elsif (-e "$image_directory/$iptc_category/$mypattern$base.JPG") { $iptc_image_path = qq|$image_directory/$iptc_category/$mypattern$base.JPG|; $iptc_image_found = 1; } if ($iptc_image_found) { if (!$wrap) { $nowrap = "nowrap"; } my $iptc_info = new Image::IPTCInfo("$iptc_image_path"); if (defined($iptc_info)){ foreach (@ignore_keywords) { $ignore_keyword{lc($_)} = 1; } $tablestart = qq|
$iptc_table_header
|; foreach $key (sort keys %IPTCfields) { $iptcbytes = $IPTCfields{$key}[0]; $iptcattr = $IPTCfields{$key}[1]; $iptcfield = $IPTCfields{$key}[2]; $iptcrule = $IPTCfields{$key}[3]; if ($iptcrule==1 or $iptcrule==2) { if (!$clickable_search_words) { $iptcrule = 1; } if ($iptcattr eq 'keywords') { my $keywordsRef = $iptc_info->Keywords(); if (defined($keywordsRef)) { if (!$iptcdata){ $iptc_table = $tablestart; $iptcdata = 1; } $iptc_table .= qq|
<$iptc_field_font>$iptcfield
<$iptc_value_font>|; if ($iptcrule==1) { foreach $iptc_keyword (@$keywordsRef) { $iptc_keyword = &decode_encode($iptc_keyword) if $decode_charset; $iptc_keyword =~ s/(<|\%\W*3\W*c|\<)\/?[^>]*(>|\%\W*3\W*e|\>)//mig; next if $ignore_keyword{lc($iptc_keyword)}; $show_similar .= qq|$iptc_keyword+|; $iptc_keyword =~ s/\+/ /g; $iptc_table .= qq|$iptc_keyword |; $IPTCtag{$iptcattr} .= qq|$iptc_keyword |; } } else { foreach $iptc_keyword (@$keywordsRef) { $iptc_keyword = &decode_encode($iptc_keyword) if $decode_charset; $iptc_keyword =~ s/(<|\%\W*3\W*c|\<)\/?[^>]*(>|\%\W*3\W*e|\>)//mig; $iptc_keyword_blanked = $iptc_keyword; $iptc_keyword_blanked =~ s/\+/ /g; next if $ignore_keyword{lc($iptc_keyword_blanked)}; $iptc_table .= qq|
$iptc_keyword_blanked
|; $IPTCtag{$iptcattr} .= qq|
$iptc_keyword_blanked
|; $show_similar .= qq|$iptc_keyword+|; } } $iptc_table .= qq|
|; } } else { $iptcvalue = $iptc_info->Attribute("$iptcattr"); $iptcvalue = &decode_encode($iptcvalue) if $decode_charset; if ($iptcvalue =~ /\S+/) { $iptcvalue =~ s/(<|\%\W*3\W*c|\<)\/?[^>]*(>|\%\W*3\W*e|\>)//mig; if (!$iptcdata){ $iptc_table = $tablestart; $iptcdata = 1; } else { $second_value = 1; } my $start_iptc_row = qq|
<$iptc_field_font>$iptcfield
<$iptc_value_font>|; $iptc_table .= $start_iptc_row; if ($iptcattr eq 'custom18') { $found_custom18 = 1; ($custom18_date, $custom18_user, $custom18_email, $custom18_approval, $custom18_file_type) = $iptcvalue =~ /\[(.*?)\]/g; if ($custom18_user) { if ($iptcrule==1) { $iptc_table .= $custom18_user; $IPTCtag{$iptcattr} = qq|$custom18_user|; } else { $iptc_table .= qq|
$custom18_user
|; $IPTCtag{$iptcattr} = qq|
$custom18_user
|; } } else { $iptc_table =~ s/$start_iptc_row//ig; if (!$second_value) { $iptc_table = (); $iptcdata = (); } next; } } elsif ($iptcattr eq 'custom19') { $iptc_table .= qq|
$iptcvalue
|; $IPTCtag{$iptcattr} = qq|
$iptcvalue
|; } elsif ($iptcattr eq 'custom20') { if ($iptcvalue !~ /http:\/\//i) { $pre = "http://"; } $iptc_table .= qq|
$iptcvalue
|; $IPTCtag{$iptcattr} = qq|
$iptcvalue
|; } elsif ($iptcrule==1) { if ($iptcattr =~ /date/i) { @character = split(//, $iptcvalue); if ($eu_date_format) { $iptcvalue = qq|@character[6]@character[7]/@character[4]@character[5]/@character[0]@character[1]@character[2]@character[3]|; } else { $iptcvalue = qq|@character[4]@character[5]/@character[6]@character[7]/@character[0]@character[1]@character[2]@character[3]|; } } $iptcvalue =~ s/\+/ /g; $iptc_table .= $iptcvalue; $IPTCtag{$iptcattr} = qq|$iptcvalue|; } elsif ($iptcbytes >= "128") { @splitwords = split(/\s+/, $iptcvalue); foreach my $splitword (@splitwords) { my $showword = $splitword; $showword =~ s/\+/ /g; $iptc_table .= qq|
$showword
|; $IPTCtag{$iptcattr} .= qq|
$showword
|; } } else { $phrasewords = $iptcvalue; $phrasewords =~ s/\s/\+/g; if ($iptcattr =~ /date/i) { @character = split(//, $iptcvalue); if ($eu_date_format) { $iptcvalue = qq|@character[6]@character[7]/@character[4]@character[5]/@character[0]@character[1]@character[2]@character[3]|; } else { $iptcvalue = qq|@character[4]@character[5]/@character[6]@character[7]/@character[0]@character[1]@character[2]@character[3]|; } } $iptcvalue =~ s/\+/ /g; $iptc_table .= qq|
$iptcvalue
|; $IPTCtag{$iptcattr} = qq|
$iptcvalue
|; } $iptc_table .= qq|
|; } } } elsif ($parse_single_iptc_fields) { $iptcvalue = $iptc_info->Attribute("$iptcattr"); $iptcvalue = &decode_encode($iptcvalue) if $decode_charset; if ($iptcvalue =~ /\S+/) { if (!$clickable_search_words) { $iptcrule = 4; } $iptcvalue =~ s/(<|\%\W*3\W*c|\<)\/?[^>]*(>|\%\W*3\W*e|\>)//mig; if ($iptcrule == 4) { $iptcvalue =~ s/\+/ /g; $IPTCtag{$iptcattr} = qq|$iptcvalue|; } elsif ($iptcbytes >= "128") { @splitwords = split(/\s+/, $iptcvalue); foreach $splitword (@splitwords) { my $showword = $splitword; $showword =~ s/\+/ /g; $IPTCtag{$iptcattr} .= qq|
$showword
|; } } else { $phrasewords = $iptcvalue; $phrasewords=~s/\s/+/g; if ($iptcattr =~ /date/i) { @character = split(//, $iptcvalue); if ($eu_date_format) { $iptcvalue = qq|@character[6]@character[7]/@character[4]@character[5]/@character[0]@character[1]@character[2]@character[3]|; } else { $iptcvalue = qq|@character[4]@character[5]/@character[6]@character[7]/@character[0]@character[1]@character[2]@character[3]|; } } $iptcvalue =~ s/\+/ /g; $IPTCtag{$iptcattr} = qq|
$iptcvalue
|; } } } } if ($iptcdata){ $iptc_table .= qq|
|; } if (!$found_custom18) { $iptcvalue = $iptc_info->Attribute('custom18'); ($custom18_date, $custom18_user, $custom18_email, $custom18_approval, $custom18_file_type) = $iptcvalue =~ /\[(.*?)\]/g; } # if ($custom18_user) { # foreach my $row (@USERCHECK) { # my ($this_row_username,$ifuserpass,$ifuserid,$ifemail,$iffirstname,$iflastname,$this_row_group,$ifusername_display) = split(/\|/,$row); # if ($custom18_user eq $this_row_username && $this_row_group eq $ifgroup) { # $custom18_user = $ifusername; # last; # } # } # } ## else { if ($group_media_mod_per==1) { if ($CPA{"All"}) { $custom18_user = $ifusername; } else { my (@iptc_cats) = split(/\//,$iptc_category); foreach my $iptc_cat (@iptc_cats) { $check_iptc_cat .= $iptc_cat; if ($CPA{$check_iptc_cat}) { $custom18_user = $ifusername; last; } $check_iptc_cat .= "/"; } } } # $custom18_user = $ifusername if ($group_media_mod_per==1 && $CPA{$iptc_category}); ## } } } } sub iptc_thumbnail{ $iptc_list = (); $iptc_list2 = (); $custom18_user = (); $custom18_approval = (); $custom18_file_type = (); my $iptc_info = new Image::IPTCInfo("$iptc_thumnail_path"); if (defined($iptc_info)){ # $captioniptcvalue = $iptc_info->Attribute("caption/abstract"); # if ($captioniptcvalue) { # $alt_text=$captioniptcvalue; # #use "title=" instead of "alt="! # } foreach $iptc_thumbnails_field (@iptc_thumbnails_fields) { if ($iptc_thumbnails_field eq 'keywords') { my $keywordsRef = $iptc_info->Keywords(); if (defined($keywordsRef)) { my $iptc_add_list = (); foreach $iptc_keyword (@$keywordsRef) { $iptc_keyword =~ s/\+/ /g; $iptc_keyword = &decode_encode($iptc_keyword) if $decode_charset; $iptc_keyword =~ s/(<|\%\W*3\W*c|\<)\/?[^>]*(>|\%\W*3\W*e|\>)//mig; $iptc_add_list .= qq|$iptc_keyword |; } $iptc_list .= "$iptc_add_list
" if $IPTC_THUMB_INFO{$iptc_thumbnails_field}; $iptc_list2 .= "$iptc_add_list
" if $IPTC_THUMB_POPUP{$iptc_thumbnails_field}; } } else { $iptcvalue = $iptc_info->Attribute("$iptc_thumbnails_field"); $iptcvalue =~ s/\+/ /g; $iptcvalue = &decode_encode($iptcvalue) if $decode_charset; if ($iptcvalue) { $iptcvalue =~ s/(<|\%\W*3\W*c|\<)\/?[^>]*(>|\%\W*3\W*e|\>)//mig; if ($iptc_thumbnails_field eq 'custom18') { $found_custom18 = 1; ($custom18_date, $custom18_user, $custom18_email, $custom18_approval, $custom18_file_type) = $iptcvalue =~ /\[(.*?)\]/g; if ($custom18_user) { my $iptc_add_list = qq|By
$custom18_user
|; $iptc_list .= $iptc_add_list if $IPTC_THUMB_INFO{$iptc_thumbnails_field}; $iptc_list2 .= $iptc_add_list if $IPTC_THUMB_POPUP{$iptc_thumbnails_field}; } } elsif ($iptc_thumbnails_field eq 'custom19') { my $iptc_add_list = qq|
$iptcvalue
|; $iptc_list .= $iptc_add_list if $IPTC_THUMB_INFO{$iptc_thumbnails_field}; $iptc_list2 .= $iptc_add_list if $IPTC_THUMB_POPUP{$iptc_thumbnails_field}; } elsif ($iptc_thumbnails_field eq 'custom20') { $pre = (); if ($iptcvalue !~ /http:\/\//i) { $pre = "http://"; } my $iptc_add_list = qq|
$iptcvalue
|; $iptc_list .= $iptc_add_list if $IPTC_THUMB_INFO{$iptc_thumbnails_field}; $iptc_list2 .= $iptc_add_list if $IPTC_THUMB_POPUP{$iptc_thumbnails_field}; } else { my $iptc_add_list = $iptcvalue . "
"; $iptc_list .= $iptc_add_list if $IPTC_THUMB_INFO{$iptc_thumbnails_field}; $iptc_list2 .= $iptc_add_list if $IPTC_THUMB_POPUP{$iptc_thumbnails_field}; } } } } if (!$found_custom18) { $iptcvalue = $iptc_info->Attribute('custom18'); ($custom18_date, $custom18_user, $custom18_email, $custom18_approval, $custom18_file_type) = $iptcvalue =~ /\[(.*?)\]/g; } # if ($custom18_user) { # foreach my $row (@USERCHECK) { # my ($this_row_username,$ifuserpass,$ifuserid,$ifemail,$iffirstname,$iflastname,$this_row_group,$ifusername_display) = split(/\|/,$row); # if ($custom18_user eq $this_row_username && $this_row_group eq $ifgroup) { # $custom18_user = $ifusername; # last; # } # } # } ## else { if ($CPA{"All"}) { $custom18_user = $ifusername; } elsif ($CPA_OK{$path}) { $custom18_user = $ifusername; } elsif ($group_media_mod_per==1) { my (@iptc_cats) = split(/\//,$path); my $check_iptc_cat = (); foreach my $iptc_cat (@iptc_cats) { $check_iptc_cat .= $iptc_cat; if ($CPA{$check_iptc_cat}) { $CPA_OK{$path} = 1; $custom18_user = $ifusername; last; } $check_iptc_cat .= "/"; } } # $custom18_user = $ifusername if $group_media_mod_per==1; ## } } } 1;
iptc.pl
网页地址
文件地址
上一页
17/23
下一页
下载
( 21 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10