Version Description
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 6.8.00 |
Comparing to | |
See all releases |
Code changes from version 6.7.12 to 6.8.00
- js/wppa-admin-scripts.js +3 -2
- js/wppa-admin-scripts.min.js +1 -0
- js/wppa-tinymce-shortcodes.js +18 -11
- js/wppa-tinymce-shortcodes.min.js +1 -1
- readme.txt +28 -6
- theme/wppa-theme.php +55 -55
- wppa-admin-functions.php +3 -3
- wppa-admin.php +8 -3
- wppa-ajax.php +112 -12
- wppa-album-admin-autosave.php +4 -10
- wppa-boxes-html.php +77 -7
- wppa-breadcrumb.php +11 -3
- wppa-common-functions.php +1 -355
- wppa-cron.php +31 -2
- wppa-exif-iptc-common.php +3377 -336
- wppa-filter.php +35 -3
- wppa-functions.php +13 -6
- wppa-import.php +22 -7
- wppa-index.php +25 -22
- wppa-links.php +9 -4
- wppa-maintenance.php +12 -5
- wppa-photo-admin-autosave.php +148 -65
- wppa-qr-widget.php +6 -3
- wppa-session.php +5 -8
- wppa-settings-autosave.php +93 -14
- wppa-setup.php +21 -5
- wppa-tinymce-photo-front.php +7 -1
- wppa-tinymce-shortcodes.php +2 -2
- wppa-upload.php +33 -12
- wppa-users.php +3 -3
- wppa-utils.php +4 -0
- wppa-wpdb-insert.php +33 -29
- wppa.php +3 -3
js/wppa-admin-scripts.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
/* admin-scripts.js */
|
2 |
/* Package: wp-photo-album-plus
|
3 |
/*
|
4 |
-
/* Version 6.
|
5 |
/* Various js routines used in admin pages
|
6 |
*/
|
7 |
|
@@ -1894,7 +1894,8 @@ function wppaMaintenanceProc(slug, intern, asCronJob ) {
|
|
1894 |
if ( wppaAlwaysContinue == 0 ) {
|
1895 |
if ( slug == 'wppa_remake' ||
|
1896 |
slug == 'wppa_regen_thumbs' ||
|
1897 |
-
slug == 'wppa_create_o1_files'
|
|
|
1898 |
if ( confirm( 'Always continue after server error?' ) ) {
|
1899 |
wppaAlwaysContinue = 1;
|
1900 |
}
|
1 |
/* admin-scripts.js */
|
2 |
/* Package: wp-photo-album-plus
|
3 |
/*
|
4 |
+
/* Version 6.8.00
|
5 |
/* Various js routines used in admin pages
|
6 |
*/
|
7 |
|
1894 |
if ( wppaAlwaysContinue == 0 ) {
|
1895 |
if ( slug == 'wppa_remake' ||
|
1896 |
slug == 'wppa_regen_thumbs' ||
|
1897 |
+
slug == 'wppa_create_o1_files' ||
|
1898 |
+
slug == 'wppa_recup' ) {
|
1899 |
if ( confirm( 'Always continue after server error?' ) ) {
|
1900 |
wppaAlwaysContinue = 1;
|
1901 |
}
|
js/wppa-admin-scripts.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
function checkjQueryRev(e,t,p){var a=parseFloat(jQuery.fn.jquery);t.checked&&a<p&&(alert(e+"\nThe version of your jQuery library: "+a+" is too low for this feature. It requires version "+p),t.checked="")}function wppaReUpload(e,t,p){document.getElementById("wppa-re-up-form-"+t);var a=document.getElementById("wppa-re-up-file-"+t),o=document.getElementById("wppa-re-up-butn-"+t);e.preventDefault();var n=a.files[0];if(n.type.match("image.*")){if(0==p.length)alert("Filename will be set to "+n.name);else if(n.name!=p&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+t).css("display","none");o.value="Uploading...",o.style.color="black";var i=new FormData;i.append("photo",n,n.name);var s=new XMLHttpRequest,l="?action=wppa&wppa-action=update-photo&photo-id="+t+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;s.open("POST",wppaAjaxUrl+l,!0),s.onload=function(){if(200===s.status){var e=wppaTrim(s.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#photostatus-"+t).html(e[2]),o.value="Upload",jQuery("#re-up-"+t).css("display","none");break;case"99":document.getElementById("photoitem-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",o.value="Error occured",o.style.color="red"}}else alert("An error occurred!")},s.send(i)}else alert("File is not an image file!")}function wppaInitSettings(){wppaCheckBreadcrumb(),wppaCheckFullHalign(),wppaCheckUseThumbOpacity(),wppaCheckUseCoverOpacity(),wppaCheckThumbType(),wppaCheckThumbLink(),wppaCheckTopTenLink(),wppaCheckFeaTenLink(),wppaCheckLasTenLink(),wppaCheckThumbnailWLink(),wppaCheckCommentLink(),wppaCheckXphotoLink(),wppaCheckMphotoLink(),wppaCheckSphotoLink(),wppaCheckSlidePhotoLink(),wppaCheckSlideOnlyLink(),wppaCheckAlbumWidgetLink(),wppaCheckSlideLink(),wppaCheckCoverImg(),wppaCheckPotdLink(),wppaCheckTagLink(),wppaCheckRating(),wppaCheckComments(),wppaCheckCustom(),wppaCheckResize(),wppaCheckNumbar(),wppaCheckWatermark(),wppaCheckPopup(),wppaCheckGravatar(),wppaCheckUserUpload(),wppaCheckAjax(),wppaCheckFotomoto(),wppaCheckLinkPageErr("sphoto"),wppaCheckLinkPageErr("mphoto"),wppaCheckLinkPageErr("xphoto"),wppaCheckLinkPageErr("topten_widget"),wppaCheckLinkPageErr("slideonly_widget"),wppaCheckLinkPageErr("potd"),wppaCheckLinkPageErr("comment_widget"),wppaCheckLinkPageErr("thumbnail_widget"),wppaCheckLinkPageErr("lasten_widget"),wppaCheckLinkPageErr("album_widget"),wppaCheckLinkPageErr("tagcloud"),wppaCheckLinkPageErr("multitag"),wppaCheckLinkPageErr("super_view"),wppaCheckSplitNamedesc(),wppaCheckShares(),wppaCheckCoverType(),wppaCheckNewpag(),wppaCheckCDN(),wppaCheckAutoPage(),wppaCheckGps(),wppaCheckFontPreview(),wppaCheckCheck("enable_video","wppa-video"),wppaCheckCheck("custom_fields","custfields"),wppaCheckCheck("album_custom_fields","albumcustfields"),wppaCheckCheck("new_mod_label_is_text","nmtxt"),wppaCheckCheck("coverphoto_responsive","cvpr"),wppaCheckSmWidgetLink();var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for("on"==p?wppaShowTable(table):wppaHideTable(table),subtab=0;subtab<12;subtab++)"on"==(p=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]))&&wppaToggleSubTable(e[table-1],t[subtab]);wppaToggleSubTable(e[table-1],"Z")}}function wppaQuickSel(){var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","Z");for(table=1;table<13;table++)for(table<13?wppaShowTable(table):wppaHideTable(table),wppa_tablecookieoff(table),subtab=0;subtab<12;subtab++){cookie=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]),"on"==cookie&&wppaToggleSubTable(e[table-1],t[subtab]);var p=jQuery(".wppa-"+e[table-1]+"-"+t[subtab]);p.length>0&&(p.removeClass("wppa-none"),wppaSubTabOn[e[table-1]+"-"+t[subtab]]=!1,wppa_tablecookieoff(e[table-1]+"-"+t[subtab]))}if(tag1=jQuery("#wppa-quick-selbox-1").val(),tag2=jQuery("#wppa-quick-selbox-2").val(),"-"==tag1&&"-"==tag2)for(jQuery("._wppatag-").addClass("wppa-none"),table=1;table<13;table++)wppaHideTable(table);else"-"!=tag1&&jQuery("._wppatag-"+tag1).addClass("wppa-none"),"-"!=tag2&&jQuery("._wppatag-"+tag2).addClass("wppa-none")}function wppaToggleTable(e){"none"==jQuery("#wppa_table_"+e).css("display")?(jQuery("#wppa_table_"+e).css("display","inline"),wppa_tablecookieon(e)):(jQuery("#wppa_table_"+e).css("display","none"),wppa_tablecookieoff(e))}function wppaToggleSubTable(e,t){wppaSubTabOn[e+"-"+t]?(jQuery(".wppa-"+e+"-"+t).addClass("wppa-none"),wppaSubTabOn[e+"-"+t]=!1,wppa_tablecookieoff(e+"-"+t)):(jQuery(".wppa-"+e+"-"+t).removeClass("wppa-none"),wppaSubTabOn[e+"-"+t]=!0,wppa_tablecookieon(e+"-"+t))}function wppaHideTable(e){jQuery("#wppa_table_"+e).css("display","none"),jQuery("#wppa_tableHide-"+e).css("display","none"),jQuery("#wppa_tableShow-"+e).css("display","inline"),wppa_tablecookieoff(e)}function wppaShowTable(e){jQuery("#wppa_table_"+e).css("display","block"),jQuery("#wppa_tableHide-"+e).css("display","inline"),jQuery("#wppa_tableShow-"+e).css("display","none"),wppa_tablecookieon(e)}function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaFollow(e,t){jQuery("#"+e).prop("checked")?jQuery("."+t).css("display",""):jQuery("."+t).css("display","none")}function wppaCheckCheck(e,t){document.getElementById(e).checked?(jQuery("."+t).css("display",""),jQuery(".-"+t).css("display","none")):(jQuery("."+t).css("display","none"),jQuery(".-"+t).css("display",""))}function wppaCheckSlideVideoControls(){"none"!=document.getElementById("slideshow_linktype").value&&alert("Warning! \nYou can not have video controls on a videoslide when there is a link on the slide.\nThe videoslide will not show controls and will also not autoplay")}function wppaCheckFotomoto(){document.getElementById("fotomoto_on").checked?jQuery(".wppa_fotomoto").css("display",""):jQuery(".wppa_fotomoto").css("display","none")}function wppaCheckFontPreview(){var e=document.getElementById("textual_watermark_font").value,t=document.getElementById("textual_watermark_type").value,p=wppaFontDirectory+"wmf"+e+"-"+t+".png",a=wppaFontDirectory+"wmf"+t+"-"+e+".png";jQuery("#wm-font-preview").attr("src",p),jQuery("#wm-type-preview").attr("src",a)}function wppaCheckWidgetMethod(){var e,t;if("4"==document.getElementById("wppa-wm").value){document.getElementById("wppa-wp").style.visibility="visible";var p=jQuery("#wppa-wp").val();"day-of-week"==p||"day-of-month"==p||"day-of-year"==p?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")}else document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden");if("1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function wppaCheckFullHalign(){var e=document.getElementById("fullsize").value,t=document.getElementById("colwidth").value,p=document.getElementById("fullvalign").value;e!=t&&"default"!=p?jQuery(".wppa_ha").css("display",""):jQuery(".wppa_ha").css("display","none"),"auto"==t?jQuery(".wppa_init_resp_width").css("display",""):jQuery(".wppa_init_resp_width").css("display","none")}function wppaCheckCDN(){var e=document.getElementById("cdn_service").value;"cloudinary"==e||"cloudinarymaintenance"==e?jQuery(".cloudinary").css("display",""):jQuery(".cloudinary").css("display","none")}function wppaCheckGps(){"wppa-plus-embedded"==document.getElementById("gpx_implementation").value?(jQuery(".wppa_gpx_native").css("display",""),jQuery(".wppa_gpx_plugin").css("display","none")):(jQuery(".wppa_gpx_native").css("display","none"),jQuery(".wppa_gpx_plugin").css("display",""))}function wppaCheckThumbType(){var e=document.getElementById("thumbtype").value;"default"==e&&(jQuery(".tt_normal").css("display",""),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),wppaCheckUseThumbOpacity()),"ascovers"!=e&&"ascovers-mcr"!=e||(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display",""),jQuery(".tt_always").css("display","")),"masonry"==e&&(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),jQuery(".tt_masonry").css("display",""))}function wppaCheckAutoPage(){document.getElementById("auto_page").checked?jQuery(".autopage").css("display",""):jQuery(".autopage").css("display","none")}function wppaCheckUseThumbOpacity(){document.getElementById("use_thumb_opacity").checked?(jQuery(".thumb_opacity").css("color","#333"),jQuery(".thumb_opacity_html").css("visibility","visible")):(jQuery(".thumb_opacity").css("color","#999"),jQuery(".thumb_opacity_html").css("visibility","hidden"))}function wppaCheckUseCoverOpacity(){document.getElementById("use_cover_opacity").checked?(jQuery(".cover_opacity").css("color","#333"),jQuery(".cover_opacity_html").css("visibility","visible")):(jQuery(".cover_opacity").css("color","#999"),jQuery(".cover_opacity_html").css("visibility","hidden"))}function wppaCheckBreadcrumb(){var e=document.getElementById("show_bread_posts").checked,t=document.getElementById("show_bread_pages").checked;if(e||t){jQuery(".wppa_bc").css("display",""),jQuery(".wppa_bc_html").css("display","");var p=document.getElementById("bc_separator").value;"txt"==p?(jQuery(".wppa_bc_txt").css("display",""),jQuery(".wppa_bc_url").css("display","none"),jQuery(".wppa_bc_txt_html").css("display",""),jQuery(".wppa_bc_url_html").css("display","none")):"url"==p?(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display",""),jQuery(".wppa_bc_txt_html").css("display","none"),jQuery(".wppa_bc_url_html").css("display","")):(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none"))}else jQuery(".wppa_bc").css("display","none"),jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none")}function wppaCheckRating(){document.getElementById("rating_on").checked?(jQuery(".wppa_rating").css("color","#333"),jQuery(".wppa_rating_html").css("visibility","visible"),jQuery(".wppa_rating_").css("display","")):(jQuery(".wppa_rating").css("color","#999"),jQuery(".wppa_rating_html").css("visibility","hidden"),jQuery(".wppa_rating_").css("display","none"))}function wppaCheckComments(){document.getElementById("show_comments").checked?(jQuery(".wppa_comment").css("color","#333"),jQuery(".wppa_comment_html").css("visibility","visible"),jQuery(".wppa_comment_").css("display","")):(jQuery(".wppa_comment").css("color","#999"),jQuery(".wppa_comment_html").css("visibility","hidden"),jQuery(".wppa_comment_").css("display","none"))}function wppaCheckAjax(){document.getElementById("allow_ajax").checked?jQuery(".wppa_allow_ajax_").css("display",""):jQuery(".wppa_allow_ajax_").css("display","none")}function wppaCheckShares(){document.getElementById("share_on").checked||document.getElementById("share_on_widget").checked||document.getElementById("share_on_lightbox").checked||document.getElementById("share_on_thumbs").checked||document.getElementById("share_on_mphoto").checked?jQuery(".wppa_share").css("display",""):jQuery(".wppa_share").css("display","none")}function wppaCheckCoverType(){var e=document.getElementById("cover_type").value;document.getElementById("coverphoto_pos").value;"imagefactory"==e||"imagefactory-mcr"==e?jQuery(".wppa_imgfact_").css("display",""):jQuery(".wppa_imgfact_").css("display","none")}function wppaCheckNewpag(){document.getElementById("newpag_create").checked?jQuery(".wppa_newpag").css("display",""):jQuery(".wppa_newpag").css("display","none")}function wppaCheckCustom(){document.getElementById("custom_on").checked?(jQuery(".wppa_custom").css("color","#333"),jQuery(".wppa_custom_html").css("visibility","visible"),jQuery(".wppa_custom_").css("display","")):(jQuery(".wppa_custom").css("color","#999"),jQuery(".wppa_custom_html").css("visibility","hidden"),jQuery(".wppa_custom_").css("display","none"))}function wppaCheckWidgetLink(){"-1"==document.getElementById("wlp").value?(jQuery(".wppa_wlu").css("display",""),jQuery(".wppa_wlt").css("visibility","hidden")):(jQuery(".wppa_wlu").css("display","none"),jQuery(".wppa_wlt").css("visibility","visible"))}function wppaCheckSmWidgetLink(){"home"==document.getElementById("widget_sm_linktype").value?jQuery(".wppa_smrp").css("visibility","hidden"):jQuery(".wppa_smrp").css("visibility","")}function wppaCheckThumbLink(){var e=document.getElementById("thumb_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlp").css("visibility","hidden"):jQuery(".wppa_tlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlb").css("visibility","hidden"):jQuery(".wppa_tlb").css("visibility","visible")}function wppaCheckTopTenLink(){var e=document.getElementById("topten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlp").css("visibility","hidden"):jQuery(".wppa_ttlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlb").css("visibility","hidden"):jQuery(".wppa_ttlb").css("visibility","visible")}function wppaCheckFeaTenLink(){var e=document.getElementById("featen_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlp").css("visibility","hidden"):jQuery(".wppa_ftlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlb").css("visibility","hidden"):jQuery(".wppa_ftlb").css("visibility","visible")}function wppaCheckLasTenLink(){var e=document.getElementById("lasten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlp").css("visibility","hidden"):jQuery(".wppa_ltlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlb").css("visibility","hidden"):jQuery(".wppa_ltlb").css("visibility","visible")}function wppaCheckThumbnailWLink(){var e=document.getElementById("thumbnail_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlp").css("visibility","hidden"):jQuery(".wppa_tnlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlb").css("visibility","hidden"):jQuery(".wppa_tnlb").css("visibility","visible")}function wppaCheckCommentLink(){var e=document.getElementById("comment_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlp").css("visibility","hidden"):jQuery(".wppa_cmlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlb").css("visibility","hidden"):jQuery(".wppa_cmlb").css("visibility","visible")}function wppaCheckSlideOnlyLink(){var e=document.getElementById("slideonly_widget_linktype").value;"none"==e||"file"==e||"widget"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solp").css("visibility","hidden"):jQuery(".wppa_solp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solb").css("visibility","hidden"):jQuery(".wppa_solb").css("visibility","visible")}function wppaCheckAlbumWidgetLink(){var e=document.getElementById("album_widget_linktype").value;"lightbox"==e?jQuery(".wppa_awlp").css("visibility","hidden"):jQuery(".wppa_awlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_awlb").css("visibility","hidden"):jQuery(".wppa_awlb").css("visibility","visible")}function wppaCheckSlideLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckCoverImg(){var e=document.getElementById("coverimg_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_covimgbl").css("visibility","hidden"):jQuery(".wppa_covimgbl").css("visibility","visible")}function wppaCheckPotdLink(){var e=document.getElementById("potd_linktype").value;"none"==e||"lightbox"==e||"file"==e||"custom"==e?jQuery(".wppa_potdlp").css("visibility","hidden"):jQuery(".wppa_potdlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_potdlb").css("visibility","hidden"):jQuery(".wppa_potdlb").css("visibility","visible")}function wppaCheckTagLink(){document.getElementById("tagcloud_linktype").value}function wppaCheckMTagLink(){document.getElementById("multitag_linktype").value}function wppaCheckXphotoLink(){var e=document.getElementById("xphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_xlp").css("visibility","hidden"):jQuery(".wppa_xlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_xlb").css("visibility","hidden"):jQuery(".wppa_xlb").css("visibility","visible")}function wppaCheckMphotoLink(){var e=document.getElementById("mphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_mlp").css("visibility","hidden"):jQuery(".wppa_mlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_mlb").css("visibility","hidden"):jQuery(".wppa_mlb").css("visibility","visible")}function wppaCheckSphotoLink(){var e=document.getElementById("sphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_slp").css("visibility","hidden"):jQuery(".wppa_slp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_slb").css("visibility","hidden"):jQuery(".wppa_slb").css("visibility","visible")}function wppaCheckSlidePhotoLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"file"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslp").css("visibility","hidden"):jQuery(".wppa_sslp").css("visibility","visible"),"none"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckResize(){document.getElementById("resize_on_upload").checked?jQuery(".re_up").css("display",""):jQuery(".re_up").css("display","none")}function wppaCheckNumbar(){document.getElementById("show_slideshownumbar").checked?jQuery(".wppa_numbar").css("display",""):jQuery(".wppa_numbar").css("display","none")}function wppaCheckWatermark(){document.getElementById("watermark_on").checked?jQuery(".wppa_watermark").css("display",""):jQuery(".wppa_watermark").css("display","none")}function wppaCheckPopup(){document.getElementById("use_thumb_popup").checked?jQuery(".wppa_popup").css("display",""):jQuery(".wppa_popup").css("display","none")}function wppaCheckGravatar(){document.getElementById("comment_gravatar")&&("url"==document.getElementById("comment_gravatar").value?jQuery(".wppa_grav").css("display",""):jQuery(".wppa_grav").css("display","none"))}function wppaCheckUserUpload(){document.getElementById("user_upload_on").checked?jQuery(".wppa_feup").css("display",""):jQuery(".wppa_feup").css("display","none")}function wppaCheckSplitNamedesc(){document.getElementById("split_namedesc").checked?(jQuery(".swap_namedesc").css("display","none"),jQuery(".hide_empty").css("display","")):(jQuery(".swap_namedesc").css("display",""),jQuery(".hide_empty").css("display","none"))}function wppa_tablecookieon(e){wppa_setCookie("table_"+e,"on","365")}function wppa_tablecookieoff(e){wppa_setCookie("table_"+e,"off","365")}function wppaCookieCheckbox(e,t){e.checked?wppa_setCookie(t,"on","365"):wppa_setCookie(t,"off","365")}function wppa_move_up(e){document.location=wppa_moveup_url+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value}function checkColor(e){var t=e.substr(5),p=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",p)}function checkAll(e,t){var p=document.getElementById(e);p&&(p.checked?jQuery(t).prop("checked","checked"):jQuery(t).prop("checked",""))}function impUpd(e,t){e.checked?(jQuery(t).prop("value",wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).prop("value",wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(e,t,p){var a="",o="";a=t||'<div style="padding-left:5px;" >',p?o=p:aftrer="</div>",wppaFeAjaxLog("in");var n=wppaGetXmlHttp(),i=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+e;i+="&wppa-nonce="+document.getElementById("photo-nonce-"+e).value,n.open("GET",i,!0),n.send(),n.onreadystatechange=function(){switch(n.readyState){case 1:document.getElementById("photostatus-"+e).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+e).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+e).innerHTML="processing request";break;case 4:if(200==n.status){var t=wppaTrim(n.responseText).split("||");"ER"==t[0]?(alert(t[3]),jQuery("#wppa-delete-"+e).css("text-decoration","line-through")):""!=t[0]&&alert("The server returned unexpected output:\n"+t[0]),0==t[1]?document.getElementById("photostatus-"+e).innerHTML=t[2]:(document.getElementById("photoitem-"+e).innerHTML=a+t[2]+o,wppaProcessFull(t[3],t[4])),wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+e).innerHTML=a+'<span style="color:red;" >Comm error '+n.status+": "+n.statusText+"</span>"+o}}}function wppaAjaxUndeletePhoto(e){wppaFeAjaxLog("in");var t=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+e;p+="&wppa-nonce="+document.getElementById("photo-nonce-"+e).value,t.open("GET",p,!0),t.send(),t.onreadystatechange=function(){switch(t.readyState){case 1:document.getElementById("photostatus-"+e).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+e).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+e).innerHTML="processing request";break;case 4:if(200==t.status){var p=wppaTrim(t.responseText).split("||");"ER"==p[0]?(alert(p[3]),jQuery("#wppa-delete-"+e).css("text-decoration","line-through")):""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),0==p[1]?document.getElementById("photostatus-"+e).innerHTML=p[2]:document.getElementById("photoitem-"+e).innerHTML='<div style="padding-left:5px;" >'+p[2]+"</div>",wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+e).innerHTML=before+'<span style="color:red;" >Comm error '+t.status+": "+t.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(e,t,p){wppaFeAjaxLog("in");var a=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+e).css({visibility:"visible"});var o="action=wppa&wppa-action=watermark-photo&photo-id="+e;o+="&wppa-nonce="+document.getElementById("photo-nonce-"+e).value,t&&(o+="&wppa-watermark-file="+t),p&&(o+="&wppa-watermark-pos="+p),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(o),a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var t=wppaTrim(a.responseText).split("||");switch(""!=t[0]&&alert("The server returned unexpected output:\n"+t[0]),t[1]){case"0":document.getElementById("photostatus-"+e).innerHTML=t[2];break;default:document.getElementById("photostatus-"+e).innerHTML='<span style="color:red">'+t[2]+"</span>"}jQuery("#wppa-water-spin-"+e).css({visibility:"hidden"}),wppaFeAjaxLog("out")}else document.getElementById("photostatus-"+e).innerHTML='<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"}}function wppaAjaxUpdatePhoto(e,t,p,a,o){var n=!1;o&&(n=0==jQuery("#wppaphotodesc"+o+":visible").length,jQuery("#wppaphotodesc"+o+"-html").click(),n&&jQuery("#wppaphotodesc"+o+"-tmce").click());for(var i=wppaPhotoUpdateMatrix.length,s=0,l=!1,r=-1;s<i;)wppaPhotoUpdateMatrix[s][0]==e&&wppaPhotoUpdateMatrix[s][1]==t&&(l=!0,r=s),s++;if(!l){wppaPhotoUpdateMatrix[i]=[e,t,"undefined",!1,!1,a],r=i}wppaPhotoUpdateMatrix[r][3]="number"==typeof p?p:p.value,wppaPhotoUpdateMatrix[r][5]=a,wppaAjaxUpdatePhotoMonitor()}function wppaAjaxUpdateDelphoto(e,t,p){wppaAjaxUpdatePhoto(e,"del"+t,p)}function wppaAjaxUpdatePhotoMonitor(){for(var e=wppaPhotoUpdateMatrix.length,t=0;t<e;)wppaPhotoUpdateMatrix[t][2]==wppaPhotoUpdateMatrix[t][3]||wppaPhotoUpdateMatrix[t][4]||(wppaPhotoUpdateMatrix[t][4]=!0,_wppaAjaxUpdatePhoto(wppaPhotoUpdateMatrix[t][0],wppaPhotoUpdateMatrix[t][1],wppaPhotoUpdateMatrix[t][3],wppaPhotoUpdateMatrix[t][5])),t++}function _wppaAjaxUpdatePhoto(e,t,p,a,o,n){o||(o=""),n||(n="");wppaFeAjaxLog("in"),wppaAjaxPhotoCount[e]||(wppaAjaxPhotoCount[e]=0),wppaAjaxPhotoCount[e]++,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+e+"&item="+t+"&wppa-nonce="+document.getElementById("photo-nonce-"+e).value+"&value="+wppaEncode(p),async:!0,type:"POST",timeout:1e4,beforeSend:function(p){"description"==t&&jQuery("#wppa-photo-spin-"+e).css({visibility:"visible"}),jQuery("#photostatus-"+e).html("Working, please wait... ("+wppaAjaxPhotoCount[e]+")")},success:function(i,s,l){var r=wppaTrim(i).split("||");switch(wppaAjaxPhotoCount[e]--,""!=r[0]&&alert("The server returned unexpected output:\n"+r[0]),r[1]){case"0":if(0==wppaAjaxPhotoCount[e]?jQuery("#photostatus-"+e).html(r[2]):jQuery("#photostatus-"+e).html("Working, please wait... ("+wppaAjaxPhotoCount[e]+")"),r[3]&&((u=jQuery("#fs-a-"+e).attr("href").split("="))[1]=parseInt(u[1])+1,jQuery("#fs-a-"+e).attr("href",u[0]+"="+u[1]),jQuery("#fs-img-"+e).attr("src",u[0]+"="+u[1])),r[4]){var u=jQuery("#tnp-"+e).attr("src").split("=");u[1]=parseInt(u[1])+1,jQuery("#tnp-"+e).attr("src",u[0]+"="+u[1])}void 0!==r[5]&&(jQuery("#imstack-"+e).html(r[5]),r[5].length>0?jQuery("#imstackbutton-"+e).css("display",""):jQuery("#imstackbutton-"+e).css("display","none")),void 0!==r[6]&&jQuery("#dispfileinfo-"+e).html(r[6]);break;case"99":jQuery("#photoitem-"+e).html(o+'<span style="color:red">'+r[2]+"</span>"+n);break;default:jQuery("#photostatus-"+e).html('<span style="color:red">'+r[2]+" ("+r[1]+")</span>")}"description"==t&&jQuery("#wppa-photo-spin-"+e).css({visibility:"hidden"});var c=0,d=-1;for(count=wppaPhotoUpdateMatrix.length;c<count;)wppaPhotoUpdateMatrix[c][0]==e&&wppaPhotoUpdateMatrix[c][1]==t&&(d=c),c++;if(wppaPhotoUpdateMatrix[d]&&(wppaPhotoUpdateMatrix[d][2]=p||0,wppaPhotoUpdateMatrix[d][4]=!1,wppaPhotoUpdateMatrix[d][5]=!1),wppaFeAjaxLog("out"),wppaAjaxUpdatePhotoMonitor(),a&&"0"==r[1])return jQuery("#photostatus-"+e).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-photo-spin-"+e).css({visibility:"visible"}),void setTimeout(function(){wppaReload("#photo_"+e)},1e3)},error:function(t,p,a){wppaAjaxPhotoCount[e]--,jQuery("#photostatus-"+e).html('<span style="color:red;" >Comm error '+p+"</span>"),wppaConsoleLog("_wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+p,"force")},complete:function(e,t,p){jQuery("#wppa-admin-spinner").css("display","none")}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",document.getElementById("wppa-dummy")))}function wppaAjaxUpdateAlbum(e,t,p,a){var o=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var n=wppaAlbumUpdateMatrix.length,i=0,s=!1,l=-1;i<n;)wppaAlbumUpdateMatrix[i][0]==e&&wppaAlbumUpdateMatrix[i][1]==t&&(s=!0,l=i),i++;if(!s){wppaAlbumUpdateMatrix[n]=[e,t,"undefined",!1,!1,a],l=n}wppaAlbumUpdateMatrix[l][3]="number"==typeof p?p:p.value,wppaAlbumUpdateMatrix[l][5]=a,wppaAjaxUpdateAlbumMonitor(o)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,p=0;p<t;)wppaAlbumUpdateMatrix[p][2]==wppaAlbumUpdateMatrix[p][3]||wppaAlbumUpdateMatrix[p][4]||(wppaAlbumUpdateMatrix[p][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[p][0],wppaAlbumUpdateMatrix[p][1],wppaAlbumUpdateMatrix[p][3],e,wppaAlbumUpdateMatrix[p][5])),p++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(e,t,p,a,o){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+e+"&item="+t+"&wppa-nonce="+document.getElementById("album-nonce-"+e).value+"&value="+wppaEncode(p),async:!0,type:"POST",timeout:1e4,beforeSend:function(p){"description"==t&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+e).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(n,i,s){var l=wppaTrim(n).split("||");switch(wppaAjaxAlbumCount--,""!=l[0]&&alert("The server returned unexpected output:\n"+l[0]),l[1]){case"0":0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+e).html(l[2]):jQuery("#albumstatus-"+e).html("Working, please wait... ("+wppaAjaxAlbumCount+")");break;default:jQuery("#albumstatus-"+e).html='<span style="color:red">'+l[2]+" ("+l[1]+")</span>"}if(void 0!==l[3]&&wppaProcessFull(l[3],l[4]),o&&"0"==l[1])return jQuery("#albumstatus-"+e).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==t&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var r=0,u=-1,c=wppaAlbumUpdateMatrix.length;r<c;)wppaAlbumUpdateMatrix[r][0]==e&&wppaAlbumUpdateMatrix[r][1]==t&&(u=r),r++;wppaAlbumUpdateMatrix[u][2]=p||0,wppaAlbumUpdateMatrix[u][4]=!1,wppaAlbumUpdateMatrix[u][5]=!1,wppaAjaxUpdateAlbumMonitor(a)},error:function(t,p,a){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+e).html('<span style="color:red;" >Comm error '+p+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+a+", status = "+p,"force")},complete:function(e,t,p){}})}function wppaProcessFull(e,t){"full"==e&&(jQuery("#full").css("display",""),jQuery("#notfull").css("display","none")),"notfull"==e&&(jQuery("#full").css("display","none"),t>0?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(e,t,p){var a=wppaGetXmlHttp(),o=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+e+"&wppa-comment-id="+t+"&wppa-comment-status="+p+"&wppa-nonce="+document.getElementById("photo-nonce-"+e).value;a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var p=wppaTrim(a.responseText).split("||");switch(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),p[1]){case"0":jQuery("#photostatus-"+e).html(p[2]);break;default:jQuery("#photostatus-"+e).html('<span style="color:red">'+p[2]+"</span>")}jQuery("#wppa-comment-spin-"+t).css("visibility","hidden")}else jQuery("#photostatus-"+e).html('<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>")},a.open("GET",o,!0),a.send()}function wppaAjaxUpdateOptionCheckBox(e,t){var p=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+e;a+="&wppa-nonce="+document.getElementById("wppa-nonce").value,t.checked?a+="&value=yes":a+="&value=no",p.onreadystatechange=function(){switch(p.readyState){case 1:case 2:case 3:jQuery("#img_"+e).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var t=wppaTrim(p.responseText).split("||");if(""!=t[0]&&alert("The server returned unexpected output:\n"+t[0]),404!=p.status)switch(t[1]){case"0":jQuery("#img_"+e).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+e).attr("title",t[2]),""!=t[3]&&alert(t[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+e).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+e).attr("title","Error #"+t[1]+", message: "+t[2]+", status: "+p.status),""!=t[3]&&alert(t[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))}else jQuery("#img_"+e).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+e).attr("title","Communication error, status = "+p.status);wppaCheckInconsistencies()}},p.open("GET",a,!0),p.send()}function wppaMaintenanceProc(e,t,p){if(p);else if(!t&&"yes"==document.getElementById(e+"_continue").value)return document.getElementById(e+"_continue").value="no",document.getElementById(e+"_button").value="Start!",void(jQuery("#"+e+"_togo").html()>0&&(jQuery("#"+e+"_status").html("Pausing..."),jQuery("#"+e+"_button").css("display","none")));p||(document.getElementById(e+"_continue").value="yes",document.getElementById(e+"_button").value="Stop!",""==jQuery("#"+e+"_status").html()&&jQuery("#"+e+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+e+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(p?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var o=e.split("||"),n=o[1],i=!1;return n?(o[0].length>10&&(alert("An error occurred:\n"+o[0]),i=!0),jQuery("#"+n+"_status").html(o[2]),jQuery("#"+n+"_togo").html(o[3]),jQuery("#"+n+"_button").css("display",""),i||"0"==o[3]?"reload"==o[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+n+"', false)",20):void("yes"!=document.getElementById(n+"_continue").value?p||jQuery("#"+n+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+n+"', true)",20))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(t,p,a){wppaConsoleLog("wppaMaintenanceProc failed. Error = "+a+", status = "+p,"force"),jQuery("#"+e+"_status").html("Server error");var o=!1;wppaAlwaysContinue<1&&(o=confirm("Server error.\nDo you want to continue?"))&&0==wppaAlwaysContinue&&("wppa_remake"==e||"wppa_regen_thumbs"==e||"wppa_create_o1_files"==e||"wppa_recup"==e?confirm("Always continue after server error?")&&(wppaAlwaysContinue=1):wppaAlwaysContinue=-1),(o||1==wppaAlwaysContinue)&&("wppa_remake"==e&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==e&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==e&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+e+"', true)",2e3))},complete:function(e,t,p){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":"Search index table";break;case"wppa_list_errorlog":"WPPA+ Error log";break;case"wppa_list_rating":"Recent ratings";break;case"wppa_list_session":"Active sessions";break;case"wppa_list_comments":"Recent comments"}var t=.9*jQuery(window).width(),p=wppaGetXmlHttp(),a=wppaAjaxUrl,o="action=wppa&wppa-action=maintenancepopup&slug="+e;if(o+="&wppa-nonce="+document.getElementById("wppa-nonce").value,p.open("POST",a,!1),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(o),4==p.readyState&&200==p.status){var n=p.responseText,i={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText};jQuery("#wppa-modal-container").html(n).dialog(i).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right"}),jQuery(".ui-button").attr("title",wppaCloseText)}}function wppaAjaxUpdateOptionValue(e,t,p){var a=wppaGetXmlHttp();a.onreadystatechange=function(){if(4!=a.readyState)jQuery("#img_"+e).attr("src",wppaImageDirectory+"spinner.gif");else{var t=wppaTrim(a.responseText).split("||");if(""!=t[0]&&alert("The server returned unexpected output:\n"+t[0]),404!=a.status){switch(t[1]){case"0":jQuery("#img_"+e).attr("src",wppaImageDirectory+"tick.png"),""!=t[3]&&alert(t[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+e).attr("src",wppaImageDirectory+"cross.png"),""!=t[3]&&alert(t[3])}if(jQuery("#img_"+e).attr("title",t[2]),t[4])for(var p,o,n,i=t[4].split(";"),s=0;s<i.length;)p=i[s].split(":"),o=jQuery("#"+p[0]).html(),n=p[1],""!=o&&""==n&&(n='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+p[0]).html(n),s++}else jQuery("#img_"+e).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+e).title="Communication error";wppaCheckInconsistencies()}},eslug=wppaEncode(e);var o="action=wppa&wppa-action=update-option&wppa-option="+eslug;o+="&wppa-nonce="+document.getElementById("wppa-nonce").value,0!=t&&(o+="number"==typeof t?"&value="+t:p?"&value="+wppaGetSelectionEnumByClass("."+e,","):"&value="+wppaEncode(t.value)),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(o)}function wppaEncode(e){var t,p;if(void 0!==e){if("number"==typeof e)return e;var a=(t=p=(t=p=(t=e).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),o=0;for(p="";o<a.length;)p+=a[o],++o<a.length&&(p+="||PLUS||");return p}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return window.XMLHttpRequest?xmlhttp=new XMLHttpRequest:xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),jQuery("#status-"+e)){if(elm=document.getElementById("status-"+e),"pending"!=elm.value&&"scheduled"!=elm.value||jQuery("#photoitem-"+e).css({backgroundColor:"#ffebe8",borderColor:"#cc0000"}),"publish"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffe0",borderColor:"#e6db55"}),"featured"==elm.value){jQuery("#photoitem-"+e).css({backgroundColor:"#e0ffe0",borderColor:"#55ee55"});var t=document.getElementById("pname-"+e).value.split(".");if(t.length>1)for(var p=0;p<t.length;)"jpg"!=t[p]&&"JPG"!=t[p]||jQuery("#psdesc-"+e).css({display:""}),p++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaCheckLinkPageErr(e){var t="nil";document.getElementById(e+"_linktype")&&(t=document.getElementById(e+"_linktype").value),"0"!=document.getElementById(e+"_linkpage").value||"nil"!=t&&"photo"!=t&&"single"!=t&&"album"!=t&&"content"!=t&&"slide"!=t&&"plainpage"!=t?jQuery("#"+e+"-err").css({display:"none"}):jQuery("#"+e+"-err").css({display:""})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){var p=document.getElementById(t);e&&(p.value?p.value+=","+e:p.value=e,"-clear-"==e&&(p.value=""))}function wppaRefresh(e){var t=new String(document.location).split("#")[0]+"#"+e;document.location=t}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),wppaFeCount>1&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var p,a="",o=-1,n=-2,i=0,s=!1,l=0;l<e.length;)0!=(p=e[l].valueOf())&&(i=o,p==++i?s=!0:s?(a+=o==n?t+o+t+p:t+t+o+t+p,s=!1):a+=t+p,s||(n=p,n++),o=p),l++;for(s&&(a+=".."+o);"."==a.substr(0,1);)a=a.substr(1);for(;a.substr(0,1)==t;)a=a.substr(1);return a}function wppaGetSelEnumToId(e,t){p=jQuery("."+e);var a=[];for(i=0,j=0;i<p.length;)p[i].selected&&(a[j]=p[i].value,j++),i++;jQuery("#"+t).val(wppaArrayToEnum(a,"."))}function wppaGetSelectionEnumByClass(e,t){var p,a=[],o=0,n=0;for(t||(t="."),p=jQuery(e),o=0,n=0;o<p.length;)p[o].selected&&(a[n]=p[o].value,n++),o++;return wppaArrayToEnum(a,t)}function wppaEditSearch(e,t){var p=jQuery("#"+t).val();0==p.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+p}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+e,async:!0,type:"GET",timeout:1e5,beforeSend:function(t){jQuery("#"+e+"-spin").css("display","inline")},success:function(e,t,p){var a=e.split("||");"0"==a[1]?document.location=a[2]:alert("Error: "+a[1]+"\n\n"+a[2])},error:function(t,p,a){alert("Export Db Table "+e+" failed. Error = "+a+", status = "+p)},complete:function(t,p,a){jQuery("#"+e+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+e,async:!0,type:"GET",timeout:1e5,beforesend:function(e){},success:function(t,p,a){var o=t.split("|");jQuery("#"+e+"_togo").html(o[0]);var n=jQuery("#"+e+"_status").html(),i=o[1];""!=n&&""==i&&(i='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+e+"_status").html(i),setTimeout(function(){wppaAjaxUpdateTogo(e)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||0==e)))}var wppa_moveup_url="#",wppa_import="Import",wppa_update="Update",wppaImageDirectory,wppaAjaxUrl,wppaUploadToThisAlbum="Upload to this album",wppaSubTabOn=new Array,_wppaRefreshAfter=!1,wppaAjaxPhotoCount=new Array,wppaPhotoUpdateMatrix=new Array,_wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array,wppaAlwaysContinue=0,wppaFeCount=0;
|
js/wppa-tinymce-shortcodes.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* Pachkage: wp-photo-album-plus
|
3 |
*
|
4 |
*
|
5 |
-
* Version 6.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -142,7 +142,7 @@ function wppaGalleryEvaluate() {
|
|
142 |
var admins = '';
|
143 |
var align = 'none';
|
144 |
var html = '';
|
145 |
-
|
146 |
// Init colors of <select> tags
|
147 |
jQuery( 'select' ).css( 'color', '#700' );
|
148 |
jQuery( '#wppagallery-album-parent-parent' ).css( 'color', '#070' );
|
@@ -250,7 +250,14 @@ function wppaGalleryEvaluate() {
|
|
250 |
}
|
251 |
switch ( type ) {
|
252 |
case 'generic':
|
|
|
|
|
253 |
case 'upload':
|
|
|
|
|
|
|
|
|
|
|
254 |
case 'landing':
|
255 |
case 'stereo':
|
256 |
miscType = type;
|
@@ -279,7 +286,7 @@ function wppaGalleryEvaluate() {
|
|
279 |
case 'real':
|
280 |
jQuery('#wppagallery-album-real-tr').show();
|
281 |
jQuery('#wppagallery-album-real-search-tr').show();
|
282 |
-
|
283 |
// WPPA has Not many albums, there is a quick select box. If used, ...val() is not empty,
|
284 |
if ( jQuery('#wppagallery-album-real-search') ) {
|
285 |
if ( jQuery('#wppagallery-album-real-search').val() ) {
|
@@ -306,14 +313,14 @@ function wppaGalleryEvaluate() {
|
|
306 |
jQuery('.wppagallery-album-r').show();
|
307 |
}
|
308 |
}
|
309 |
-
|
310 |
// Get the selected album(s)
|
311 |
album = jQuery('#wppagallery-album-real').val();
|
312 |
-
|
313 |
// Make sure right delimiter
|
314 |
album = album.toString().replace( /,/g, '.' );
|
315 |
break;
|
316 |
-
|
317 |
case 'virtual':
|
318 |
|
319 |
// Open the right selection box dependant of type is cover or not
|
@@ -502,23 +509,23 @@ function wppaGalleryEvaluate() {
|
|
502 |
|
503 |
// Size
|
504 |
var size = document.getElementById('wppagallery-size').value;
|
505 |
-
|
506 |
// See if auto with fixed max
|
507 |
var temp = size.split(',');
|
508 |
if ( temp[1] ) {
|
509 |
if ( temp[0] == 'auto' && parseInt( temp[1] ) == temp[1] && temp[1] > 100 ) {
|
510 |
-
|
511 |
// its ok, auto with a static max of size temp[1]
|
512 |
jQuery('#wppagallery-size').css('color', '#070');
|
513 |
}
|
514 |
else {
|
515 |
-
|
516 |
// Not ok
|
517 |
size = 0;
|
518 |
jQuery('#wppagallery-size').css('color', '#700');
|
519 |
}
|
520 |
}
|
521 |
-
|
522 |
// Numeric?
|
523 |
else {
|
524 |
if ( size != '' && size != 'auto' ) {
|
@@ -535,7 +542,7 @@ function wppaGalleryEvaluate() {
|
|
535 |
}
|
536 |
jQuery('#wppagallery-size').css('color', '#070');
|
537 |
}
|
538 |
-
|
539 |
// Add size to shortcode
|
540 |
if ( size != 0 ) {
|
541 |
shortcode += ' size="'+size+'"';
|
2 |
* Pachkage: wp-photo-album-plus
|
3 |
*
|
4 |
*
|
5 |
+
* Version 6.8.00
|
6 |
*
|
7 |
*/
|
8 |
|
142 |
var admins = '';
|
143 |
var align = 'none';
|
144 |
var html = '';
|
145 |
+
|
146 |
// Init colors of <select> tags
|
147 |
jQuery( 'select' ).css( 'color', '#700' );
|
148 |
jQuery( '#wppagallery-album-parent-parent' ).css( 'color', '#070' );
|
250 |
}
|
251 |
switch ( type ) {
|
252 |
case 'generic':
|
253 |
+
miscType = type;
|
254 |
+
break;
|
255 |
case 'upload':
|
256 |
+
miscType = type;
|
257 |
+
jQuery('#wppagallery-album-realopt-tr').show();
|
258 |
+
album = jQuery('#wppagallery-album-realopt').val();
|
259 |
+
album = album.toString().replace( /,/g, '.' );
|
260 |
+
break;
|
261 |
case 'landing':
|
262 |
case 'stereo':
|
263 |
miscType = type;
|
286 |
case 'real':
|
287 |
jQuery('#wppagallery-album-real-tr').show();
|
288 |
jQuery('#wppagallery-album-real-search-tr').show();
|
289 |
+
|
290 |
// WPPA has Not many albums, there is a quick select box. If used, ...val() is not empty,
|
291 |
if ( jQuery('#wppagallery-album-real-search') ) {
|
292 |
if ( jQuery('#wppagallery-album-real-search').val() ) {
|
313 |
jQuery('.wppagallery-album-r').show();
|
314 |
}
|
315 |
}
|
316 |
+
|
317 |
// Get the selected album(s)
|
318 |
album = jQuery('#wppagallery-album-real').val();
|
319 |
+
|
320 |
// Make sure right delimiter
|
321 |
album = album.toString().replace( /,/g, '.' );
|
322 |
break;
|
323 |
+
|
324 |
case 'virtual':
|
325 |
|
326 |
// Open the right selection box dependant of type is cover or not
|
509 |
|
510 |
// Size
|
511 |
var size = document.getElementById('wppagallery-size').value;
|
512 |
+
|
513 |
// See if auto with fixed max
|
514 |
var temp = size.split(',');
|
515 |
if ( temp[1] ) {
|
516 |
if ( temp[0] == 'auto' && parseInt( temp[1] ) == temp[1] && temp[1] > 100 ) {
|
517 |
+
|
518 |
// its ok, auto with a static max of size temp[1]
|
519 |
jQuery('#wppagallery-size').css('color', '#070');
|
520 |
}
|
521 |
else {
|
522 |
+
|
523 |
// Not ok
|
524 |
size = 0;
|
525 |
jQuery('#wppagallery-size').css('color', '#700');
|
526 |
}
|
527 |
}
|
528 |
+
|
529 |
// Numeric?
|
530 |
else {
|
531 |
if ( size != '' && size != 'auto' ) {
|
542 |
}
|
543 |
jQuery('#wppagallery-size').css('color', '#070');
|
544 |
}
|
545 |
+
|
546 |
// Add size to shortcode
|
547 |
if ( size != 0 ) {
|
548 |
shortcode += ' size="'+size+'"';
|
js/wppa-tinymce-shortcodes.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function wppaGalleryEvaluate(){var e=!0;jQuery("#wppagallery-galery-type-tr").hide(),jQuery("#wppagallery-slides-type-tr").hide(),jQuery("#wppagallery-single-type-tr").hide(),jQuery("#wppagallery-search-type-tr").hide(),jQuery("#wppagallery-miscel-type-tr").hide(),jQuery("#wppagallery-album-type-tr").hide(),jQuery("#wppagallery-album-real-tr").hide(),jQuery("#wppagallery-album-real-search-tr").hide(),jQuery("#wppagallery-album-realopt-tr").hide(),jQuery("#wppagallery-album-virt-tr").hide(),jQuery("#wppagallery-album-virt-cover-tr").hide(),jQuery("#wppagallery-owner-tr").hide(),jQuery("#wppagallery-owner-parent-tr").hide(),jQuery("#wppagallery-album-parent-tr").hide(),jQuery("#wppagallery-album-count-tr").hide(),jQuery("#wppagallery-photo-count-tr").hide(),jQuery("#wppagallery-albumcat-tr").hide(),jQuery("#wppagallery-photo-tr").hide(),jQuery("#wppagallery-photo-preview-tr").hide(),jQuery("#wppagallery-phototags-tr").hide(),jQuery("#wppagallery-search-tr").hide(),jQuery("#wppagallery-taglist-tr").hide(),jQuery("#wppagallery-album-super-tr").hide(),jQuery("#wppagallery-calendar-tr").hide(),jQuery("#wppagallery-tags-cats-tr").hide(),jQuery("#wppagallery-landing-tr").hide(),jQuery("#wppagallery-rootalbum-tr").hide(),jQuery("#wppagallery-admins-tr").hide();var a,r,l="[wppa",p="",t="",y="",o="",u="",s="",w="",c="",g="",i="",h="",n="",d="",j="",Q=!1,m=!1,b=!1,v=!1,k=!1,f=!1,E=!1,x=!1,I=!1,P=!1,T="",S="",N="",A="",B="",C=!1,G=!1,z="",D="0",M="0",_="",q="none",L="";switch(jQuery("select").css("color","#700"),jQuery("#wppagallery-album-parent-parent").css("color","#070"),jQuery("#wppagallery-align").css("color","#070"),p=jQuery("#wppagallery-top-type").val(),wppaIsEmpty(p)||jQuery("#wppagallery-top-type").css("color","#070"),p){case"galerytype":jQuery("#wppagallery-galery-type-tr").show(),t=jQuery("#wppagallery-galery-type").val(),Q=!0,b=!0,jQuery("#wppagallery-album-type-tr").show(),wppaIsEmpty(t)||(jQuery("#wppagallery-galery-type").css("color","#070"),y=t);break;case"slidestype":jQuery("#wppagallery-slides-type-tr").show(),t=jQuery("#wppagallery-slides-type").val(),m=!0,b=!0,jQuery("#wppagallery-album-type-tr").show(),wppaIsEmpty(t)||(jQuery("#wppagallery-slides-type").css("color","#070"),o=t);break;case"singletype":jQuery("#wppagallery-single-type-tr").show(),t=jQuery("#wppagallery-single-type").val(),v=!0,jQuery("#wppagallery-photo-tr").show(),wppaIsEmpty(t)||jQuery("#wppagallery-single-type").css("color","#070");break;case"searchtype":switch(jQuery("#wppagallery-search-type-tr").show(),t=jQuery("#wppagallery-search-type").val(),I=!0,s=t,wppaIsEmpty(t)||jQuery("#wppagallery-search-type").css("color","#070"),t){case"search":jQuery("#wppagallery-search-tr").show(),jQuery("#wppagallery-root").prop("checked")&&jQuery("#wppagallery-rootalbum-tr").show(),M=jQuery("#wppagallery-rootalbum").val(),jQuery("#wppagallery-landing-tr").show(),D=jQuery("#wppagallery-landing").val();break;case"supersearch":break;case"tagcloud":case"multitag":if(jQuery("#wppagallery-taglist-tr").show(),!jQuery("#wppagallery-alltags").prop("checked")){E=!0,jQuery("#wppagallery-seltags").show(),r=jQuery(".wppagallery-taglist-tags");R=[];for(O=0,a=0;O<r.length;)r[O].selected&&(R[a]=r[O].value,a++),O++;T=wppaArrayToEnum(R,",")}break;case"superview":jQuery("#wppagallery-album-super-tr").show(),c=jQuery("#wppagallery-album-super-parent").val();break;case"calendar":jQuery("#wppagallery-calendar-tr").show(),jQuery("#wppagallery-album-super-tr").show(),B=jQuery("#wppagallery-calendar-type").val(),C=jQuery("#wppagallery-calendar-reverse").prop("checked"),G=jQuery("#wppagallery-calendar-allopen").prop("checked"),g=jQuery("#wppagallery-album-super-parent").val()}break;case"misceltype":switch(jQuery("#wppagallery-miscel-type-tr").show(),t=jQuery("#wppagallery-miscel-type").val(),P=!0,wppaIsEmpty(t)||jQuery("#wppagallery-miscel-type").css("color","#070"),t){case"generic":case"upload":case"landing":case"stereo":w=t;break;case"choice":w=t,jQuery("#wppagallery-admins-tr").show(),_=wppaGetSelectionEnumByClass(".wppagallery-admin",",")}}if(wppaIsEmpty(t)||(l+=' type="'+t+'"'),b)switch(u=jQuery("#wppagallery-album-type").val(),wppaIsEmpty(u)||jQuery("#wppagallery-album-type").css("color","#070"),u){case"real":if(jQuery("#wppagallery-album-real-tr").show(),jQuery("#wppagallery-album-real-search-tr").show(),jQuery("#wppagallery-album-real-search"))if(jQuery("#wppagallery-album-real-search").val()){var H=jQuery("#wppagallery-album-real-search").val().toLowerCase();if(!wppaIsEmpty(H)&&(albums=jQuery(".wppagallery-album-r"),albums.length>0))for(var O=0;O<albums.length;)-1==albums[O].innerHTML.toLowerCase().search(H)?(jQuery(albums[O]).removeAttr("selected"),jQuery(albums[O]).hide()):jQuery(albums[O]).show(),O++}else jQuery(".wppagallery-album-r").show();c=(c=jQuery("#wppagallery-album-real").val()).toString().replace(/,/g,".");break;case"virtual":if("cover"==t?(jQuery("#wppagallery-album-virt-cover-tr").show(),c=jQuery("#wppagallery-album-virt-cover").val()):(jQuery("#wppagallery-album-virt-tr").show(),c=jQuery("#wppagallery-album-virt").val()),!wppaIsEmpty(c))switch(jQuery("#wppagallery-album-virt").css("color","#070"),c){case"#topten":case"#lasten":case"#featen":case"#comten":jQuery("#wppagallery-album-realopt-tr").show(),jQuery(".wppagallery-album-ropt").length>0?g=wppaGetSelectionEnumByClass(".wppagallery-album-ropt","."):-1!=(g=jQuery("#wppagallery-album-realopt").val()).indexOf(",")&&(parr=g.split(","),g=wppaArrayToEnum(parr,".")),""==g&&(g="0"),jQuery("#wppagallery-photo-count-tr").show(),i=jQuery("#wppagallery-photo-count").val();break;case"#tags":jQuery("#wppagallery-phototags-tr").show(),jQuery("#wppagallery-tags-cats-tr").show(),jQuery("[name=andor]:checked").val()||jQuery("#wppagallery-or").prop("checked",!0),z="or"==jQuery("[name=andor]:checked").val()?";":",",f=!0,r=jQuery(".wppagallery-phototags");var R=[];for(O=0,a=0;O<r.length;)r[O].selected&&(R[a]=r[O].value,a++),O++;N=wppaArrayToEnum(R,z);break;case"#last":jQuery("#wppagallery-album-parent-tr").show(),g=jQuery("#wppagallery-album-parent-parent").val(),jQuery("#wppagallery-album-count-tr").show(),i=jQuery("#wppagallery-album-count").val();break;case"#cat":jQuery("#wppagallery-albumcat-tr").show(),jQuery("#wppagallery-tags-cats-tr").show(),jQuery("[name=andor]:checked").val()||jQuery("#wppagallery-or").prop("checked",!0),z="or"==jQuery("[name=andor]:checked").val()?";":",",x=!0,r=jQuery(".wppagallery-albumcat");var U=[];for(O=0,a=0;O<r.length;)r[O].selected&&(U[a]=r[O].value,a++),O++;A=wppaArrayToEnum(U,z);break;case"#owner":case"#upldr":jQuery("#wppagallery-owner-tr").show(),k=!0,S=jQuery("#wppagallery-owner").val(),wppaIsEmpty(S)||(jQuery("#wppagallery-owner").css("color","#070"),jQuery("#wppagallery-owner-parent-tr").show(),g=(g=wppaGetSelectionEnumByClass(".wppagallery-album-p",".")).toString().replace("zero","0"));break;case"#all":break;default:null!=c&&alert(wppaUIERR+": "+c)}break;default:c=""}wppaIsEmpty(c)||(l+=' album="'+c,""!=S&&(l+=","+S),""==g&&""!=i&&(g="0"),""!=g&&(l+=","+g),""!=i&&(l+=","+i),""!=N&&(l+=","+N),""!=A&&(l+=","+A),l+='"'),v&&(h=jQuery("#wppagallery-photo").val())&&(n=(n=(n=h.replace(/\//g,"")).split("."))[0],jQuery("#wppagallery-photo-preview-tr").show(),wppaTinyMcePhotoPreview(h),l+=' photo="'+n+'"',jQuery("#wppagallery-photo").css("color","#070")),"search"==t&&(d=jQuery("#wppagallery-sub").prop("checked"),j=jQuery("#wppagallery-root").prop("checked"),d&&(l+=' sub="1"'),j&&(l+="0"!=M?' root="#'+M+'"':' root="1"'),"0"!=D&&(l+=' landing="'+D+'"')),"tagcloud"!=t&&"multitag"!=t||""!=T&&(l+=' taglist="'+T+'"'),"calendar"==t&&(l+=' calendar="'+B+'"',g&&(l+=' album="'+g+'"'),C&&(l+=' reverse="1"'),G&&(l+=' all="1"')),"choice"==t&&_.length>0&&(l+=' admin="'+_+'"');var W=document.getElementById("wppagallery-size").value,X=W.split(",");if(X[1]?"auto"==X[0]&&parseInt(X[1])==X[1]&&X[1]>100?jQuery("#wppagallery-size").css("color","#070"):(W=0,jQuery("#wppagallery-size").css("color","#700")):(""!=W&&"auto"!=W&&parseInt(W)!=W&&(W=0,jQuery("#wppagallery-size").css("color","#700")),W<0&&(W=-W),W<100&&(W/=100),jQuery("#wppagallery-size").css("color","#070")),0!=W&&(l+=' size="'+W+'"'),"none"!=(q=jQuery("#wppagallery-align").val())&&(l+=' align="'+q+'"'),l+="]"+(r=(r=(r=(r=(r=document.getElementById("wppagallery-shortcode-preview").value).replace(/"/g,'"')).split("]"))[1]).split("["))[0]+"[/wppa]",l=l.replace(/"/g,"""),L='<input type="text" id="wppagallery-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="'+l+'" />',jQuery("#wppagallery-shortcode-preview-container").html(L),!(e=!(""==c&&b||""==h&&v||""==S&&k||""==T&&E||""==y&&Q||""==o&&m||""==s&&I||""==w&&P||""==N&&f||""==A&&x))){var F="";""==c&&b&&(F+="Need album\n"),""==h&&v&&(F+="Need photo\n"),""==S&&k&&(F+="Need owner"),""==T&&E&&(F+="Need taglist"),""==y&&Q&&(F+="Need galType"),""==o&&m&&(F+="Need slideType"),""==s&&I&&(F+="Need searchType"),""==w&&P&&(F+="Need miscType"),""==N&&f&&(F+="Need tags"),""==A&&x&&(F+="Need cats")}e?(jQuery("#wppagallery-submit").show(),jQuery("#wppagallery-submit-notok").hide()):(jQuery("#wppagallery-submit").hide(),jQuery("#wppagallery-submit-notok").show())}function wppaTinyMcePhotoPreview(e){if("#potd"==e)jQuery("#wppagallery-photo-preview").html(wppaNoPreview);else if(-1!=e.indexOf("xxx")){var a=e.replace("xxx","");jQuery("#wppagallery-photo-preview").html('<video preload="metadata" style="max-width:400px; max-height:300px; margin-top:3px;" controls><source src="'+wppaPhotoDirectory+a+'mp4" type="video/mp4"><source src="'+wppaPhotoDirectory+a+'ogg" type="video/ogg"><source src="'+wppaPhotoDirectory+a+'ogv" type="video/ogg"><source src="'+wppaPhotoDirectory+a+'webm" type="video/webm"></video>')}else jQuery("#wppagallery-photo-preview").html('<img src="'+wppaPhotoDirectory+e+'" style="max-width:400px; max-height:300px;" />')}tinymce.PluginManager.add("wppagallery",function(e,a){e.addButton("wppa_gallery_button",{image:wppaImageDirectory+"albumnew32.png",tooltip:"WPPA+ Shortcode Generator",onclick:function(){var e=jQuery(window).width(),a=jQuery(window).height(),r=720<e?720:e;r-=80,a=jQuery(window).height(),a-=120,tb_show("WPPA+ Shortcode Generator","#TB_inline?width="+r+"&height="+a+"&inlineId=wppagallery-form")}})}),jQuery(function(){var e=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=tinymcedialog";e.open("GET",a,!0),e.send(),e.onreadystatechange=function(){if(4==e.readyState&&404!=e.status){var a=e.responseText,r=jQuery(a);r.find("table");r.appendTo("body").hide(),r.find("#wppagallery-submit").click(function(){newShortcode=document.getElementById("wppagallery-shortcode-preview").value,newShortcode=newShortcode.replace(/"/g,'"'),tinyMCE.activeEditor.execCommand("mceInsertContent",0,newShortcode),tb_remove()})}}});
|
1 |
+
function wppaGalleryEvaluate(){var e=!0;jQuery("#wppagallery-galery-type-tr").hide(),jQuery("#wppagallery-slides-type-tr").hide(),jQuery("#wppagallery-single-type-tr").hide(),jQuery("#wppagallery-search-type-tr").hide(),jQuery("#wppagallery-miscel-type-tr").hide(),jQuery("#wppagallery-album-type-tr").hide(),jQuery("#wppagallery-album-real-tr").hide(),jQuery("#wppagallery-album-real-search-tr").hide(),jQuery("#wppagallery-album-realopt-tr").hide(),jQuery("#wppagallery-album-virt-tr").hide(),jQuery("#wppagallery-album-virt-cover-tr").hide(),jQuery("#wppagallery-owner-tr").hide(),jQuery("#wppagallery-owner-parent-tr").hide(),jQuery("#wppagallery-album-parent-tr").hide(),jQuery("#wppagallery-album-count-tr").hide(),jQuery("#wppagallery-photo-count-tr").hide(),jQuery("#wppagallery-albumcat-tr").hide(),jQuery("#wppagallery-photo-tr").hide(),jQuery("#wppagallery-photo-preview-tr").hide(),jQuery("#wppagallery-phototags-tr").hide(),jQuery("#wppagallery-search-tr").hide(),jQuery("#wppagallery-taglist-tr").hide(),jQuery("#wppagallery-album-super-tr").hide(),jQuery("#wppagallery-calendar-tr").hide(),jQuery("#wppagallery-tags-cats-tr").hide(),jQuery("#wppagallery-landing-tr").hide(),jQuery("#wppagallery-rootalbum-tr").hide(),jQuery("#wppagallery-admins-tr").hide();var a,r,l="[wppa",p="",t="",y="",o="",u="",s="",w="",g="",c="",i="",h="",n="",d="",j="",Q=!1,m=!1,b=!1,v=!1,k=!1,f=!1,E=!1,x=!1,I=!1,P=!1,T="",S="",N="",A="",B="",C=!1,G=!1,z="",D="0",M="0",_="",q="none",L="";switch(jQuery("select").css("color","#700"),jQuery("#wppagallery-album-parent-parent").css("color","#070"),jQuery("#wppagallery-align").css("color","#070"),p=jQuery("#wppagallery-top-type").val(),wppaIsEmpty(p)||jQuery("#wppagallery-top-type").css("color","#070"),p){case"galerytype":jQuery("#wppagallery-galery-type-tr").show(),t=jQuery("#wppagallery-galery-type").val(),Q=!0,b=!0,jQuery("#wppagallery-album-type-tr").show(),wppaIsEmpty(t)||(jQuery("#wppagallery-galery-type").css("color","#070"),y=t);break;case"slidestype":jQuery("#wppagallery-slides-type-tr").show(),t=jQuery("#wppagallery-slides-type").val(),m=!0,b=!0,jQuery("#wppagallery-album-type-tr").show(),wppaIsEmpty(t)||(jQuery("#wppagallery-slides-type").css("color","#070"),o=t);break;case"singletype":jQuery("#wppagallery-single-type-tr").show(),t=jQuery("#wppagallery-single-type").val(),v=!0,jQuery("#wppagallery-photo-tr").show(),wppaIsEmpty(t)||jQuery("#wppagallery-single-type").css("color","#070");break;case"searchtype":switch(jQuery("#wppagallery-search-type-tr").show(),t=jQuery("#wppagallery-search-type").val(),I=!0,s=t,wppaIsEmpty(t)||jQuery("#wppagallery-search-type").css("color","#070"),t){case"search":jQuery("#wppagallery-search-tr").show(),jQuery("#wppagallery-root").prop("checked")&&jQuery("#wppagallery-rootalbum-tr").show(),M=jQuery("#wppagallery-rootalbum").val(),jQuery("#wppagallery-landing-tr").show(),D=jQuery("#wppagallery-landing").val();break;case"supersearch":break;case"tagcloud":case"multitag":if(jQuery("#wppagallery-taglist-tr").show(),!jQuery("#wppagallery-alltags").prop("checked")){E=!0,jQuery("#wppagallery-seltags").show(),r=jQuery(".wppagallery-taglist-tags");R=[];for(O=0,a=0;O<r.length;)r[O].selected&&(R[a]=r[O].value,a++),O++;T=wppaArrayToEnum(R,",")}break;case"superview":jQuery("#wppagallery-album-super-tr").show(),g=jQuery("#wppagallery-album-super-parent").val();break;case"calendar":jQuery("#wppagallery-calendar-tr").show(),jQuery("#wppagallery-album-super-tr").show(),B=jQuery("#wppagallery-calendar-type").val(),C=jQuery("#wppagallery-calendar-reverse").prop("checked"),G=jQuery("#wppagallery-calendar-allopen").prop("checked"),c=jQuery("#wppagallery-album-super-parent").val()}break;case"misceltype":switch(jQuery("#wppagallery-miscel-type-tr").show(),t=jQuery("#wppagallery-miscel-type").val(),P=!0,wppaIsEmpty(t)||jQuery("#wppagallery-miscel-type").css("color","#070"),t){case"generic":w=t;break;case"upload":w=t,jQuery("#wppagallery-album-realopt-tr").show(),g=(g=jQuery("#wppagallery-album-realopt").val()).toString().replace(/,/g,".");break;case"landing":case"stereo":w=t;break;case"choice":w=t,jQuery("#wppagallery-admins-tr").show(),_=wppaGetSelectionEnumByClass(".wppagallery-admin",",")}}if(wppaIsEmpty(t)||(l+=' type="'+t+'"'),b)switch(u=jQuery("#wppagallery-album-type").val(),wppaIsEmpty(u)||jQuery("#wppagallery-album-type").css("color","#070"),u){case"real":if(jQuery("#wppagallery-album-real-tr").show(),jQuery("#wppagallery-album-real-search-tr").show(),jQuery("#wppagallery-album-real-search"))if(jQuery("#wppagallery-album-real-search").val()){var H=jQuery("#wppagallery-album-real-search").val().toLowerCase();if(!wppaIsEmpty(H)&&(albums=jQuery(".wppagallery-album-r"),albums.length>0))for(var O=0;O<albums.length;)-1==albums[O].innerHTML.toLowerCase().search(H)?(jQuery(albums[O]).removeAttr("selected"),jQuery(albums[O]).hide()):jQuery(albums[O]).show(),O++}else jQuery(".wppagallery-album-r").show();g=(g=jQuery("#wppagallery-album-real").val()).toString().replace(/,/g,".");break;case"virtual":if("cover"==t?(jQuery("#wppagallery-album-virt-cover-tr").show(),g=jQuery("#wppagallery-album-virt-cover").val()):(jQuery("#wppagallery-album-virt-tr").show(),g=jQuery("#wppagallery-album-virt").val()),!wppaIsEmpty(g))switch(jQuery("#wppagallery-album-virt").css("color","#070"),g){case"#topten":case"#lasten":case"#featen":case"#comten":jQuery("#wppagallery-album-realopt-tr").show(),jQuery(".wppagallery-album-ropt").length>0?c=wppaGetSelectionEnumByClass(".wppagallery-album-ropt","."):-1!=(c=jQuery("#wppagallery-album-realopt").val()).indexOf(",")&&(parr=c.split(","),c=wppaArrayToEnum(parr,".")),""==c&&(c="0"),jQuery("#wppagallery-photo-count-tr").show(),i=jQuery("#wppagallery-photo-count").val();break;case"#tags":jQuery("#wppagallery-phototags-tr").show(),jQuery("#wppagallery-tags-cats-tr").show(),jQuery("[name=andor]:checked").val()||jQuery("#wppagallery-or").prop("checked",!0),z="or"==jQuery("[name=andor]:checked").val()?";":",",f=!0,r=jQuery(".wppagallery-phototags");var R=[];for(O=0,a=0;O<r.length;)r[O].selected&&(R[a]=r[O].value,a++),O++;N=wppaArrayToEnum(R,z);break;case"#last":jQuery("#wppagallery-album-parent-tr").show(),c=jQuery("#wppagallery-album-parent-parent").val(),jQuery("#wppagallery-album-count-tr").show(),i=jQuery("#wppagallery-album-count").val();break;case"#cat":jQuery("#wppagallery-albumcat-tr").show(),jQuery("#wppagallery-tags-cats-tr").show(),jQuery("[name=andor]:checked").val()||jQuery("#wppagallery-or").prop("checked",!0),z="or"==jQuery("[name=andor]:checked").val()?";":",",x=!0,r=jQuery(".wppagallery-albumcat");var U=[];for(O=0,a=0;O<r.length;)r[O].selected&&(U[a]=r[O].value,a++),O++;A=wppaArrayToEnum(U,z);break;case"#owner":case"#upldr":jQuery("#wppagallery-owner-tr").show(),k=!0,S=jQuery("#wppagallery-owner").val(),wppaIsEmpty(S)||(jQuery("#wppagallery-owner").css("color","#070"),jQuery("#wppagallery-owner-parent-tr").show(),c=(c=wppaGetSelectionEnumByClass(".wppagallery-album-p",".")).toString().replace("zero","0"));break;case"#all":break;default:null!=g&&alert(wppaUIERR+": "+g)}break;default:g=""}wppaIsEmpty(g)||(l+=' album="'+g,""!=S&&(l+=","+S),""==c&&""!=i&&(c="0"),""!=c&&(l+=","+c),""!=i&&(l+=","+i),""!=N&&(l+=","+N),""!=A&&(l+=","+A),l+='"'),v&&(h=jQuery("#wppagallery-photo").val())&&(n=(n=(n=h.replace(/\//g,"")).split("."))[0],jQuery("#wppagallery-photo-preview-tr").show(),wppaTinyMcePhotoPreview(h),l+=' photo="'+n+'"',jQuery("#wppagallery-photo").css("color","#070")),"search"==t&&(d=jQuery("#wppagallery-sub").prop("checked"),j=jQuery("#wppagallery-root").prop("checked"),d&&(l+=' sub="1"'),j&&(l+="0"!=M?' root="#'+M+'"':' root="1"'),"0"!=D&&(l+=' landing="'+D+'"')),"tagcloud"!=t&&"multitag"!=t||""!=T&&(l+=' taglist="'+T+'"'),"calendar"==t&&(l+=' calendar="'+B+'"',c&&(l+=' album="'+c+'"'),C&&(l+=' reverse="1"'),G&&(l+=' all="1"')),"choice"==t&&_.length>0&&(l+=' admin="'+_+'"');var W=document.getElementById("wppagallery-size").value,X=W.split(",");if(X[1]?"auto"==X[0]&&parseInt(X[1])==X[1]&&X[1]>100?jQuery("#wppagallery-size").css("color","#070"):(W=0,jQuery("#wppagallery-size").css("color","#700")):(""!=W&&"auto"!=W&&parseInt(W)!=W&&(W=0,jQuery("#wppagallery-size").css("color","#700")),W<0&&(W=-W),W<100&&(W/=100),jQuery("#wppagallery-size").css("color","#070")),0!=W&&(l+=' size="'+W+'"'),"none"!=(q=jQuery("#wppagallery-align").val())&&(l+=' align="'+q+'"'),l+="]"+(r=(r=(r=(r=(r=document.getElementById("wppagallery-shortcode-preview").value).replace(/"/g,'"')).split("]"))[1]).split("["))[0]+"[/wppa]",l=l.replace(/"/g,"""),L='<input type="text" id="wppagallery-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="'+l+'" />',jQuery("#wppagallery-shortcode-preview-container").html(L),!(e=!(""==g&&b||""==h&&v||""==S&&k||""==T&&E||""==y&&Q||""==o&&m||""==s&&I||""==w&&P||""==N&&f||""==A&&x))){var F="";""==g&&b&&(F+="Need album\n"),""==h&&v&&(F+="Need photo\n"),""==S&&k&&(F+="Need owner"),""==T&&E&&(F+="Need taglist"),""==y&&Q&&(F+="Need galType"),""==o&&m&&(F+="Need slideType"),""==s&&I&&(F+="Need searchType"),""==w&&P&&(F+="Need miscType"),""==N&&f&&(F+="Need tags"),""==A&&x&&(F+="Need cats")}e?(jQuery("#wppagallery-submit").show(),jQuery("#wppagallery-submit-notok").hide()):(jQuery("#wppagallery-submit").hide(),jQuery("#wppagallery-submit-notok").show())}function wppaTinyMcePhotoPreview(e){if("#potd"==e)jQuery("#wppagallery-photo-preview").html(wppaNoPreview);else if(-1!=e.indexOf("xxx")){var a=e.replace("xxx","");jQuery("#wppagallery-photo-preview").html('<video preload="metadata" style="max-width:400px; max-height:300px; margin-top:3px;" controls><source src="'+wppaPhotoDirectory+a+'mp4" type="video/mp4"><source src="'+wppaPhotoDirectory+a+'ogg" type="video/ogg"><source src="'+wppaPhotoDirectory+a+'ogv" type="video/ogg"><source src="'+wppaPhotoDirectory+a+'webm" type="video/webm"></video>')}else jQuery("#wppagallery-photo-preview").html('<img src="'+wppaPhotoDirectory+e+'" style="max-width:400px; max-height:300px;" />')}tinymce.PluginManager.add("wppagallery",function(e,a){e.addButton("wppa_gallery_button",{image:wppaImageDirectory+"albumnew32.png",tooltip:"WPPA+ Shortcode Generator",onclick:function(){var e=jQuery(window).width(),a=jQuery(window).height(),r=720<e?720:e;r-=80,a=jQuery(window).height(),a-=120,tb_show("WPPA+ Shortcode Generator","#TB_inline?width="+r+"&height="+a+"&inlineId=wppagallery-form")}})}),jQuery(function(){var e=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=tinymcedialog";e.open("GET",a,!0),e.send(),e.onreadystatechange=function(){if(4==e.readyState&&404!=e.status){var a=e.responseText,r=jQuery(a);r.find("table");r.appendTo("body").hide(),r.find("#wppagallery-submit").click(function(){newShortcode=document.getElementById("wppagallery-shortcode-preview").value,newShortcode=newShortcode.replace(/"/g,'"'),tinyMCE.activeEditor.execCommand("mceInsertContent",0,newShortcode),tb_remove()})}}});
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
-
Version: 6.
|
6 |
-
Stable tag: 6.7.
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
@@ -127,6 +127,28 @@ If this happens, make sure (ask your hosting provider) that you have all the rig
|
|
127 |
|
128 |
See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
= 6.7.12 =
|
131 |
|
132 |
= Bug Fixes =
|
@@ -157,12 +179,12 @@ See for additional information: <a href="http://www.wppa.nl/changelog/" >The doc
|
|
157 |
|
158 |
* The shortcode generator for shortcode [photo xxx] is now also available for front-end tinymce editors.
|
159 |
See https://wppa.nl/docs-by-subject/advanced-topics/shortcode-photo/ for an explanation.
|
160 |
-
|
161 |
= 6.7.09 =
|
162 |
|
163 |
= Bug Fixes =
|
164 |
|
165 |
-
* Slideshow widget bug fixes:
|
166 |
--- all albums --- did not work, fixed.
|
167 |
On initial display of the activation screen, the default setting values were not shown. Fixed.
|
168 |
Album selectionbox was not sorted. Fixed.
|
@@ -174,13 +196,13 @@ Single image preview videos work correctly now.
|
|
174 |
|
175 |
= New Features =
|
176 |
|
177 |
-
* Slideshow widget new features:
|
178 |
Added checkbox 'Random' for random photo sequence. The sequence will change every pageload.
|
179 |
Added checkbox 'Include subalbums'.
|
180 |
|
181 |
= Other Changes =
|
182 |
|
183 |
-
* Sildeshow widget other changes:
|
184 |
You can set a maximum number of slides, to prevent heavy pageloads, especially when --- all albums --- is used.
|
185 |
The slideshow now always wraps around, regardless of the setting of Table IV-B8.
|
186 |
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
+
Version: 6.8.00
|
6 |
+
Stable tag: 6.7.12
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
127 |
|
128 |
See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
|
129 |
|
130 |
+
= 6.8.00 =
|
131 |
+
|
132 |
+
= Bug Fixes =
|
133 |
+
|
134 |
+
* Various minor fixes for PHP 7.2 compatibility.
|
135 |
+
* If the visitor does not have the rights to edit a photo at the front-end, there will not be a link or button to the edit page.
|
136 |
+
* On the Import and Upload Photos admin pages one can now select a target album even when there are more albums than the setting in Table IX-B6.3.
|
137 |
+
* The most recently uploaded photo had its viewcount bumped for every session when the [photo] shortcode was enabled. Fixed.
|
138 |
+
* If you use qr codes and cache them (See Table IX-K1.4), the cache will be cleared regularly to prvent the generation of too many files.
|
139 |
+
|
140 |
+
= New Features =
|
141 |
+
|
142 |
+
* On the Album Admin -> Edit screen: the photo information now also shows the EXIF data, if available.
|
143 |
+
* Shortcode [photo xxx] can now have 'random' as argument, e.g.: [photo random]. See Table IX-L for details.
|
144 |
+
* On the shortcode generator, one can optionally select one or more albums for the upload box.
|
145 |
+
|
146 |
+
= Other Changes =
|
147 |
+
|
148 |
+
* Supersearch. Selection boxes are now sorted, exif values are formatted.
|
149 |
+
Certain camera brand specific tags are now recognized and (partially) correct formatted.
|
150 |
+
* Further improved formatting of various exif tags.
|
151 |
+
|
152 |
= 6.7.12 =
|
153 |
|
154 |
= Bug Fixes =
|
179 |
|
180 |
* The shortcode generator for shortcode [photo xxx] is now also available for front-end tinymce editors.
|
181 |
See https://wppa.nl/docs-by-subject/advanced-topics/shortcode-photo/ for an explanation.
|
182 |
+
|
183 |
= 6.7.09 =
|
184 |
|
185 |
= Bug Fixes =
|
186 |
|
187 |
+
* Slideshow widget bug fixes:
|
188 |
--- all albums --- did not work, fixed.
|
189 |
On initial display of the activation screen, the default setting values were not shown. Fixed.
|
190 |
Album selectionbox was not sorted. Fixed.
|
196 |
|
197 |
= New Features =
|
198 |
|
199 |
+
* Slideshow widget new features:
|
200 |
Added checkbox 'Random' for random photo sequence. The sequence will change every pageload.
|
201 |
Added checkbox 'Include subalbums'.
|
202 |
|
203 |
= Other Changes =
|
204 |
|
205 |
+
* Sildeshow widget other changes:
|
206 |
You can set a maximum number of slides, to prevent heavy pageloads, especially when --- all albums --- is used.
|
207 |
The slideshow now always wraps around, regardless of the setting of Table IV-B8.
|
208 |
|
theme/wppa-theme.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
<?php
|
2 |
/* wppa_theme.php
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the albums/photos/slideshow in a page or post
|
6 |
-
* Version 6.
|
7 |
*/
|
8 |
function wppa_theme() {
|
9 |
|
10 |
-
global $wppa_version; $wppa_version = '6-
|
11 |
global $wppa;
|
12 |
global $wppa_show_statistics; // Can be set to true by a custom page template
|
13 |
|
@@ -18,16 +18,16 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
18 |
|
19 |
// Open container
|
20 |
wppa_container( 'open' );
|
21 |
-
|
22 |
// Show statistics if set so by the page template
|
23 |
-
if ( $wppa_show_statistics ) wppa_statistics();
|
24 |
|
25 |
// Display breadcrumb navigation only if it is set in the settings page
|
26 |
-
wppa_breadcrumb( 'optional' );
|
|
|
27 |
|
28 |
-
|
29 |
if ( wppa_page( 'albums' ) ) { // Page 'Albums' requested
|
30 |
-
|
31 |
// Init for possible alt thumbsize on masonry
|
32 |
$counter_thumbs = '0';
|
33 |
$is_alt_thumbsize = false;
|
@@ -35,15 +35,15 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
35 |
if ( wppa_is_int( $alb_id ) && $alb_id > '0' ) {
|
36 |
$is_alt_thumbsize = wppa_get_album_item( $alb_id, 'alt_thumbsize' ) == 'yes';
|
37 |
}
|
38 |
-
|
39 |
// Get the albums and the thumbs and the number of pages for each set
|
40 |
$albums = wppa_get_albums(); // Get the albums
|
41 |
$n_album_pages = wppa_get_npages( 'albums', $albums ); // Get the number of album pages
|
42 |
-
|
43 |
if ( wppa_opt( 'thumbtype' ) != 'none' ) {
|
44 |
$thumbs = wppa_get_thumbs(); // Get the Thumbs
|
45 |
} else $thumbs = false;
|
46 |
-
|
47 |
$wanted_empty = wppa_is_wanted_empty( $thumbs ); // See if we need to display an empty thumbnail area
|
48 |
|
49 |
$n_thumb_pages = wppa_get_npages( 'thumbs', $thumbs ); // Get the number of thumb pages
|
@@ -52,16 +52,16 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
52 |
|
53 |
// Get total number of pages
|
54 |
if ( ! wppa_is_pagination() ) $totpag = '1'; // If both pagination is off, there is only one page
|
55 |
-
else $totpag = $n_album_pages + $n_thumb_pages;
|
56 |
|
57 |
// Make pagelinkbar if requested on top
|
58 |
if ( wppa_opt( 'pagelink_pos' ) == 'top' || wppa_opt( 'pagelink_pos' ) == 'both' ) {
|
59 |
wppa_page_links( $totpag, $curpage );
|
60 |
}
|
61 |
-
|
62 |
// Process the albums
|
63 |
if ( ! wppa_switch( 'thumbs_first' ) ) {
|
64 |
-
if ( $albums ) {
|
65 |
$counter_albums = '0';
|
66 |
wppa_album_list( 'open' ); // Open Albums sub-container
|
67 |
foreach ( $albums as $album ) { // Loop the albums
|
@@ -74,18 +74,18 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
74 |
wppa_album_list( 'close' ); // Close Albums sub-container
|
75 |
} // If albums
|
76 |
}
|
77 |
-
|
78 |
if ( $didsome && wppa_is_pagination() ) $thumbs = false; // Pag on and didsome: force a pagebreak by faking no thumbs
|
79 |
-
if ( count( $thumbs ) <= wppa_get_mincount() && ! $wanted_empty ) $thumbs = false; // Less than treshold value
|
80 |
if ( wppa_switch( 'thumbs_first' ) && $curpage > $n_thumb_pages ) $thumbs = false; // If thumbs done, do not display an empty thumbarea
|
81 |
-
|
82 |
// Process the thumbs
|
83 |
-
if ( $thumbs || $wanted_empty )
|
84 |
-
if ( ! $wanted_empty || ! wppa_switch( 'thumbs_first' ) || wppa_get_curpage() == '1' )
|
85 |
if ( ! $wanted_empty || wppa_switch( 'thumbs_first' ) || wppa_get_curpage() == $totpag ) {
|
86 |
-
|
87 |
// As covers
|
88 |
-
if ( wppa_opt( 'thumbtype' ) == 'ascovers' ||
|
89 |
wppa_opt( 'thumbtype' ) == 'ascovers-mcr' ) { // Do the thumbs As covers
|
90 |
wppa_thumb_list( 'open' ); // Open Thumblist sub-container
|
91 |
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
@@ -95,34 +95,34 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
95 |
$didsome = true;
|
96 |
wppa_thumb_ascover( $thumb['id'] ); // Show Thumb as cover
|
97 |
} // End if on page
|
98 |
-
endforeach;
|
99 |
wppa_thumb_list( 'close' ); // Close Thumblist sub-container
|
100 |
} // As covers
|
101 |
|
102 |
// Masonry vertical
|
103 |
elseif ( wppa_opt( 'thumbtype' ) == 'masonry-v' ) { // Masonry
|
104 |
-
|
105 |
// The header
|
106 |
wppa_thumb_area( 'open' ); // Open Thumbarea sub-container
|
107 |
wppa_popup(); // Prepare Popup box
|
108 |
wppa_album_name( 'top' ); // Optionally display album name
|
109 |
wppa_album_desc( 'top' ); // Optionally display album description
|
110 |
-
|
111 |
// Init
|
112 |
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
113 |
$cont_width = wppa_get_container_width();
|
114 |
$count_cols = ceil( $cont_width / ( wppa_opt( $is_alt_thumbsize ? 'thumbsize_alt' : 'thumbsize' ) + wppa_opt( 'tn_margin' ) ) );
|
115 |
$correction = wppa_opt( 'tn_margin' ) * ( $cont_width / $count_cols ) / 100;
|
116 |
-
|
117 |
// Init the table
|
118 |
wppa_out( '<table class="wppa-masonry" style="margin-top:3px;" ><tbody class="wppa-masonry" ><tr class="wppa-masonry" >' );
|
119 |
-
|
120 |
// Init the columns
|
121 |
$col_headers = array();
|
122 |
$col_contents = array();
|
123 |
$col_heights = array();
|
124 |
$col_widths = array();
|
125 |
-
|
126 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
127 |
$col_headers[$col] = '';
|
128 |
$col_contents[$col] = '';
|
@@ -132,7 +132,7 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
132 |
|
133 |
// Process the thumbnails
|
134 |
$col = '0';
|
135 |
-
if ( $thumbs ) foreach ( $thumbs as $tt ) {
|
136 |
$id = $tt['id'];
|
137 |
$counter_thumbs++;
|
138 |
if ( wppa_onpage( 'thumbs', $counter_thumbs, $relpage ) ) {
|
@@ -145,20 +145,20 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
145 |
$didsome = true;
|
146 |
}
|
147 |
}
|
148 |
-
|
149 |
// Find longest column
|
150 |
$long = 0;
|
151 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
152 |
if ( $col_heights[$col] > $long ) $long = $col_heights[$col];
|
153 |
}
|
154 |
-
|
155 |
// Adjust column widths to resize lengths to equal lengths
|
156 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
157 |
if ( $col_heights[$col] ) {
|
158 |
$col_widths[$col] = $long / $col_heights[$col] * $col_widths[$col];
|
159 |
}
|
160 |
}
|
161 |
-
|
162 |
// Adjust column widths to total 100
|
163 |
$wide = 0;
|
164 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
@@ -166,20 +166,20 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
166 |
}
|
167 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
168 |
$col_widths[$col] = $col_widths[$col] * 100 / $wide;
|
169 |
-
}
|
170 |
-
|
171 |
// Make column headers
|
172 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
173 |
$col_headers[$col] = '<td style="width: '.$col_widths[$col].'%; vertical-align:top;" class="wppa-masonry" >';
|
174 |
}
|
175 |
-
|
176 |
// Add the columns to the output stream
|
177 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
178 |
wppa_out( $col_headers[$col] );
|
179 |
wppa_out( $col_contents[$col] );
|
180 |
wppa_out( '</td>' );
|
181 |
}
|
182 |
-
|
183 |
// Close the table
|
184 |
wppa_out( '</tr></tbody></table>' );
|
185 |
|
@@ -188,16 +188,16 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
188 |
wppa_album_desc( 'bottom' ); // Optionally display album description
|
189 |
wppa_thumb_area( 'close' ); // Close Thumbarea sub-container
|
190 |
} // Masonry-v
|
191 |
-
|
192 |
// Masonry horizontal
|
193 |
elseif ( wppa_opt( 'thumbtype' ) == 'masonry-h' ) { // Masonry
|
194 |
-
|
195 |
// The header
|
196 |
wppa_thumb_area( 'open' ); // Open Thumbarea sub-container
|
197 |
wppa_popup(); // Prepare Popup box
|
198 |
wppa_album_name( 'top' ); // Optionally display album name
|
199 |
wppa_album_desc( 'top' ); // Optionally display album description
|
200 |
-
|
201 |
// Init
|
202 |
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
203 |
$cont_width = wppa_get_container_width( 'netto' );
|
@@ -205,7 +205,7 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
205 |
|
206 |
// Init the table
|
207 |
wppa_out( '<table class="wppa-masonry wppa-masonry-h" style="margin-top:3px;" ><tbody class="wppa-masonry" >' );
|
208 |
-
|
209 |
// Process the thumbnails
|
210 |
$row_content = '';
|
211 |
$row_width = 0;
|
@@ -215,7 +215,7 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
215 |
$done_count = 0;
|
216 |
$last = false;
|
217 |
$max_row_height = $target_row_height * 0.8; // Init keep track for last
|
218 |
-
if ( $thumbs ) foreach ( $thumbs as $tt ) {
|
219 |
$id = $tt['id'];
|
220 |
$counter_thumbs++;
|
221 |
if ( wppa_onpage( 'thumbs', $counter_thumbs, $relpage ) ) {
|
@@ -262,21 +262,21 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
262 |
'wppaSetMasHorFrameWidthsForIeAndChrome(' . wppa( 'mocc' ) . ');' .
|
263 |
'</script>' );
|
264 |
wppa_thumb_area( 'close' ); // Close Thumbarea sub-container
|
265 |
-
|
266 |
} // Masonry-h
|
267 |
-
|
268 |
// Default
|
269 |
elseif ( wppa_opt( 'thumbtype' ) == 'default' ) { // Do the thumbs As default
|
270 |
-
|
271 |
// The header
|
272 |
wppa_thumb_area( 'open' ); // Open Thumbarea sub-container
|
273 |
wppa_popup(); // Prepare Popup box
|
274 |
wppa_album_name( 'top' ); // Optionally display album name
|
275 |
wppa_album_desc( 'top' ); // Optionally display album description
|
276 |
-
|
277 |
// Init
|
278 |
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
279 |
-
|
280 |
// Process the thumbnails
|
281 |
if ( $thumbs ) foreach ( $thumbs as $tt ) {
|
282 |
$counter_thumbs++;
|
@@ -285,13 +285,13 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
285 |
wppa_thumb_default( $tt['id'] ); // Show Thumb as default
|
286 |
} // End if on page
|
287 |
}
|
288 |
-
|
289 |
// The footer
|
290 |
wppa_album_name( 'bottom' ); // Optionally display album name
|
291 |
wppa_album_desc( 'bottom' ); // Optionally display album description
|
292 |
wppa_thumb_area( 'close' ); // Close Thumbarea sub-container
|
293 |
} // As default
|
294 |
-
|
295 |
// Unimplemented thumbnail type
|
296 |
else {
|
297 |
wppa_out( 'Unimplemented thumbnail type' );
|
@@ -303,7 +303,7 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
303 |
|
304 |
// Process the albums
|
305 |
if ( wppa_switch( 'thumbs_first' ) ) {
|
306 |
-
if ( $albums ) {
|
307 |
$counter_albums = '0';
|
308 |
wppa_album_list( 'open' ); // Open Albums sub-container
|
309 |
foreach ( $albums as $album ) { // Loop the albums
|
@@ -316,12 +316,12 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
316 |
wppa_album_list( 'close' ); // Close Albums sub-container
|
317 |
} // If albums
|
318 |
}
|
319 |
-
|
320 |
// Make pagelinkbar if requested on bottom
|
321 |
if ( wppa_opt( 'pagelink_pos' ) == 'bottom' || wppa_opt( 'pagelink_pos' ) == 'both' ) {
|
322 |
wppa_page_links( $totpag, $curpage );
|
323 |
}
|
324 |
-
|
325 |
// Empty results?
|
326 |
if ( ! $didsome && ! $wanted_empty ) {
|
327 |
if ( wppa( 'photos_only' ) ) {
|
@@ -335,7 +335,7 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
335 |
}
|
336 |
}
|
337 |
} // wppa_page( 'albums' )
|
338 |
-
|
339 |
elseif ( wppa_page( 'slide' ) || wppa_page( 'single' ) ) { // Page 'Slideshow' or 'Single' in browsemode requested
|
340 |
$thumbs = wppa_get_thumbs();
|
341 |
wppa_dbg_msg( 'From theme: #thumbs='.( $thumbs ? count( $thumbs ) : '0' ) );
|
@@ -347,7 +347,7 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
347 |
wppa_out( wppa_errorbox( __( 'No photos found matching your search criteria.', 'wppa_theme' , 'wp-photo-album-plus') ) );
|
348 |
}
|
349 |
} // wppa_page( 'slide' )
|
350 |
-
|
351 |
// Close container
|
352 |
wppa_container( 'close' );
|
353 |
}
|
@@ -359,10 +359,10 @@ function wppa_is_wanted_empty( $thumbs ) {
|
|
359 |
if ( wppa_is_virtual() ) return false; // wanted empty only on real albums
|
360 |
if ( ! wppa_is_int( wppa( 'start_album' ) ) ) return false; // Only seingle albums, no enumerations
|
361 |
if ( wppa( 'albums_only' ) ) return false; // Explicitly no thumbs
|
362 |
-
|
363 |
// if ( wppa_switch( 'thumbs_first' ) && wppa_get_curpage() != '1' ) return false; // Only on page 1 if thumbs first
|
364 |
-
|
365 |
wppa( 'current_album', wppa( 'start_album' ) ); // Make sure upload knows the album
|
366 |
-
|
367 |
return true;
|
368 |
}
|
1 |
+
<?php
|
2 |
/* wppa_theme.php
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the albums/photos/slideshow in a page or post
|
6 |
+
* Version 6.8.00
|
7 |
*/
|
8 |
function wppa_theme() {
|
9 |
|
10 |
+
global $wppa_version; $wppa_version = '6-8-00-002'; // The version number of this file
|
11 |
global $wppa;
|
12 |
global $wppa_show_statistics; // Can be set to true by a custom page template
|
13 |
|
18 |
|
19 |
// Open container
|
20 |
wppa_container( 'open' );
|
21 |
+
|
22 |
// Show statistics if set so by the page template
|
23 |
+
if ( $wppa_show_statistics ) wppa_statistics();
|
24 |
|
25 |
// Display breadcrumb navigation only if it is set in the settings page
|
26 |
+
wppa_breadcrumb( 'optional' );
|
27 |
+
|
28 |
|
|
|
29 |
if ( wppa_page( 'albums' ) ) { // Page 'Albums' requested
|
30 |
+
|
31 |
// Init for possible alt thumbsize on masonry
|
32 |
$counter_thumbs = '0';
|
33 |
$is_alt_thumbsize = false;
|
35 |
if ( wppa_is_int( $alb_id ) && $alb_id > '0' ) {
|
36 |
$is_alt_thumbsize = wppa_get_album_item( $alb_id, 'alt_thumbsize' ) == 'yes';
|
37 |
}
|
38 |
+
|
39 |
// Get the albums and the thumbs and the number of pages for each set
|
40 |
$albums = wppa_get_albums(); // Get the albums
|
41 |
$n_album_pages = wppa_get_npages( 'albums', $albums ); // Get the number of album pages
|
42 |
+
|
43 |
if ( wppa_opt( 'thumbtype' ) != 'none' ) {
|
44 |
$thumbs = wppa_get_thumbs(); // Get the Thumbs
|
45 |
} else $thumbs = false;
|
46 |
+
|
47 |
$wanted_empty = wppa_is_wanted_empty( $thumbs ); // See if we need to display an empty thumbnail area
|
48 |
|
49 |
$n_thumb_pages = wppa_get_npages( 'thumbs', $thumbs ); // Get the number of thumb pages
|
52 |
|
53 |
// Get total number of pages
|
54 |
if ( ! wppa_is_pagination() ) $totpag = '1'; // If both pagination is off, there is only one page
|
55 |
+
else $totpag = $n_album_pages + $n_thumb_pages;
|
56 |
|
57 |
// Make pagelinkbar if requested on top
|
58 |
if ( wppa_opt( 'pagelink_pos' ) == 'top' || wppa_opt( 'pagelink_pos' ) == 'both' ) {
|
59 |
wppa_page_links( $totpag, $curpage );
|
60 |
}
|
61 |
+
|
62 |
// Process the albums
|
63 |
if ( ! wppa_switch( 'thumbs_first' ) ) {
|
64 |
+
if ( $albums ) {
|
65 |
$counter_albums = '0';
|
66 |
wppa_album_list( 'open' ); // Open Albums sub-container
|
67 |
foreach ( $albums as $album ) { // Loop the albums
|
74 |
wppa_album_list( 'close' ); // Close Albums sub-container
|
75 |
} // If albums
|
76 |
}
|
77 |
+
|
78 |
if ( $didsome && wppa_is_pagination() ) $thumbs = false; // Pag on and didsome: force a pagebreak by faking no thumbs
|
79 |
+
if ( is_array( $thumbs ) && count( $thumbs ) <= wppa_get_mincount() && ! $wanted_empty ) $thumbs = false; // Less than treshold value
|
80 |
if ( wppa_switch( 'thumbs_first' ) && $curpage > $n_thumb_pages ) $thumbs = false; // If thumbs done, do not display an empty thumbarea
|
81 |
+
|
82 |
// Process the thumbs
|
83 |
+
if ( $thumbs || $wanted_empty )
|
84 |
+
if ( ! $wanted_empty || ! wppa_switch( 'thumbs_first' ) || wppa_get_curpage() == '1' )
|
85 |
if ( ! $wanted_empty || wppa_switch( 'thumbs_first' ) || wppa_get_curpage() == $totpag ) {
|
86 |
+
|
87 |
// As covers
|
88 |
+
if ( wppa_opt( 'thumbtype' ) == 'ascovers' ||
|
89 |
wppa_opt( 'thumbtype' ) == 'ascovers-mcr' ) { // Do the thumbs As covers
|
90 |
wppa_thumb_list( 'open' ); // Open Thumblist sub-container
|
91 |
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
95 |
$didsome = true;
|
96 |
wppa_thumb_ascover( $thumb['id'] ); // Show Thumb as cover
|
97 |
} // End if on page
|
98 |
+
endforeach;
|
99 |
wppa_thumb_list( 'close' ); // Close Thumblist sub-container
|
100 |
} // As covers
|
101 |
|
102 |
// Masonry vertical
|
103 |
elseif ( wppa_opt( 'thumbtype' ) == 'masonry-v' ) { // Masonry
|
104 |
+
|
105 |
// The header
|
106 |
wppa_thumb_area( 'open' ); // Open Thumbarea sub-container
|
107 |
wppa_popup(); // Prepare Popup box
|
108 |
wppa_album_name( 'top' ); // Optionally display album name
|
109 |
wppa_album_desc( 'top' ); // Optionally display album description
|
110 |
+
|
111 |
// Init
|
112 |
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
113 |
$cont_width = wppa_get_container_width();
|
114 |
$count_cols = ceil( $cont_width / ( wppa_opt( $is_alt_thumbsize ? 'thumbsize_alt' : 'thumbsize' ) + wppa_opt( 'tn_margin' ) ) );
|
115 |
$correction = wppa_opt( 'tn_margin' ) * ( $cont_width / $count_cols ) / 100;
|
116 |
+
|
117 |
// Init the table
|
118 |
wppa_out( '<table class="wppa-masonry" style="margin-top:3px;" ><tbody class="wppa-masonry" ><tr class="wppa-masonry" >' );
|
119 |
+
|
120 |
// Init the columns
|
121 |
$col_headers = array();
|
122 |
$col_contents = array();
|
123 |
$col_heights = array();
|
124 |
$col_widths = array();
|
125 |
+
|
126 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
127 |
$col_headers[$col] = '';
|
128 |
$col_contents[$col] = '';
|
132 |
|
133 |
// Process the thumbnails
|
134 |
$col = '0';
|
135 |
+
if ( $thumbs ) foreach ( $thumbs as $tt ) {
|
136 |
$id = $tt['id'];
|
137 |
$counter_thumbs++;
|
138 |
if ( wppa_onpage( 'thumbs', $counter_thumbs, $relpage ) ) {
|
145 |
$didsome = true;
|
146 |
}
|
147 |
}
|
148 |
+
|
149 |
// Find longest column
|
150 |
$long = 0;
|
151 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
152 |
if ( $col_heights[$col] > $long ) $long = $col_heights[$col];
|
153 |
}
|
154 |
+
|
155 |
// Adjust column widths to resize lengths to equal lengths
|
156 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
157 |
if ( $col_heights[$col] ) {
|
158 |
$col_widths[$col] = $long / $col_heights[$col] * $col_widths[$col];
|
159 |
}
|
160 |
}
|
161 |
+
|
162 |
// Adjust column widths to total 100
|
163 |
$wide = 0;
|
164 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
166 |
}
|
167 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
168 |
$col_widths[$col] = $col_widths[$col] * 100 / $wide;
|
169 |
+
}
|
170 |
+
|
171 |
// Make column headers
|
172 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
173 |
$col_headers[$col] = '<td style="width: '.$col_widths[$col].'%; vertical-align:top;" class="wppa-masonry" >';
|
174 |
}
|
175 |
+
|
176 |
// Add the columns to the output stream
|
177 |
for ( $col = 0; $col < $count_cols; $col++ ) {
|
178 |
wppa_out( $col_headers[$col] );
|
179 |
wppa_out( $col_contents[$col] );
|
180 |
wppa_out( '</td>' );
|
181 |
}
|
182 |
+
|
183 |
// Close the table
|
184 |
wppa_out( '</tr></tbody></table>' );
|
185 |
|
188 |
wppa_album_desc( 'bottom' ); // Optionally display album description
|
189 |
wppa_thumb_area( 'close' ); // Close Thumbarea sub-container
|
190 |
} // Masonry-v
|
191 |
+
|
192 |
// Masonry horizontal
|
193 |
elseif ( wppa_opt( 'thumbtype' ) == 'masonry-h' ) { // Masonry
|
194 |
+
|
195 |
// The header
|
196 |
wppa_thumb_area( 'open' ); // Open Thumbarea sub-container
|
197 |
wppa_popup(); // Prepare Popup box
|
198 |
wppa_album_name( 'top' ); // Optionally display album name
|
199 |
wppa_album_desc( 'top' ); // Optionally display album description
|
200 |
+
|
201 |
// Init
|
202 |
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
203 |
$cont_width = wppa_get_container_width( 'netto' );
|
205 |
|
206 |
// Init the table
|
207 |
wppa_out( '<table class="wppa-masonry wppa-masonry-h" style="margin-top:3px;" ><tbody class="wppa-masonry" >' );
|
208 |
+
|
209 |
// Process the thumbnails
|
210 |
$row_content = '';
|
211 |
$row_width = 0;
|
215 |
$done_count = 0;
|
216 |
$last = false;
|
217 |
$max_row_height = $target_row_height * 0.8; // Init keep track for last
|
218 |
+
if ( $thumbs ) foreach ( $thumbs as $tt ) {
|
219 |
$id = $tt['id'];
|
220 |
$counter_thumbs++;
|
221 |
if ( wppa_onpage( 'thumbs', $counter_thumbs, $relpage ) ) {
|
262 |
'wppaSetMasHorFrameWidthsForIeAndChrome(' . wppa( 'mocc' ) . ');' .
|
263 |
'</script>' );
|
264 |
wppa_thumb_area( 'close' ); // Close Thumbarea sub-container
|
265 |
+
|
266 |
} // Masonry-h
|
267 |
+
|
268 |
// Default
|
269 |
elseif ( wppa_opt( 'thumbtype' ) == 'default' ) { // Do the thumbs As default
|
270 |
+
|
271 |
// The header
|
272 |
wppa_thumb_area( 'open' ); // Open Thumbarea sub-container
|
273 |
wppa_popup(); // Prepare Popup box
|
274 |
wppa_album_name( 'top' ); // Optionally display album name
|
275 |
wppa_album_desc( 'top' ); // Optionally display album description
|
276 |
+
|
277 |
// Init
|
278 |
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
279 |
+
|
280 |
// Process the thumbnails
|
281 |
if ( $thumbs ) foreach ( $thumbs as $tt ) {
|
282 |
$counter_thumbs++;
|
285 |
wppa_thumb_default( $tt['id'] ); // Show Thumb as default
|
286 |
} // End if on page
|
287 |
}
|
288 |
+
|
289 |
// The footer
|
290 |
wppa_album_name( 'bottom' ); // Optionally display album name
|
291 |
wppa_album_desc( 'bottom' ); // Optionally display album description
|
292 |
wppa_thumb_area( 'close' ); // Close Thumbarea sub-container
|
293 |
} // As default
|
294 |
+
|
295 |
// Unimplemented thumbnail type
|
296 |
else {
|
297 |
wppa_out( 'Unimplemented thumbnail type' );
|
303 |
|
304 |
// Process the albums
|
305 |
if ( wppa_switch( 'thumbs_first' ) ) {
|
306 |
+
if ( $albums ) {
|
307 |
$counter_albums = '0';
|
308 |
wppa_album_list( 'open' ); // Open Albums sub-container
|
309 |
foreach ( $albums as $album ) { // Loop the albums
|
316 |
wppa_album_list( 'close' ); // Close Albums sub-container
|
317 |
} // If albums
|
318 |
}
|
319 |
+
|
320 |
// Make pagelinkbar if requested on bottom
|
321 |
if ( wppa_opt( 'pagelink_pos' ) == 'bottom' || wppa_opt( 'pagelink_pos' ) == 'both' ) {
|
322 |
wppa_page_links( $totpag, $curpage );
|
323 |
}
|
324 |
+
|
325 |
// Empty results?
|
326 |
if ( ! $didsome && ! $wanted_empty ) {
|
327 |
if ( wppa( 'photos_only' ) ) {
|
335 |
}
|
336 |
}
|
337 |
} // wppa_page( 'albums' )
|
338 |
+
|
339 |
elseif ( wppa_page( 'slide' ) || wppa_page( 'single' ) ) { // Page 'Slideshow' or 'Single' in browsemode requested
|
340 |
$thumbs = wppa_get_thumbs();
|
341 |
wppa_dbg_msg( 'From theme: #thumbs='.( $thumbs ? count( $thumbs ) : '0' ) );
|
347 |
wppa_out( wppa_errorbox( __( 'No photos found matching your search criteria.', 'wppa_theme' , 'wp-photo-album-plus') ) );
|
348 |
}
|
349 |
} // wppa_page( 'slide' )
|
350 |
+
|
351 |
// Close container
|
352 |
wppa_container( 'close' );
|
353 |
}
|
359 |
if ( wppa_is_virtual() ) return false; // wanted empty only on real albums
|
360 |
if ( ! wppa_is_int( wppa( 'start_album' ) ) ) return false; // Only seingle albums, no enumerations
|
361 |
if ( wppa( 'albums_only' ) ) return false; // Explicitly no thumbs
|
362 |
+
|
363 |
// if ( wppa_switch( 'thumbs_first' ) && wppa_get_curpage() != '1' ) return false; // Only on page 1 if thumbs first
|
364 |
+
|
365 |
wppa( 'current_album', wppa( 'start_album' ) ); // Make sure upload knows the album
|
366 |
+
|
367 |
return true;
|
368 |
}
|
wppa-admin-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* gp admin functions
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -345,7 +345,7 @@ global $wpdb;
|
|
345 |
|
346 |
$exiflines = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `".WPPA_EXIF."` WHERE `photo` = %s", $fromphoto ), ARRAY_A );
|
347 |
if ( $exiflines ) foreach ( $exiflines as $line ) {
|
348 |
-
$
|
349 |
}
|
350 |
}
|
351 |
function wppa_copy_iptc( $fromphoto, $tophoto ) {
|
@@ -353,7 +353,7 @@ global $wpdb;
|
|
353 |
|
354 |
$iptclines = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `".WPPA_IPTC."` WHERE `photo` = %s", $fromphoto ), ARRAY_A );
|
355 |
if ( $iptclines ) foreach ( $iptclines as $line ) {
|
356 |
-
$
|
357 |
}
|
358 |
}
|
359 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* gp admin functions
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
345 |
|
346 |
$exiflines = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `".WPPA_EXIF."` WHERE `photo` = %s", $fromphoto ), ARRAY_A );
|
347 |
if ( $exiflines ) foreach ( $exiflines as $line ) {
|
348 |
+
$bret = wppa_create_exif_entry( array( 'photo' => $tophoto, 'tag' => $line['tag'], 'description' => $line['description'], 'status' => $line['status'] ) );
|
349 |
}
|
350 |
}
|
351 |
function wppa_copy_iptc( $fromphoto, $tophoto ) {
|
353 |
|
354 |
$iptclines = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `".WPPA_IPTC."` WHERE `photo` = %s", $fromphoto ), ARRAY_A );
|
355 |
if ( $iptclines ) foreach ( $iptclines as $line ) {
|
356 |
+
$bret = wppa_create_iptc_entry( array( 'photo' => $tophoto, 'tag' => $line['tag'], 'description' => $line['description'], 'status' => $line['status'] ) );
|
357 |
}
|
358 |
}
|
359 |
|
wppa-admin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains the admin menu and startups the admin pages
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -59,7 +59,7 @@ function wppa_add_admin() {
|
|
59 |
add_submenu_page( 'wppa_admin_menu', __('Album Admin', 'wp-photo-album-plus'), __('Album Admin', 'wp-photo-album-plus').$upl_pending,'wppa_admin', 'wppa_admin_menu', 'wppa_admin' );
|
60 |
add_submenu_page( 'wppa_admin_menu', __('Upload Photos', 'wp-photo-album-plus'), __('Upload Photos', 'wp-photo-album-plus'), 'wppa_upload', 'wppa_upload_photos', 'wppa_page_upload' );
|
61 |
// Uploader without album admin rights, but when the upload_edit switch set, may edit his own photos
|
62 |
-
if ( ! current_user_can('wppa_admin') && wppa_opt( 'upload_edit') != 'none' ) {
|
63 |
add_submenu_page( 'wppa_admin_menu', __('Edit Photos', 'wp-photo-album-plus'), __('Edit Photos', 'wp-photo-album-plus'), 'wppa_upload', 'wppa_edit_photo', 'wppa_edit_photo' );
|
64 |
}
|
65 |
add_submenu_page( 'wppa_admin_menu', __('Import Photos', 'wp-photo-album-plus'), __('Import Photos', 'wp-photo-album-plus'), 'wppa_import', 'wppa_import_photos', 'wppa_page_import' );
|
@@ -90,7 +90,12 @@ function wppa_admin_scripts() {
|
|
90 |
global $wppa_api_version;
|
91 |
wp_register_script( 'wppa_upload_script', WPPA_URL.'/js/wppa-multifile-compressed.js', '', $wppa_api_version );
|
92 |
wp_enqueue_script( 'wppa_upload_script' );
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
94 |
wp_enqueue_script( 'wppa_admin_script' );
|
95 |
wp_enqueue_script( 'jquery' );
|
96 |
wp_enqueue_script( 'jquery-ui-sortable' );
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains the admin menu and startups the admin pages
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
59 |
add_submenu_page( 'wppa_admin_menu', __('Album Admin', 'wp-photo-album-plus'), __('Album Admin', 'wp-photo-album-plus').$upl_pending,'wppa_admin', 'wppa_admin_menu', 'wppa_admin' );
|
60 |
add_submenu_page( 'wppa_admin_menu', __('Upload Photos', 'wp-photo-album-plus'), __('Upload Photos', 'wp-photo-album-plus'), 'wppa_upload', 'wppa_upload_photos', 'wppa_page_upload' );
|
61 |
// Uploader without album admin rights, but when the upload_edit switch set, may edit his own photos
|
62 |
+
if ( ! current_user_can('wppa_admin') && wppa_opt( 'upload_edit') != '-none-' ) {
|
63 |
add_submenu_page( 'wppa_admin_menu', __('Edit Photos', 'wp-photo-album-plus'), __('Edit Photos', 'wp-photo-album-plus'), 'wppa_upload', 'wppa_edit_photo', 'wppa_edit_photo' );
|
64 |
}
|
65 |
add_submenu_page( 'wppa_admin_menu', __('Import Photos', 'wp-photo-album-plus'), __('Import Photos', 'wp-photo-album-plus'), 'wppa_import', 'wppa_import_photos', 'wppa_page_import' );
|
90 |
global $wppa_api_version;
|
91 |
wp_register_script( 'wppa_upload_script', WPPA_URL.'/js/wppa-multifile-compressed.js', '', $wppa_api_version );
|
92 |
wp_enqueue_script( 'wppa_upload_script' );
|
93 |
+
if ( is_file( WPPA_PATH.'/js/wppa-admin-scripts.min.js' ) ) {
|
94 |
+
wp_register_script( 'wppa_admin_script', WPPA_URL.'/js/wppa-admin-scripts.min.js', '', $wppa_api_version );
|
95 |
+
}
|
96 |
+
else {
|
97 |
+
wp_register_script( 'wppa_admin_script', WPPA_URL.'/js/wppa-admin-scripts.js', '', $wppa_api_version );
|
98 |
+
}
|
99 |
wp_enqueue_script( 'wppa_admin_script' );
|
100 |
wp_enqueue_script( 'jquery' );
|
101 |
wp_enqueue_script( 'jquery-ui-sortable' );
|
wppa-ajax.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
-
* Version 6.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -99,7 +99,7 @@ global $wppa_log_file;
|
|
99 |
}
|
100 |
}
|
101 |
}
|
102 |
-
$iptcdata = $wpdb->get_results( $wpdb->prepare( "SELECT
|
103 |
$last = '';
|
104 |
$any = false;
|
105 |
if ( is_array( $iptcdata ) ) foreach( $iptcdata as $item ) {
|
@@ -122,7 +122,7 @@ global $wppa_log_file;
|
|
122 |
}
|
123 |
}
|
124 |
if ( ! $any ) {
|
125 |
-
$query = $wpdb->prepare( "
|
126 |
$wpdb->query( $query );
|
127 |
// wppa_log( 'dbg', $query );
|
128 |
}
|
@@ -130,9 +130,11 @@ global $wppa_log_file;
|
|
130 |
break;
|
131 |
|
132 |
case 'getssexiflist':
|
133 |
-
$tag = str_replace( 'H', '#', $_REQUEST['tag'] );
|
|
|
134 |
$mocc = $_REQUEST['moccur'];
|
135 |
$oldvalue = '';
|
|
|
136 |
if ( strpos( $wppa_session['supersearch'], ',' ) !== false ) {
|
137 |
$ss_data = explode( ',', $wppa_session['supersearch'] );
|
138 |
if ( count( $ss_data ) == '4' ) {
|
@@ -145,16 +147,114 @@ global $wppa_log_file;
|
|
145 |
}
|
146 |
}
|
147 |
}
|
148 |
-
|
149 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
$any = false;
|
151 |
-
if (
|
152 |
-
$desc = sanitize_text_field( $item['
|
153 |
$desc = str_replace( array(chr(0),chr(1),chr(2),chr(3),chr(4),chr(5),chr(6),chr(7)), '', $desc );
|
154 |
|
155 |
-
if ( $desc
|
|
|
156 |
$sel = ( $oldvalue && $oldvalue == $desc ) ? 'selected="selected"' : '';
|
157 |
$ddesc = strlen( $desc ) > '32' ? substr( $desc, 0, 30 ) . '...' : $desc;
|
|
|
158 |
echo '<option' .
|
159 |
' value="' . esc_attr( $desc ) . '"' .
|
160 |
' class="wppa-exiflist-' . $mocc . '"' .
|
@@ -162,14 +262,14 @@ global $wppa_log_file;
|
|
162 |
' >' .
|
163 |
$ddesc .
|
164 |
'</option>';
|
165 |
-
$last = $desc;
|
166 |
$any = true;
|
167 |
}
|
168 |
}
|
|
|
|
|
169 |
if ( ! $any ) {
|
170 |
-
$query = $wpdb->prepare( "
|
171 |
$wpdb->query( $query );
|
172 |
-
// wppa_log( 'dbg', $query );
|
173 |
}
|
174 |
wppa_exit();
|
175 |
break;
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
+
* Version 6.8.00
|
6 |
*
|
7 |
*/
|
8 |
|
99 |
}
|
100 |
}
|
101 |
}
|
102 |
+
$iptcdata = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT `description` FROM `" . WPPA_IPTC ."` WHERE `photo` > '0' AND `tag` = %s ORDER BY `description`", $tag ), ARRAY_A );
|
103 |
$last = '';
|
104 |
$any = false;
|
105 |
if ( is_array( $iptcdata ) ) foreach( $iptcdata as $item ) {
|
122 |
}
|
123 |
}
|
124 |
if ( ! $any ) {
|
125 |
+
$query = $wpdb->prepare( "UPDATE `" . WPPA_IPTC . "` SET `status` = 'hide' WHERE `photo` = '0' AND `tag` = %s", $tag );
|
126 |
$wpdb->query( $query );
|
127 |
// wppa_log( 'dbg', $query );
|
128 |
}
|
130 |
break;
|
131 |
|
132 |
case 'getssexiflist':
|
133 |
+
$tag = str_replace( 'H', '#', substr( $_REQUEST['tag'], 0, 6 ) );
|
134 |
+
$brand = substr( $_REQUEST['tag'], 6 );
|
135 |
$mocc = $_REQUEST['moccur'];
|
136 |
$oldvalue = '';
|
137 |
+
|
138 |
if ( strpos( $wppa_session['supersearch'], ',' ) !== false ) {
|
139 |
$ss_data = explode( ',', $wppa_session['supersearch'] );
|
140 |
if ( count( $ss_data ) == '4' ) {
|
147 |
}
|
148 |
}
|
149 |
}
|
150 |
+
|
151 |
+
if ( $brand ) {
|
152 |
+
$exifdata = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT `f_description` " .
|
153 |
+
"FROM `" . WPPA_EXIF ."` " .
|
154 |
+
"WHERE `photo` > '0' " .
|
155 |
+
"AND `tag` = %s " .
|
156 |
+
"AND `brand` = %s " .
|
157 |
+
"AND `f_description` <> %s " .
|
158 |
+
"AND `f_description` <> '' " .
|
159 |
+
"ORDER BY `f_description`", $tag, $brand, __( 'n.a.', 'wp-photo-album-plus' ) ), ARRAY_A );
|
160 |
+
}
|
161 |
+
else {
|
162 |
+
$exifdata = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT `f_description` " .
|
163 |
+
"FROM `" . WPPA_EXIF ."` " .
|
164 |
+
"WHERE `photo` > '0' " .
|
165 |
+
"AND `tag` = %s " .
|
166 |
+
"AND `f_description` <> %s " .
|
167 |
+
"AND `f_description` <> '' " .
|
168 |
+
"ORDER BY `f_description`", $tag, __( 'n.a.', 'wp-photo-album-plus' ) ), ARRAY_A );
|
169 |
+
}
|
170 |
+
|
171 |
+
// Some exif data need sorting in a human understandable logical way.
|
172 |
+
switch ( $tag ) {
|
173 |
+
/*
|
174 |
+
// FNumber
|
175 |
+
case 'E#829D':
|
176 |
+
|
177 |
+
foreach ( array_keys( $exifdata ) as $key ) {
|
178 |
+
$temp = $exifdata[$key]['f_description'];
|
179 |
+
if ( strpos( $temp, '.' ) === false ) { // If int, append .0
|
180 |
+
$temp .= '.0';
|
181 |
+
}
|
182 |
+
$temp = substr( $temp, 2 ); // Strip 'f/'
|
183 |
+
while ( strlen( $temp ) < 5 ) { // Add leading 0's
|
184 |
+
$temp = '0' . $temp;
|
185 |
+
}
|
186 |
+
$exifdata[$key]['sort'] = $temp;
|
187 |
+
}
|
188 |
+
|
189 |
+
$exifdata = wppa_array_sort( $exifdata, 'sort' );
|
190 |
+
break;
|
191 |
+
|
192 |
+
// Subject distance
|
193 |
+
case 'E#9206':
|
194 |
+
|
195 |
+
foreach ( array_keys( $exifdata ) as $key ) {
|
196 |
+
$temp = $exifdata[$key]['f_description'];
|
197 |
+
$temp = rtrim( $temp, ' m.' );
|
198 |
+
if ( strpos( $temp, '.' ) === false ) { // If int, append .0
|
199 |
+
$temp .= '.0';
|
200 |
+
}
|
201 |
+
while ( strlen( substr( $temp, strpos( $temp, '.' ) ) ) < 2 ) { // Make sure 2 decimal digits
|
202 |
+
$temp .= '0';
|
203 |
+
}
|
204 |
+
while ( strlen( $temp ) < 8 ) {
|
205 |
+
$temp = '0' . $temp; // Add leading 0's
|
206 |
+
}
|
207 |
+
$exifdata[$key]['sort'] = $temp;
|
208 |
+
}
|
209 |
+
|
210 |
+
$exifdata = wppa_array_sort( $exifdata, 'sort' );
|
211 |
+
break;
|
212 |
+
*/
|
213 |
+
// Numerical values
|
214 |
+
case 'E#0102': // BitsPerSample
|
215 |
+
case 'E#829A': // ExposureTime
|
216 |
+
case 'E#829D': // FNumber
|
217 |
+
case 'E#9202': // ApertureValue
|
218 |
+
case 'E#9203': // BrightnessValue
|
219 |
+
case 'E#9206': // SubjectDistance
|
220 |
+
case 'E#920A': // FocalLength
|
221 |
+
case 'E#A405': // FocalLengthIn35mmFilm
|
222 |
+
|
223 |
+
foreach ( array_keys( $exifdata ) as $key ) {
|
224 |
+
$temp = $exifdata[$key]['f_description'];
|
225 |
+
if ( $temp != __( 'n.a.', 'wp-photo-album-plus' ) ) {
|
226 |
+
$temp = trim( $temp, ' smf/.' );
|
227 |
+
if ( strpos( $temp, '/' ) ) {
|
228 |
+
$temp = explode( '/', $temp );
|
229 |
+
if ( $temp[1] != 0 ) {
|
230 |
+
$temp = $temp[0] / $temp[1];
|
231 |
+
}
|
232 |
+
else {
|
233 |
+
$temp = 999999;
|
234 |
+
}
|
235 |
+
}
|
236 |
+
$exifdata[$key]['sort'] = sprintf( '%020.12f', $temp );
|
237 |
+
}
|
238 |
+
else {
|
239 |
+
$exifdata[$key]['sort'] = $temp;
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
$exifdata = wppa_array_sort( $exifdata, 'sort' );
|
244 |
+
break;
|
245 |
+
}
|
246 |
+
|
247 |
+
|
248 |
$any = false;
|
249 |
+
if ( ! empty( $exifdata ) ) foreach( $exifdata as $item ) {
|
250 |
+
$desc = sanitize_text_field( $item['f_description'] );
|
251 |
$desc = str_replace( array(chr(0),chr(1),chr(2),chr(3),chr(4),chr(5),chr(6),chr(7)), '', $desc );
|
252 |
|
253 |
+
if ( $desc ) {
|
254 |
+
|
255 |
$sel = ( $oldvalue && $oldvalue == $desc ) ? 'selected="selected"' : '';
|
256 |
$ddesc = strlen( $desc ) > '32' ? substr( $desc, 0, 30 ) . '...' : $desc;
|
257 |
+
|
258 |
echo '<option' .
|
259 |
' value="' . esc_attr( $desc ) . '"' .
|
260 |
' class="wppa-exiflist-' . $mocc . '"' .
|
262 |
' >' .
|
263 |
$ddesc .
|
264 |
'</option>';
|
|
|
265 |
$any = true;
|
266 |
}
|
267 |
}
|
268 |
+
|
269 |
+
// Cleanup possible unused label
|
270 |
if ( ! $any ) {
|
271 |
+
$query = $wpdb->prepare( "UPDATE `" . WPPA_EXIF . "` SET `status` = 'hide' WHERE `photo` = '0' AND `tag` = %s", $tag );
|
272 |
$wpdb->query( $query );
|
|
|
273 |
}
|
274 |
wppa_exit();
|
275 |
break;
|
wppa-album-admin-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* create, edit and delete albums
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -444,11 +444,6 @@ function wppaTryScheduleAll( id ) {
|
|
444 |
__( 'Parent album:', 'wp-photo-album-plus' ) . ' ';
|
445 |
if ( wppa_extended_access() ) {
|
446 |
echo
|
447 |
-
// '<select' .
|
448 |
-
// ' id="wppa-parsel"' .
|
449 |
-
// ' style="max-width:500px;"' .
|
450 |
-
// ' onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'a_parent\', this )"' .
|
451 |
-
// ' >' .
|
452 |
wppa_album_select_a( array( 'checkaccess' => true,
|
453 |
'exclude' => $id,
|
454 |
'selected' => $a_parent,
|
@@ -468,14 +463,13 @@ function wppaTryScheduleAll( id ) {
|
|
468 |
'tagstyle' => 'font-size:13px;height:20px;cursor:pointer;',
|
469 |
)
|
470 |
);
|
471 |
-
|
472 |
-
// '</select>';
|
473 |
}
|
474 |
else {
|
475 |
echo
|
476 |
'<select' .
|
477 |
' id="wppa-parsel"' .
|
478 |
-
' style="max-width:
|
479 |
' onchange="wppaAjaxUpdateAlbum( '. $id . ', \'a_parent\', this )"' .
|
480 |
' >' .
|
481 |
wppa_album_select_a( array( 'checkaccess' => true,
|
@@ -2040,7 +2034,7 @@ function wppa_search_edit( $collapsible = false ) {
|
|
2040 |
|
2041 |
$doit = false;
|
2042 |
if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) $doit = true;
|
2043 |
-
if ( wppa_opt( 'upload_edit' ) != 'none' ) $doit = true;
|
2044 |
|
2045 |
if ( ! $doit ) return;
|
2046 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* create, edit and delete albums
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
444 |
__( 'Parent album:', 'wp-photo-album-plus' ) . ' ';
|
445 |
if ( wppa_extended_access() ) {
|
446 |
echo
|
|
|
|
|
|
|
|
|
|
|
447 |
wppa_album_select_a( array( 'checkaccess' => true,
|
448 |
'exclude' => $id,
|
449 |
'selected' => $a_parent,
|
463 |
'tagstyle' => 'font-size:13px;height:20px;cursor:pointer;',
|
464 |
)
|
465 |
);
|
466 |
+
'</select>';
|
|
|
467 |
}
|
468 |
else {
|
469 |
echo
|
470 |
'<select' .
|
471 |
' id="wppa-parsel"' .
|
472 |
+
' style="max-width:300px;"' .
|
473 |
' onchange="wppaAjaxUpdateAlbum( '. $id . ', \'a_parent\', this )"' .
|
474 |
' >' .
|
475 |
wppa_album_select_a( array( 'checkaccess' => true,
|
2034 |
|
2035 |
$doit = false;
|
2036 |
if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) $doit = true;
|
2037 |
+
if ( wppa_opt( 'upload_edit' ) != '-none-' ) $doit = true;
|
2038 |
|
2039 |
if ( ! $doit ) return;
|
2040 |
|
wppa-boxes-html.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -403,6 +403,7 @@ function wppa_supersearch_box() {
|
|
403 |
function wppa_get_supersearch_html() {
|
404 |
global $wpdb;
|
405 |
global $wppa_session;
|
|
|
406 |
|
407 |
// Init
|
408 |
$page = wppa_get_the_landing_page( 'supersearch_linkpage',
|
@@ -441,13 +442,47 @@ global $wppa_session;
|
|
441 |
$albumtxt = $wpdb->get_results( $query, ARRAY_A );
|
442 |
$query = "SELECT `slug` FROM `".WPPA_INDEX."` WHERE `photos` <> '' ORDER BY `slug`";
|
443 |
$phototxt = $wpdb->get_results( $query, ARRAY_A );
|
|
|
|
|
444 |
$iptclist = wppa_switch( 'save_iptc' ) ?
|
445 |
$wpdb->get_results( "SELECT `tag`, `description` FROM `" . WPPA_IPTC .
|
446 |
"` WHERE `photo` = '0' AND `status` <> 'hide' ", ARRAY_A ) : array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
447 |
$exiflist = wppa_switch( 'save_exif' ) ?
|
448 |
-
$wpdb->get_results( "SELECT `tag`, `description` FROM `" . WPPA_EXIF .
|
449 |
"` WHERE `photo` = '0' AND `status` <> 'hide' ", ARRAY_A ) : array();
|
450 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
451 |
// Check for empty albums
|
452 |
if ( wppa_switch( 'skip_empty_albums' ) ) {
|
453 |
$user = wppa_get_user();
|
@@ -886,15 +921,44 @@ global $wppa_session;
|
|
886 |
' size="' . min( count( $exiflist ), '6' ) . '"' .
|
887 |
' >';
|
888 |
$reftag = str_replace( 'H', '#', $ss_data['2'] );
|
|
|
|
|
|
|
889 |
foreach ( $exiflist as $item ) {
|
890 |
$tag = $item['tag'];
|
891 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
892 |
$result .=
|
893 |
'<option' .
|
894 |
' value="' . $tag . '"' .
|
895 |
( $sel ? ' selected="selected"' : '' ) .
|
896 |
' >' .
|
897 |
-
|
898 |
'</option>';
|
899 |
}
|
900 |
$result .=
|
@@ -3801,6 +3865,8 @@ global $wppa_exif_cache;
|
|
3801 |
|
3802 |
$count = 0;
|
3803 |
|
|
|
|
|
3804 |
// If in cache, use it
|
3805 |
$exifdata = false;
|
3806 |
if ( is_array( $wppa_exif_cache ) ) {
|
@@ -3867,7 +3933,7 @@ global $wppa_exif_cache;
|
|
3867 |
}
|
3868 |
|
3869 |
// if ( ! isset( $wppa_exifdefaults[$exifline['tag']] ) ) continue;
|
3870 |
-
$exifline['description'] = trim( $exifline['description'], "\x00..\x1F " );
|
3871 |
|
3872 |
// Photo status is hide ?
|
3873 |
if ( $exifline['status'] == 'hide' ) continue;
|
@@ -3876,7 +3942,7 @@ global $wppa_exif_cache;
|
|
3876 |
if ( $exifline['status'] == 'default' && $default == 'hide' ) continue;
|
3877 |
|
3878 |
// P s is default and default is optional and field is empty
|
3879 |
-
if ( $exifline['status'] == 'default' && $default == 'option' && ! $exifline['
|
3880 |
|
3881 |
$count++;
|
3882 |
$newtag = $exifline['tag'];
|
@@ -3887,10 +3953,14 @@ global $wppa_exif_cache;
|
|
3887 |
else {
|
3888 |
$result .= '<tr style="border-bottom:0 none; border-top:0 none; border-left: 0 none; border-right: 0 none;" >' .
|
3889 |
'<td class="wppa-exif-label wppa-box-text wppa-td" style="'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'" >';
|
|
|
|
|
|
|
3890 |
$result .= esc_js( __( $label ) );
|
|
|
3891 |
$result .= '</td><td class="wppa-exif-value wppa-box-text wppa-td" style="'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'" >';
|
3892 |
}
|
3893 |
-
$result .= esc_js(
|
3894 |
$oldtag = $newtag;
|
3895 |
}
|
3896 |
if ( $oldtag != '' ) $result .= '</td></tr>'; // Close last line
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
403 |
function wppa_get_supersearch_html() {
|
404 |
global $wpdb;
|
405 |
global $wppa_session;
|
406 |
+
global $wppa_supported_camara_brands;
|
407 |
|
408 |
// Init
|
409 |
$page = wppa_get_the_landing_page( 'supersearch_linkpage',
|
442 |
$albumtxt = $wpdb->get_results( $query, ARRAY_A );
|
443 |
$query = "SELECT `slug` FROM `".WPPA_INDEX."` WHERE `photos` <> '' ORDER BY `slug`";
|
444 |
$phototxt = $wpdb->get_results( $query, ARRAY_A );
|
445 |
+
|
446 |
+
// IPTC
|
447 |
$iptclist = wppa_switch( 'save_iptc' ) ?
|
448 |
$wpdb->get_results( "SELECT `tag`, `description` FROM `" . WPPA_IPTC .
|
449 |
"` WHERE `photo` = '0' AND `status` <> 'hide' ", ARRAY_A ) : array();
|
450 |
+
|
451 |
+
// Translate (for multilanguage qTranslate-able labels )
|
452 |
+
if ( ! empty( $iptclist ) ) {
|
453 |
+
foreach( array_keys( $iptclist ) as $idx ) {
|
454 |
+
$iptclist[$idx]['description'] = __( $iptclist[$idx]['description'] );
|
455 |
+
}
|
456 |
+
}
|
457 |
+
|
458 |
+
// Sort alphabetically
|
459 |
+
$iptclist = wppa_array_sort( $iptclist, 'description' );
|
460 |
+
|
461 |
+
// EXIF
|
462 |
$exiflist = wppa_switch( 'save_exif' ) ?
|
463 |
+
$wpdb->get_results( "SELECT `tag`, `description`, `status` FROM `" . WPPA_EXIF .
|
464 |
"` WHERE `photo` = '0' AND `status` <> 'hide' ", ARRAY_A ) : array();
|
465 |
|
466 |
+
// Translate (for multilanguage qTranslate-able labels), // or remove if no non-empty items
|
467 |
+
//echo serialize($exiflist);
|
468 |
+
if ( ! empty( $exiflist ) ) {
|
469 |
+
foreach( array_keys( $exiflist ) as $idx ) {
|
470 |
+
// $exists = $wpdb->get_var( $wpdb->prepare( "SELECT * FROM `" . WPPA_EXIF . "` " .
|
471 |
+
// "WHERE `photo` <> '0' " .
|
472 |
+
// "AND `tag` = %s " .
|
473 |
+
// "AND `description` <> '' LIMIT 1", $exiflist[$idx]['tag'] ) );
|
474 |
+
// if ( ! $exists ) {
|
475 |
+
// unset( $exiflist[$idx] );
|
476 |
+
// }
|
477 |
+
// else {
|
478 |
+
$exiflist[$idx]['description'] = __( $exiflist[$idx]['description'] );
|
479 |
+
// }
|
480 |
+
}
|
481 |
+
}
|
482 |
+
|
483 |
+
// Sort alphabetically
|
484 |
+
$exiflist = wppa_array_sort( $exiflist, 'description' );
|
485 |
+
|
486 |
// Check for empty albums
|
487 |
if ( wppa_switch( 'skip_empty_albums' ) ) {
|
488 |
$user = wppa_get_user();
|
921 |
' size="' . min( count( $exiflist ), '6' ) . '"' .
|
922 |
' >';
|
923 |
$reftag = str_replace( 'H', '#', $ss_data['2'] );
|
924 |
+
|
925 |
+
// Process all tags
|
926 |
+
$options_array = array();
|
927 |
foreach ( $exiflist as $item ) {
|
928 |
$tag = $item['tag'];
|
929 |
+
|
930 |
+
// Add brand specific tagname(s)
|
931 |
+
$brandfound = false;
|
932 |
+
foreach( $wppa_supported_camara_brands as $brand ) {
|
933 |
+
$brtagnam = trim( wppa_exif_tagname( hexdec( substr( $tag, 2, 4 ) ), $brand, 'brandonly' ), ': ' );
|
934 |
+
if ( $brtagnam ) {
|
935 |
+
$options_array[] = array( 'tag' => $tag . $brand, 'desc' => $brtagnam . ' (' . ucfirst( strtolower( $brand ) ) . ')' );
|
936 |
+
$brandfound = true;
|
937 |
+
}
|
938 |
+
}
|
939 |
+
|
940 |
+
// Add generic only if not undefined
|
941 |
+
$desc = __( $item['description'], 'wp-photo-album-plus' );
|
942 |
+
if ( substr( $desc, 0, 12 ) != 'UndefinedTag' ) {
|
943 |
+
$options_array[] = array( 'tag' => $tag, 'desc' => trim( __( $item['description'], 'wp-photo-album-plus' ), ': ' ) );
|
944 |
+
}
|
945 |
+
}
|
946 |
+
|
947 |
+
// Sort options
|
948 |
+
$options_array = wppa_array_sort( $options_array, 'desc' );
|
949 |
+
|
950 |
+
// Make the options html
|
951 |
+
foreach ( $options_array as $item ) {
|
952 |
+
$tag = $item['tag'];
|
953 |
+
$desc = $item['desc'];
|
954 |
+
$sel = ( $reftag == $tag && $ss_data['0'] == 'p' && $ss_data['1'] == 'e' );
|
955 |
+
|
956 |
$result .=
|
957 |
'<option' .
|
958 |
' value="' . $tag . '"' .
|
959 |
( $sel ? ' selected="selected"' : '' ) .
|
960 |
' >' .
|
961 |
+
$desc . ':' .
|
962 |
'</option>';
|
963 |
}
|
964 |
$result .=
|
3865 |
|
3866 |
$count = 0;
|
3867 |
|
3868 |
+
$brand = wppa_get_camera_brand( $photo );
|
3869 |
+
|
3870 |
// If in cache, use it
|
3871 |
$exifdata = false;
|
3872 |
if ( is_array( $wppa_exif_cache ) ) {
|
3933 |
}
|
3934 |
|
3935 |
// if ( ! isset( $wppa_exifdefaults[$exifline['tag']] ) ) continue;
|
3936 |
+
// $exifline['description'] = trim( $exifline['description'], "\x00..\x1F " );
|
3937 |
|
3938 |
// Photo status is hide ?
|
3939 |
if ( $exifline['status'] == 'hide' ) continue;
|
3942 |
if ( $exifline['status'] == 'default' && $default == 'hide' ) continue;
|
3943 |
|
3944 |
// P s is default and default is optional and field is empty
|
3945 |
+
if ( $exifline['status'] == 'default' && $default == 'option' && ! $exifline['f_description'] ) continue;
|
3946 |
|
3947 |
$count++;
|
3948 |
$newtag = $exifline['tag'];
|
3953 |
else {
|
3954 |
$result .= '<tr style="border-bottom:0 none; border-top:0 none; border-left: 0 none; border-right: 0 none;" >' .
|
3955 |
'<td class="wppa-exif-label wppa-box-text wppa-td" style="'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'" >';
|
3956 |
+
|
3957 |
+
$label = wppa_exif_tagname( hexdec( '0x' . substr( $exifline['tag'], 2, 4 ) ), $brand ) . ':';
|
3958 |
+
|
3959 |
$result .= esc_js( __( $label ) );
|
3960 |
+
|
3961 |
$result .= '</td><td class="wppa-exif-value wppa-box-text wppa-td" style="'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'" >';
|
3962 |
}
|
3963 |
+
$result .= esc_js( $exifline['f_description'] );
|
3964 |
$oldtag = $newtag;
|
3965 |
}
|
3966 |
if ( $oldtag != '' ) $result .= '</td></tr>'; // Close last line
|
wppa-breadcrumb.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for breadcrumbs
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -197,8 +197,16 @@ global $wppa_session;
|
|
197 |
$value .= ' ' . __('with iptc tag:', 'wp-photo-album-plus') . ' <b>' . __($label, 'wp-photo-album-plus') . '</b> ' . __('with content:', 'wp-photo-album-plus') .' <b>' . $ss_data['3'] . '</b>';
|
198 |
break;
|
199 |
case 'e':
|
200 |
-
$label = $wpdb->get_var( $wpdb->prepare( "SELECT `description` FROM `" . WPPA_EXIF . "` WHERE `tag` = %s AND `photo` = '0'", str_replace( 'H', '#', $ss_data['2'] ) ) );
|
201 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
$value .= ' ' . __('with exif tag:', 'wp-photo-album-plus') . ' <b>' . __($label, 'wp-photo-album-plus') . '</b> ' . __('with content:', 'wp-photo-album-plus') .' <b>' . $ss_data['3'] . '</b>';
|
203 |
break;
|
204 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for breadcrumbs
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
197 |
$value .= ' ' . __('with iptc tag:', 'wp-photo-album-plus') . ' <b>' . __($label, 'wp-photo-album-plus') . '</b> ' . __('with content:', 'wp-photo-album-plus') .' <b>' . $ss_data['3'] . '</b>';
|
198 |
break;
|
199 |
case 'e':
|
200 |
+
// $label = $wpdb->get_var( $wpdb->prepare( "SELECT `description` FROM `" . WPPA_EXIF . "` WHERE `tag` = %s AND `photo` = '0'", str_replace( 'H', '#', $ss_data['2'] ) ) );
|
201 |
+
$tag = substr( $ss_data[2], 2, 4 );
|
202 |
+
$brand = substr( $ss_data[2], 6 );
|
203 |
+
if ( $brand ) {
|
204 |
+
$label = wppa_exif_tagname( hexdec( $tag ), $brand, 'brandonly' ) . ' ('. ucfirst( strtolower( $brand ) ) .')';
|
205 |
+
}
|
206 |
+
else {
|
207 |
+
$label = wppa_exif_tagname( hexdec( $tag ) );
|
208 |
+
}
|
209 |
+
$label = trim( $label, ':' );
|
210 |
$value .= ' ' . __('with exif tag:', 'wp-photo-album-plus') . ' <b>' . __($label, 'wp-photo-album-plus') . '</b> ' . __('with content:', 'wp-photo-album-plus') .' <b>' . $ss_data['3'] . '</b>';
|
211 |
break;
|
212 |
}
|
wppa-common-functions.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-common-functions.php
|
3 |
*
|
4 |
* Functions used in admin and in themes
|
5 |
-
* Version 6.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -908,287 +908,7 @@ static $tables;
|
|
908 |
return false;
|
909 |
}
|
910 |
|
911 |
-
// Process the iptc data
|
912 |
-
function wppa_import_iptc( $id, $info, $nodelete = false ) {
|
913 |
-
global $wpdb;
|
914 |
-
static $labels;
|
915 |
-
|
916 |
-
$doit = false;
|
917 |
-
// Do we need this?
|
918 |
-
if ( wppa_switch( 'save_iptc' ) ) $doit = true;
|
919 |
-
if ( substr( wppa_opt( 'newphoto_name_method' ), 0, 2 ) == '2#' ) $doit = true;
|
920 |
-
if ( ! $doit ) return;
|
921 |
-
|
922 |
-
wppa_dbg_msg( 'wppa_import_iptc called for id='.$id );
|
923 |
-
wppa_dbg_msg( 'array is'.( is_array( $info ) ? ' ' : ' NOT ' ).'available' );
|
924 |
-
wppa_dbg_msg( 'APP13 is '.( isset( $info['APP13'] ) ? 'set' : 'NOT set' ) );
|
925 |
-
|
926 |
-
// Is iptc data present?
|
927 |
-
if ( !isset( $info['APP13'] ) ) return false; // No iptc data avail
|
928 |
-
//var_dump( $info );
|
929 |
-
// Parse
|
930 |
-
$iptc = iptcparse( $info['APP13'] );
|
931 |
-
if ( ! is_array( $iptc ) ) return false; // No data avail
|
932 |
-
|
933 |
-
// There is iptc data for this image.
|
934 |
-
// First delete any existing ipts data for this image
|
935 |
-
if ( ! $nodelete ) {
|
936 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM `".WPPA_IPTC."` WHERE `photo` = %s", $id ) );
|
937 |
-
}
|
938 |
-
|
939 |
-
// Find defined labels
|
940 |
-
if ( ! is_array( $labels ) ) {
|
941 |
-
$result = $wpdb->get_results( "SELECT `tag` FROM `".WPPA_IPTC."` WHERE `photo` = '0' ORDER BY `tag`", ARRAY_N );
|
942 |
-
|
943 |
-
if ( ! is_array( $result ) ) $result = array();
|
944 |
-
$labels = array();
|
945 |
-
foreach ( $result as $res ) {
|
946 |
-
$labels[] = $res['0'];
|
947 |
-
}
|
948 |
-
}
|
949 |
-
|
950 |
-
foreach ( array_keys( $iptc ) as $s ) {
|
951 |
-
|
952 |
-
// Check for valid item
|
953 |
-
if ( $s == '2#000' ) continue; // Skip this one
|
954 |
-
|
955 |
-
if ( is_array( $iptc[$s] ) ) {
|
956 |
-
$c = count ( $iptc[$s] );
|
957 |
-
for ( $i=0; $i <$c; $i++ ) {
|
958 |
-
|
959 |
-
// Process item
|
960 |
-
wppa_dbg_msg( 'IPTC '.$s.' = '.$iptc[$s][$i] );
|
961 |
-
|
962 |
-
// Check labels first
|
963 |
-
if ( ! in_array( $s, $labels ) ) {
|
964 |
-
|
965 |
-
// Add to labels
|
966 |
-
$labels[] = $s;
|
967 |
-
|
968 |
-
// Add to db
|
969 |
-
$photo = '0';
|
970 |
-
$tag = $s;
|
971 |
-
$desc = $s.':';
|
972 |
-
if ( $s == '2#005' ) $desc = 'Graphic name:';
|
973 |
-
if ( $s == '2#010' ) $desc = 'Urgency:';
|
974 |
-
if ( $s == '2#015' ) $desc = 'Category:';
|
975 |
-
if ( $s == '2#020' ) $desc = 'Supp categories:';
|
976 |
-
if ( $s == '2#040' ) $desc = 'Spec instr:';
|
977 |
-
if ( $s == '2#055' ) $desc = 'Creation date:';
|
978 |
-
if ( $s == '2#080' ) $desc = 'Photographer:';
|
979 |
-
if ( $s == '2#085' ) $desc = 'Credit byline title:';
|
980 |
-
if ( $s == '2#090' ) $desc = 'City:';
|
981 |
-
if ( $s == '2#095' ) $desc = 'State:';
|
982 |
-
if ( $s == '2#101' ) $desc = 'Country:';
|
983 |
-
if ( $s == '2#103' ) $desc = 'Otr:';
|
984 |
-
if ( $s == '2#105' ) $desc = 'Headline:';
|
985 |
-
if ( $s == '2#110' ) $desc = 'Source:';
|
986 |
-
if ( $s == '2#115' ) $desc = 'Photo source:';
|
987 |
-
if ( $s == '2#120' ) $desc = 'Caption:';
|
988 |
-
$status = 'display';
|
989 |
-
if ( $s == '1#090' ) $status = 'hide';
|
990 |
-
if ( $desc == $s.':' ) $status= 'hide';
|
991 |
-
// if ( $s == '2#000' ) $status = 'hide';
|
992 |
-
$iret = wppa_create_iptc_entry( array( 'photo' => $photo, 'tag' => $tag, 'description' => $desc, 'status' => $status ) );
|
993 |
-
if ( ! $iret ) wppa_log( 'Warning', 'Could not add IPTC tag '.$tag.' for photo '.$photo );
|
994 |
-
}
|
995 |
-
|
996 |
-
// Now add poto specific data item
|
997 |
-
$photo = $id;
|
998 |
-
$tag = $s;
|
999 |
-
$desc = $iptc[$s][$i];
|
1000 |
-
if ( ! seems_utf8( $desc ) ) {
|
1001 |
-
$desc = utf8_encode( $desc );
|
1002 |
-
}
|
1003 |
-
$status = 'default';
|
1004 |
-
$iret = wppa_create_iptc_entry( array( 'photo' => $photo, 'tag' => $tag, 'description' => $desc, 'status' => $status ) );
|
1005 |
-
if ( ! $iret ) wppa_log( 'Warning', 'Could not add IPTC tag '.$tag.' for photo '.$photo );
|
1006 |
-
}
|
1007 |
-
}
|
1008 |
-
}
|
1009 |
-
|
1010 |
-
wppa_iptc_clean_garbage( $id );
|
1011 |
-
}
|
1012 |
-
|
1013 |
-
function wppa_get_exif_datetime( $file ) {
|
1014 |
-
|
1015 |
-
// Make sure we do not process a -o1.jpg file
|
1016 |
-
$file = str_replace( '-o1.jpg', '.jpg', $file );
|
1017 |
-
return wppa_get_exif_item( $file, 'DateTimeOriginal' );
|
1018 |
-
}
|
1019 |
-
|
1020 |
-
function wppa_get_exif_orientation( $file ) {
|
1021 |
-
|
1022 |
-
return wppa_get_exif_item( $file, 'Orientation' );
|
1023 |
-
}
|
1024 |
-
|
1025 |
-
function wppa_get_exif_item( $file, $item ) {
|
1026 |
-
|
1027 |
-
// File exists?
|
1028 |
-
if ( ! is_file( $file ) ) {
|
1029 |
-
return false;
|
1030 |
-
}
|
1031 |
-
|
1032 |
-
// Exif functions present?
|
1033 |
-
if ( ! function_exists( 'exif_imagetype' ) ) {
|
1034 |
-
return false;
|
1035 |
-
}
|
1036 |
|
1037 |
-
// Check filetype
|
1038 |
-
$image_type = @ exif_imagetype( $file );
|
1039 |
-
if ( $image_type != IMAGETYPE_JPEG ) {
|
1040 |
-
return false;
|
1041 |
-
}
|
1042 |
-
|
1043 |
-
// Can get exif data?
|
1044 |
-
if ( ! function_exists( 'exif_read_data' ) ) {
|
1045 |
-
return false;
|
1046 |
-
}
|
1047 |
-
|
1048 |
-
// Get exif data
|
1049 |
-
$exif = @ exif_read_data( $file, 'EXIF' );
|
1050 |
-
if ( ! is_array( $exif ) ) {
|
1051 |
-
return false;
|
1052 |
-
}
|
1053 |
-
|
1054 |
-
// Data present
|
1055 |
-
if ( isset( $exif[$item] ) ) {
|
1056 |
-
return $exif[$item];
|
1057 |
-
}
|
1058 |
-
|
1059 |
-
// Nothing found
|
1060 |
-
return false;
|
1061 |
-
}
|
1062 |
-
|
1063 |
-
|
1064 |
-
function wppa_import_exif( $id, $file, $nodelete = false ) {
|
1065 |
-
global $wpdb;
|
1066 |
-
static $labels;
|
1067 |
-
static $names;
|
1068 |
-
global $wppa;
|
1069 |
-
|
1070 |
-
// Do we need this?
|
1071 |
-
if ( ! wppa_switch( 'save_exif' ) ) return;
|
1072 |
-
|
1073 |
-
// Make sure we do not process a -o1.jpg file
|
1074 |
-
$file = str_replace( '-o1.jpg', '.jpg', $file );
|
1075 |
-
|
1076 |
-
// Check filetype
|
1077 |
-
if ( ! function_exists( 'exif_imagetype' ) ) return false;
|
1078 |
-
|
1079 |
-
$image_type = @ exif_imagetype( $file );
|
1080 |
-
if ( $image_type != IMAGETYPE_JPEG ) return false; // Not supported image type
|
1081 |
-
|
1082 |
-
// Get exif data
|
1083 |
-
if ( ! function_exists( 'exif_read_data' ) ) return false; // Not supported by the server
|
1084 |
-
|
1085 |
-
$exif = @ exif_read_data( $file, 'EXIF' );
|
1086 |
-
if ( ! is_array( $exif ) ) return false; // No data present
|
1087 |
-
|
1088 |
-
// There is exif data for this image.
|
1089 |
-
// First delete any existing exif data for this image
|
1090 |
-
if ( ! $nodelete ) {
|
1091 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM `".WPPA_EXIF."` WHERE `photo` = %s", $id ) );
|
1092 |
-
}
|
1093 |
-
|
1094 |
-
// Find defined labels
|
1095 |
-
if ( ! is_array( $labels ) ) {
|
1096 |
-
$result = $wpdb->get_results( "SELECT * FROM `".WPPA_EXIF."` WHERE `photo` = '0' ORDER BY `tag`", ARRAY_A );
|
1097 |
-
|
1098 |
-
if ( ! is_array( $result ) ) $result = array();
|
1099 |
-
$labels = array();
|
1100 |
-
$names = array();
|
1101 |
-
foreach ( $result as $res ) {
|
1102 |
-
$labels[] = $res['tag'];
|
1103 |
-
$names[] = $res['description'];
|
1104 |
-
}
|
1105 |
-
}
|
1106 |
-
|
1107 |
-
foreach ( array_keys( $exif ) as $s ) {
|
1108 |
-
// Process item
|
1109 |
-
wppa_dbg_msg( 'EXIF '.$s.' = '.serialize($exif[$s]) );
|
1110 |
-
|
1111 |
-
// Check labels first
|
1112 |
-
$tag = '';
|
1113 |
-
if ( in_array( $s, $names ) ) {
|
1114 |
-
$i = 0;
|
1115 |
-
while ( $i < count( $labels ) ) {
|
1116 |
-
if ( $names[$i] == $s ) $tag = $labels[$i];
|
1117 |
-
}
|
1118 |
-
}
|
1119 |
-
if ( $tag == '' ) $tag = wppa_exif_tag( $s );
|
1120 |
-
if ( $tag == 'E#EA1C' ) $tag = ''; // EA1C is explixitly undefined and will fail to register
|
1121 |
-
if ( $tag == '' ) continue;
|
1122 |
-
|
1123 |
-
if ( ! in_array( $tag, $labels ) ) {
|
1124 |
-
|
1125 |
-
// Add to labels
|
1126 |
-
$labels[] = $tag;
|
1127 |
-
$names[] = $s.':';
|
1128 |
-
|
1129 |
-
// Add to db
|
1130 |
-
$photo = '0';
|
1131 |
-
$desc = $s.':';
|
1132 |
-
$status = 'display';
|
1133 |
-
if ( substr( $s, 0, 12 ) == 'UndefinedTag' ) $status = 'hide';
|
1134 |
-
$iret = wppa_create_exif_entry( array( 'photo' => $photo, 'tag' => $tag, 'description' => $desc, 'status' => $status ) );
|
1135 |
-
if ( ! $iret ) wppa_log( 'Warning 1', 'Could not add EXIF tag '.$tag.' for photo '.$photo );
|
1136 |
-
}
|
1137 |
-
|
1138 |
-
// Now add poto specific data item
|
1139 |
-
// If its an array...
|
1140 |
-
if ( is_array( $exif[$s] ) ) { // continue;
|
1141 |
-
$c = count ( $exif[$s] );
|
1142 |
-
$max = wppa_opt( 'exif_max_array_size' );
|
1143 |
-
if ( $max != '0' && $c > $max ) {
|
1144 |
-
wppa_dbg_msg( 'Exif tag '.$tag. ': array truncated form '.$c.' to '.$max.' elements for photo nr '.$id.'.', 'red' );
|
1145 |
-
$c = $max;
|
1146 |
-
}
|
1147 |
-
for ( $i=0; $i <$c; $i++ ) {
|
1148 |
-
$photo = $id;
|
1149 |
-
$desc = $exif[$s][$i];
|
1150 |
-
$status = 'default';
|
1151 |
-
$iret = wppa_create_exif_entry( array( 'photo' => $photo, 'tag' => $tag, 'description' => $desc, 'status' => $status ) );
|
1152 |
-
if ( ! $iret ) wppa_log( 'Warning 2', 'Could not add EXIF tag '.$tag.' for photo '.$photo );
|
1153 |
-
|
1154 |
-
}
|
1155 |
-
}
|
1156 |
-
// Its not an array
|
1157 |
-
else {
|
1158 |
-
$photo = $id;
|
1159 |
-
$desc = $exif[$s];
|
1160 |
-
$status = 'default';
|
1161 |
-
$iret = wppa_create_exif_entry( array( 'photo' => $photo, 'tag' => $tag, 'description' => $desc, 'status' => $status ) );
|
1162 |
-
if ( ! $iret ) {} /* wppa_log( 'Warning 3', 'Could not add EXIF tag '.$tag.' for photo '.$photo.', desc = '.$desc ); */ // Is junk, dont care
|
1163 |
-
}
|
1164 |
-
}
|
1165 |
-
|
1166 |
-
wppa_exif_clean_garbage( $id );
|
1167 |
-
}
|
1168 |
-
|
1169 |
-
// Inverse of exif_tagname();
|
1170 |
-
function wppa_exif_tag( $tagname ) {
|
1171 |
-
global $wppa_inv_exiftags;
|
1172 |
-
|
1173 |
-
// Setup inverted matrix
|
1174 |
-
if ( ! is_array( $wppa_inv_exiftags ) ) {
|
1175 |
-
$key = 0;
|
1176 |
-
while ( $key < 65536 ) {
|
1177 |
-
$tag = exif_tagname( $key );
|
1178 |
-
if ( $tag != '' ) {
|
1179 |
-
$wppa_inv_exiftags[$tag] = $key;
|
1180 |
-
}
|
1181 |
-
$key++;
|
1182 |
-
if ( ! $key ) break; // 16 bit server wrap around ( do they still exist??? )
|
1183 |
-
}
|
1184 |
-
}
|
1185 |
-
// Search
|
1186 |
-
if ( isset( $wppa_inv_exiftags[$tagname] ) ) return sprintf( 'E#%04X',$wppa_inv_exiftags[$tagname] );
|
1187 |
-
elseif ( strlen( $tagname ) == 19 ) {
|
1188 |
-
if ( substr( $tagname, 0, 12 ) == 'UndefinedTag' ) return 'E#'.substr( $tagname, -4 );
|
1189 |
-
}
|
1190 |
-
else return '';
|
1191 |
-
}
|
1192 |
|
1193 |
function wppa_clear_cache( $force = false ) {
|
1194 |
global $cache_path;
|
@@ -1522,80 +1242,6 @@ static $counters;
|
|
1522 |
}
|
1523 |
}
|
1524 |
|
1525 |
-
// Get gps data from photofile
|
1526 |
-
function wppa_get_coordinates( $picture_path, $photo_id ) {
|
1527 |
-
global $wpdb;
|
1528 |
-
|
1529 |
-
// Make sure we look at the original, not the -o1 file
|
1530 |
-
$picture_path = str_replace( '-o1.jpg', '.jpg', $picture_path );
|
1531 |
-
|
1532 |
-
// Exif on board?
|
1533 |
-
if ( ! function_exists( 'exif_read_data' ) ) return false;
|
1534 |
-
|
1535 |
-
// Check filetype
|
1536 |
-
if ( ! function_exists( 'exif_imagetype' ) ) return false;
|
1537 |
-
$image_type = @ exif_imagetype( $picture_path );
|
1538 |
-
if ( $image_type != IMAGETYPE_JPEG ) return false; // Not supported image type
|
1539 |
-
|
1540 |
-
// get exif data
|
1541 |
-
if ( $exif = @ exif_read_data( $picture_path, 0 , false ) ) {
|
1542 |
-
|
1543 |
-
// any coordinates available?
|
1544 |
-
if ( !isset ( $exif['GPSLatitude'][0] ) ) return false; // No GPS data
|
1545 |
-
if ( !isset ( $exif['GPSLongitude'][0] ) ) return false; // No GPS data
|
1546 |
-
|
1547 |
-
// north, east, south, west?
|
1548 |
-
if ( $exif['GPSLatitudeRef'] == "S" ) {
|
1549 |
-
$gps['latitude_string'] = -1;
|
1550 |
-
$gps['latitude_dicrection'] = "S";
|
1551 |
-
}
|
1552 |
-
else {
|
1553 |
-
$gps['latitude_string'] = 1;
|
1554 |
-
$gps['latitude_dicrection'] = "N";
|
1555 |
-
}
|
1556 |
-
if ( $exif['GPSLongitudeRef'] == "W" ) {
|
1557 |
-
$gps['longitude_string'] = -1;
|
1558 |
-
$gps['longitude_dicrection'] = "W";
|
1559 |
-
}
|
1560 |
-
else {
|
1561 |
-
$gps['longitude_string'] = 1;
|
1562 |
-
$gps['longitude_dicrection'] = "E";
|
1563 |
-
}
|
1564 |
-
// location
|
1565 |
-
$gps['latitude_hour'] = $exif["GPSLatitude"][0];
|
1566 |
-
$gps['latitude_minute'] = $exif["GPSLatitude"][1];
|
1567 |
-
$gps['latitude_second'] = $exif["GPSLatitude"][2];
|
1568 |
-
$gps['longitude_hour'] = $exif["GPSLongitude"][0];
|
1569 |
-
$gps['longitude_minute'] = $exif["GPSLongitude"][1];
|
1570 |
-
$gps['longitude_second'] = $exif["GPSLongitude"][2];
|
1571 |
-
|
1572 |
-
// calculating
|
1573 |
-
foreach( $gps as $key => $value ) {
|
1574 |
-
$pos = strpos( $value, '/' );
|
1575 |
-
if ( $pos !== false ) {
|
1576 |
-
$temp = explode( '/',$value );
|
1577 |
-
if ( $temp[1] ) $gps[$key] = $temp[0] / $temp[1];
|
1578 |
-
else $gps[$key] = 0;
|
1579 |
-
}
|
1580 |
-
}
|
1581 |
-
|
1582 |
-
$geo['latitude_format'] = $gps['latitude_dicrection']." ".$gps['latitude_hour']."°".$gps['latitude_minute']."'".round ( $gps['latitude_second'], 4 ).'"';
|
1583 |
-
$geo['longitude_format'] = $gps['longitude_dicrection']." ".$gps['longitude_hour']."°".$gps['longitude_minute']."'".round ( $gps['longitude_second'], 4 ).'"';
|
1584 |
-
|
1585 |
-
$geo['latitude'] = $gps['latitude_string'] * ( $gps['latitude_hour'] + ( $gps['latitude_minute'] / 60 ) + ( $gps['latitude_second'] / 3600 ) );
|
1586 |
-
$geo['longitude'] = $gps['longitude_string'] * ( $gps['longitude_hour'] + ( $gps['longitude_minute'] / 60 ) + ( $gps['longitude_second'] / 3600 ) );
|
1587 |
-
|
1588 |
-
}
|
1589 |
-
else { // No exif data
|
1590 |
-
return false;
|
1591 |
-
}
|
1592 |
-
|
1593 |
-
// Process result
|
1594 |
-
// print_r( $geo ); // debug
|
1595 |
-
$result = implode( '/', $geo );
|
1596 |
-
$wpdb->query( $wpdb->prepare( "UPDATE `".WPPA_PHOTOS."` SET `location` = %s WHERE `id` = %s", $result, $photo_id ) );
|
1597 |
-
return $geo;
|
1598 |
-
}
|
1599 |
|
1600 |
|
1601 |
function wppa_format_geo( $lat, $lon ) {
|
2 |
/* wppa-common-functions.php
|
3 |
*
|
4 |
* Functions used in admin and in themes
|
5 |
+
* Version 6.8.00
|
6 |
*
|
7 |
*/
|
8 |
|
908 |
return false;
|
909 |
}
|
910 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
911 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
912 |
|
913 |
function wppa_clear_cache( $force = false ) {
|
914 |
global $cache_path;
|
1242 |
}
|
1243 |
}
|
1244 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1245 |
|
1246 |
|
1247 |
function wppa_format_geo( $lat, $lon ) {
|
wppa-cron.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all cron functions
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*
|
9 |
*/
|
@@ -34,7 +34,20 @@ global $is_reschedule;
|
|
34 |
|
35 |
// Schedule cron job
|
36 |
if ( ! wp_next_scheduled( 'wppa_cron_event', array( $slug ) ) ) {
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
$backtrace = debug_backtrace();
|
39 |
$args = '';
|
40 |
if ( is_array( $backtrace[1]['args'] ) ) {
|
@@ -225,6 +238,22 @@ global $wpdb;
|
|
225 |
update_option( 'wppa_failed_mails', $failed_mails );
|
226 |
}
|
227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} completed.' );
|
229 |
|
230 |
// Redo after 5 minutes
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all cron functions
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*
|
9 |
*/
|
34 |
|
35 |
// Schedule cron job
|
36 |
if ( ! wp_next_scheduled( 'wppa_cron_event', array( $slug ) ) ) {
|
37 |
+
if ( $is_reschedule || $from_settings_page ) {
|
38 |
+
$delay = 5;
|
39 |
+
}
|
40 |
+
else switch ( $slug ) {
|
41 |
+
case 'wppa_remake_index_photos': // one hour
|
42 |
+
$delay = 3600;
|
43 |
+
break;
|
44 |
+
case 'wppa_cleanup_index': // 3 hours
|
45 |
+
$delay = 10800;
|
46 |
+
break;
|
47 |
+
default:
|
48 |
+
$delay = 30; // 30 sec.
|
49 |
+
}
|
50 |
+
wp_schedule_single_event( time() + $delay, 'wppa_cron_event', array( $slug ) );
|
51 |
$backtrace = debug_backtrace();
|
52 |
$args = '';
|
53 |
if ( is_array( $backtrace[1]['args'] ) ) {
|
238 |
update_option( 'wppa_failed_mails', $failed_mails );
|
239 |
}
|
240 |
|
241 |
+
// Cleanup iptc and exif
|
242 |
+
wppa_iptc_clean_garbage();
|
243 |
+
wppa_exif_clean_garbage();
|
244 |
+
|
245 |
+
// Cleanup qr cache
|
246 |
+
if ( is_dir( WPPA_UPLOAD_PATH . '/qr' ) ) {
|
247 |
+
$qrs = glob( WPPA_UPLOAD_PATH . '/qr/*.svg' );
|
248 |
+
if ( ! empty( $qrs ) ) {
|
249 |
+
$count = count( $qrs );
|
250 |
+
if ( $count > 250 ) {
|
251 |
+
foreach( $qrs as $qr ) @ unlink( $qr );
|
252 |
+
wppa_log( 'Cron', $count . ' qr cache files removed' );
|
253 |
+
}
|
254 |
+
}
|
255 |
+
}
|
256 |
+
|
257 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} completed.' );
|
258 |
|
259 |
// Redo after 5 minutes
|
wppa-exif-iptc-common.php
CHANGED
@@ -3,13 +3,16 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* exif and iptc common functions
|
6 |
-
* version 6.
|
7 |
*
|
8 |
*
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
12 |
|
|
|
|
|
|
|
13 |
// Translate iptc tags into photo dependant data inside a text
|
14 |
function wppa_filter_iptc($desc, $photo) {
|
15 |
global $wpdb;
|
@@ -95,7 +98,7 @@ global $wppa_exif_cache;
|
|
95 |
|
96 |
if ( strpos($desc, 'E#') === false ) return $desc; // No tags in desc: Nothing to do
|
97 |
|
98 |
-
// Get
|
99 |
if ( ! is_array( $wppa_exif_labels ) ) {
|
100 |
$wppa_exif_labels = $wpdb->get_results( "SELECT * FROM `" . WPPA_EXIF . "` WHERE `photo` = '0' ORDER BY `tag`", ARRAY_A );
|
101 |
}
|
@@ -158,7 +161,7 @@ global $wppa_exif_cache;
|
|
158 |
// Remove untranslated
|
159 |
$pos = strpos($temp, 'E#');
|
160 |
while ( $pos !== false ) {
|
161 |
-
$tmp = substr( $temp, 0, $pos ) . '<span title="' . esc_attr( __( 'No data', 'wp-photo-album-plus' ) ) . '">' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>' . substr( $temp, $pos+6 );
|
162 |
$temp = $tmp;
|
163 |
$pos = strpos($temp, 'E#');
|
164 |
}
|
@@ -167,250 +170,717 @@ global $wppa_exif_cache;
|
|
167 |
return $temp;
|
168 |
}
|
169 |
|
170 |
-
function wppa_format_exif( $tag, $data ) {
|
171 |
global $wppa_exif_error_output;
|
172 |
|
173 |
-
if ( $data ) {
|
174 |
switch ( $tag ) {
|
175 |
|
176 |
-
case 'E#
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
}
|
182 |
-
|
183 |
-
$result = $data . ' ' . __( 'px.', 'wp-photo-album-plus' );
|
184 |
-
return $result;
|
185 |
break;
|
186 |
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
|
192 |
-
|
193 |
-
|
|
|
|
|
194 |
}
|
195 |
-
|
196 |
-
// Format is valid
|
197 |
-
$temp = explode( '/', $data );
|
198 |
-
$x = $temp[0];
|
199 |
-
$y = $temp[1];
|
200 |
-
|
201 |
-
$result = ( $x / $y );
|
202 |
-
return $result;
|
203 |
break;
|
204 |
|
205 |
-
case 'E#
|
206 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
|
208 |
-
|
209 |
-
|
|
|
|
|
210 |
}
|
|
|
211 |
|
212 |
-
|
213 |
-
|
214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
break;
|
216 |
-
case
|
217 |
-
$result =
|
|
|
218 |
break;
|
219 |
default:
|
220 |
-
$result =
|
|
|
221 |
}
|
222 |
-
return $result;
|
223 |
break;
|
224 |
|
225 |
-
|
226 |
-
|
|
|
227 |
|
228 |
-
|
229 |
-
|
|
|
230 |
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
|
235 |
-
|
236 |
-
$temp = explode( '/', $data );
|
237 |
-
$x = $temp[0];
|
238 |
-
$y = $temp[1];
|
239 |
|
240 |
-
|
241 |
-
|
|
|
|
|
|
|
|
|
242 |
break;
|
243 |
|
244 |
-
case 'E#
|
|
|
|
|
|
|
245 |
|
246 |
-
|
247 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
}
|
|
|
249 |
|
250 |
-
|
251 |
-
|
252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
break;
|
254 |
-
case
|
255 |
-
|
|
|
|
|
|
|
|
|
|
|
256 |
break;
|
257 |
default:
|
258 |
-
$result =
|
|
|
259 |
}
|
260 |
-
|
261 |
-
return $result;
|
262 |
break;
|
263 |
|
264 |
-
case 'E#
|
265 |
-
|
266 |
-
|
267 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
}
|
269 |
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
|
275 |
-
$result =
|
276 |
return $result;
|
277 |
break;
|
278 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
|
280 |
-
|
281 |
-
E#8298 Copyright Already formatted correctly
|
282 |
-
Location Formatted into one line according to the 3 tags below: 2#092, 2#090, 2#095, 2#101
|
283 |
-
2#092 Sub location
|
284 |
-
2#090 City
|
285 |
-
2#095 State
|
286 |
-
2#101 Country
|
287 |
-
|
288 |
-
aux:Lens Lens Already formatted correctly - See line 66 in sample photo exifdata.jpg attached Example aux:Lens="EF300mm f/4L IS USM +1.4x"
|
289 |
-
*/
|
290 |
-
// E#920A Focal length Must be formatted: 420/1 = 420 mm
|
291 |
-
case 'E#920A':
|
292 |
|
293 |
-
if ( !
|
294 |
return $wppa_exif_error_output;
|
295 |
}
|
296 |
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
$z = round( $x / $y );
|
303 |
-
if ( $z < 10 ) {
|
304 |
-
$result = round( $x * 10 / $y ) / 10 . ' mm.';
|
305 |
-
}
|
306 |
-
else {
|
307 |
-
$result = round( $x / $y ) . ' mm.';
|
308 |
}
|
309 |
return $result;
|
310 |
-
break;
|
311 |
|
312 |
-
|
313 |
-
case 'E#
|
314 |
-
|
315 |
-
|
316 |
-
if ( ! wppa_is_valid_rational( $data ) ) {
|
317 |
return $wppa_exif_error_output;
|
318 |
}
|
319 |
-
|
320 |
-
// Format is valid
|
321 |
-
$temp = explode( '/', $data );
|
322 |
-
$x = $temp[0];
|
323 |
-
$y = $temp[1];
|
324 |
-
|
325 |
-
if ( $x == 0 || $y == 0 ) {
|
326 |
-
$result = '<span title="' . esc_attr( __( 'Impossible data', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
327 |
-
}
|
328 |
-
else {
|
329 |
-
if ( $temp[1] != 0 ) {
|
330 |
-
$result = round( 100*$temp[0]/$temp[1] ) / 100;
|
331 |
-
}
|
332 |
-
if ( $result == -1 || $result > 10000 ) {
|
333 |
-
$result = '∞';
|
334 |
-
}
|
335 |
-
else {
|
336 |
-
$result .= ' m.';
|
337 |
-
}
|
338 |
-
}
|
339 |
-
|
340 |
-
return $result;
|
341 |
-
break;
|
342 |
|
343 |
-
|
|
|
|
|
344 |
|
345 |
-
|
346 |
-
|
347 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
348 |
}
|
|
|
349 |
|
350 |
-
|
351 |
-
$temp = explode( '/', $data );
|
352 |
-
$x = $temp[0];
|
353 |
-
$y = $temp[1];
|
354 |
|
355 |
-
|
356 |
-
if ( $x / $y == 1 ) {
|
357 |
-
$result = '1 s.';
|
358 |
-
return $result;
|
359 |
-
}
|
360 |
|
361 |
-
|
362 |
-
|
363 |
-
$result =
|
364 |
-
|
|
|
365 |
}
|
|
|
366 |
|
367 |
-
|
368 |
-
if ( $y == 1 ) {
|
369 |
-
$result = $x . ' s.';
|
370 |
-
return $result;
|
371 |
-
}
|
372 |
|
373 |
-
|
374 |
-
if ( ( $x / $y ) > 1 ) {
|
375 |
-
$result = sprintf( '%2.1f', $x / $y );
|
376 |
-
if ( substr( $result, -2 ) == '.0' ) { // Remove trailing '.0'
|
377 |
-
$result = substr( $result, 0, strlen( $result ) -2 ) . ' s.';
|
378 |
-
}
|
379 |
-
else {
|
380 |
-
$result .= ' s.';
|
381 |
-
}
|
382 |
-
return $result;
|
383 |
-
}
|
384 |
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
if ( round( $v ) == '1' ) {
|
390 |
-
$result = '1 s.';
|
391 |
-
}
|
392 |
-
else {
|
393 |
-
$result = '1/' . round( $v ) . ' s.';
|
394 |
-
}
|
395 |
}
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
$result =
|
|
|
|
|
|
|
|
|
|
|
407 |
}
|
408 |
return $result;
|
409 |
-
break;
|
410 |
|
411 |
-
case 'E#
|
|
|
412 |
|
413 |
-
// Invalid format?
|
414 |
if ( ! wppa_is_valid_rational( $data ) ) {
|
415 |
return $wppa_exif_error_output;
|
416 |
}
|
@@ -420,187 +890,1488 @@ global $wppa_exif_error_output;
|
|
420 |
$x = $temp[0];
|
421 |
$y = $temp[1];
|
422 |
|
423 |
-
|
424 |
-
if ( $x / $y > 100 ) {
|
425 |
-
$result = '<span title="' . esc_attr( __( 'Impossible data', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
426 |
-
return $result;
|
427 |
-
}
|
428 |
-
|
429 |
-
// Valid meaningful data
|
430 |
-
$result = 'f/' . ( round( 10 * $x / $y ) / 10 );
|
431 |
-
|
432 |
return $result;
|
433 |
break;
|
434 |
|
435 |
-
case 'E#
|
436 |
-
case 'E#9205': // Max aperture value
|
437 |
|
438 |
-
|
439 |
-
|
440 |
-
|
|
|
|
|
|
|
441 |
}
|
|
|
|
|
442 |
|
443 |
-
|
444 |
-
$temp = explode( '/', $data );
|
445 |
-
$x = $temp[0];
|
446 |
-
$y = $temp[1];
|
447 |
|
448 |
-
|
449 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
return $result;
|
451 |
break;
|
452 |
|
453 |
-
|
454 |
-
E#8827 ISO Speed Rating Already formatted correctly
|
455 |
-
E#9204 Exposure bias Already formatted correctly
|
456 |
-
*/
|
457 |
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
case '4': $result = __('Shutter speed priority AE', 'wp-photo-album-plus'); break;
|
465 |
-
case '5': $result = __('Creative (Slow speed)', 'wp-photo-album-plus'); break;
|
466 |
-
case '6': $result = __('Action (High speed)', 'wp-photo-album-plus'); break;
|
467 |
-
case '7': $result = __('Portrait', 'wp-photo-album-plus'); break;
|
468 |
-
case '8': $result = __('Landscape', 'wp-photo-album-plus'); break;
|
469 |
-
case '9': $result = __('Bulb', 'wp-photo-album-plus'); break;
|
470 |
-
default:
|
471 |
-
$result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
472 |
-
}
|
473 |
return $result;
|
474 |
break;
|
475 |
|
476 |
-
case 'E#
|
477 |
-
if ( $data ) $result =
|
478 |
-
else $result = '';
|
479 |
return $result;
|
480 |
break;
|
481 |
|
482 |
-
case 'E#
|
|
|
|
|
|
|
483 |
switch ( $data ) {
|
484 |
-
case
|
485 |
-
case
|
486 |
-
|
487 |
-
case '4': $result = __('Multi-spot', 'wp-photo-album-plus'); break;
|
488 |
-
case '5': $result = __('Multi-segment', 'wp-photo-album-plus'); break;
|
489 |
-
case '6': $result = __('Partial', 'wp-photo-album-plus'); break;
|
490 |
-
case '255': $result = __('Other', 'wp-photo-album-plus'); break;
|
491 |
-
default:
|
492 |
-
$result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
493 |
}
|
494 |
return $result;
|
495 |
break;
|
496 |
|
497 |
-
case 'E#
|
498 |
-
|
|
|
|
|
499 |
switch ( $data ) {
|
500 |
-
case '
|
501 |
-
case
|
502 |
-
|
503 |
-
|
504 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
case '5': $result = __('Fired, Return not detected', 'wp-photo-album-plus'); break;
|
506 |
-
case '0'.'x7':
|
507 |
case '7': $result = __('Fired, Return detected', 'wp-photo-album-plus'); break;
|
508 |
-
case '0'.'x8':
|
509 |
case '8': $result = __('On, Did not fire', 'wp-photo-album-plus'); break;
|
510 |
-
case '0'.'x9':
|
511 |
case '9': $result = __('On, Fired', 'wp-photo-album-plus'); break;
|
512 |
-
case '0'.'xd':
|
513 |
case '13': $result = __('On, Return not detected', 'wp-photo-album-plus'); break;
|
514 |
-
case '0'.'xf':
|
515 |
case '15': $result = __('On, Return detected', 'wp-photo-album-plus'); break;
|
516 |
-
case '0'.'x10':
|
517 |
case '16': $result = __('Off, Did not fire', 'wp-photo-album-plus'); break;
|
518 |
-
case '0'.'x14':
|
519 |
case '20': $result = __('Off, Did not fire, Return not detected', 'wp-photo-album-plus'); break;
|
520 |
-
case '0'.'x18':
|
521 |
case '24': $result = __('Auto, Did not fire', 'wp-photo-album-plus'); break;
|
522 |
-
case '0'.'x19':
|
523 |
case '25': $result = __('Auto, Fired', 'wp-photo-album-plus'); break;
|
524 |
-
case '0'.'x1d':
|
525 |
case '29': $result = __('Auto, Fired, Return not detected', 'wp-photo-album-plus'); break;
|
526 |
-
case '0'.'x1f':
|
527 |
case '31': $result = __('Auto, Fired, Return detected', 'wp-photo-album-plus'); break;
|
528 |
-
case '0'.'x20':
|
529 |
case '32': $result = __('No flash function', 'wp-photo-album-plus'); break;
|
530 |
-
case '0'.'x30':
|
531 |
case '48': $result = __('Off, No flash function', 'wp-photo-album-plus'); break;
|
532 |
-
case '0'.'x41':
|
533 |
case '65': $result = __('Fired, Red-eye reduction', 'wp-photo-album-plus'); break;
|
534 |
-
case '0'.'x45':
|
535 |
case '69': $result = __('Fired, Red-eye reduction, Return not detected', 'wp-photo-album-plus'); break;
|
536 |
-
case '0'.'x47':
|
537 |
case '71': $result = __('Fired, Red-eye reduction, Return detected', 'wp-photo-album-plus'); break;
|
538 |
-
case '0'.'x49':
|
539 |
case '73': $result = __('On, Red-eye reduction', 'wp-photo-album-plus'); break;
|
540 |
-
case '0'.'x4d':
|
541 |
case '77': $result = __('Red-eye reduction, Return not detected', 'wp-photo-album-plus'); break;
|
542 |
-
case '0'.'x4f':
|
543 |
case '79': $result = __('On, Red-eye reduction, Return detected', 'wp-photo-album-plus'); break;
|
544 |
-
case '0'.'x50':
|
545 |
case '80': $result = __('Off, Red-eye reduction', 'wp-photo-album-plus'); break;
|
546 |
-
case '0'.'x58':
|
547 |
case '88': $result = __('Auto, Did not fire, Red-eye reduction', 'wp-photo-album-plus'); break;
|
548 |
-
case '0'.'x59':
|
549 |
case '89': $result = __('Auto, Fired, Red-eye reduction', 'wp-photo-album-plus'); break;
|
550 |
-
case '0'.'x5d':
|
551 |
case '93': $result = __('Auto, Fired, Red-eye reduction, Return not detected', 'wp-photo-album-plus'); break;
|
552 |
-
case '0'.'x5f':
|
553 |
case '95': $result = __('Auto, Fired, Red-eye reduction, Return detected', 'wp-photo-album-plus'); break;
|
554 |
default:
|
555 |
-
$result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
556 |
}
|
|
|
|
|
|
|
|
|
|
|
557 |
|
|
|
|
|
|
|
|
|
|
|
558 |
return $result;
|
559 |
-
break;
|
560 |
|
561 |
-
case 'E#
|
562 |
|
563 |
-
if ( ! wppa_is_valid_integer( $data ) )
|
564 |
-
|
|
|
|
|
|
|
|
|
|
|
565 |
}
|
|
|
566 |
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
576 |
}
|
|
|
|
|
|
|
577 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
578 |
return $result;
|
579 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
580 |
|
581 |
-
|
582 |
|
583 |
-
|
584 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
585 |
}
|
|
|
586 |
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
case 2:
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
599 |
}
|
|
|
|
|
|
|
|
|
600 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
601 |
return $result;
|
602 |
-
break;
|
603 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
604 |
|
605 |
// Unformatted
|
606 |
default:
|
@@ -611,7 +2382,7 @@ global $wppa_exif_error_output;
|
|
611 |
|
612 |
// Empty data
|
613 |
else {
|
614 |
-
$result = '<span title="' . esc_attr( __( 'No data', 'wp-photo-album-plus' ) ) . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
615 |
}
|
616 |
|
617 |
return $result;
|
@@ -622,7 +2393,7 @@ global $wppa_exif_error_output;
|
|
622 |
|
623 |
// Must contain a '/'
|
624 |
if ( strpos( $data, '/' ) == false ) {
|
625 |
-
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Missing /', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
626 |
return false;
|
627 |
}
|
628 |
|
@@ -631,13 +2402,24 @@ global $wppa_exif_error_output;
|
|
631 |
|
632 |
// Divide by zero?
|
633 |
if ( $t[1] == 0 ) {
|
634 |
-
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Divide by zero', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
635 |
return false;
|
636 |
}
|
637 |
|
638 |
// Signed while not permitted?
|
639 |
if ( ! $signed && ( $t[0] < 0 || $t[1] < 0 ) ) {
|
640 |
-
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Must be positive', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
641 |
return false;
|
642 |
}
|
643 |
|
@@ -645,73 +2427,1332 @@ global $wppa_exif_error_output;
|
|
645 |
return true;
|
646 |
}
|
647 |
|
648 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
649 |
global $wppa_exif_error_output;
|
650 |
|
651 |
// Must be integer
|
652 |
if ( ! wppa_is_int( $data ) ) {
|
653 |
-
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Invalid format', 'wp-photo-album-plus' ) ) . ':' . $data . '" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
654 |
return false;
|
655 |
}
|
656 |
|
657 |
-
//
|
658 |
-
|
659 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
660 |
return false;
|
661 |
}
|
662 |
|
663 |
-
|
664 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
665 |
}
|
666 |
|
667 |
-
|
|
|
668 |
global $wpdb;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
669 |
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
675 |
|
676 |
-
|
677 |
-
|
678 |
|
679 |
-
|
680 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
681 |
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
687 |
}
|
688 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
689 |
}
|
690 |
}
|
|
|
|
|
691 |
}
|
692 |
|
693 |
-
|
|
|
694 |
global $wpdb;
|
695 |
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
701 |
|
702 |
-
|
703 |
-
|
704 |
|
705 |
-
|
706 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
707 |
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
713 |
}
|
714 |
}
|
715 |
}
|
716 |
}
|
|
|
|
|
|
|
|
|
717 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* exif and iptc common functions
|
6 |
+
* version 6.8.00
|
7 |
*
|
8 |
*
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
12 |
|
13 |
+
global $wppa_supported_camara_brands;
|
14 |
+
$wppa_supported_camara_brands = array( 'CANON', 'NIKON', 'SAMSUNG' );
|
15 |
+
|
16 |
// Translate iptc tags into photo dependant data inside a text
|
17 |
function wppa_filter_iptc($desc, $photo) {
|
18 |
global $wpdb;
|
98 |
|
99 |
if ( strpos($desc, 'E#') === false ) return $desc; // No tags in desc: Nothing to do
|
100 |
|
101 |
+
// Get the labels if not yet present
|
102 |
if ( ! is_array( $wppa_exif_labels ) ) {
|
103 |
$wppa_exif_labels = $wpdb->get_results( "SELECT * FROM `" . WPPA_EXIF . "` WHERE `photo` = '0' ORDER BY `tag`", ARRAY_A );
|
104 |
}
|
161 |
// Remove untranslated
|
162 |
$pos = strpos($temp, 'E#');
|
163 |
while ( $pos !== false ) {
|
164 |
+
$tmp = substr( $temp, 0, $pos ) . '<span title="' . esc_attr( __( 'No data', 'wp-photo-album-plus' ) ) . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>' . substr( $temp, $pos+6 );
|
165 |
$temp = $tmp;
|
166 |
$pos = strpos($temp, 'E#');
|
167 |
}
|
170 |
return $temp;
|
171 |
}
|
172 |
|
173 |
+
function wppa_format_exif( $tag, $data, $brand = '' ) {
|
174 |
global $wppa_exif_error_output;
|
175 |
|
176 |
+
if ( $data !== '' ) {
|
177 |
switch ( $tag ) {
|
178 |
|
179 |
+
case 'E#0001': // InteropIndex / CanonCameraSettings (Canon)
|
180 |
+
switch( $brand ) {
|
181 |
+
case 'CANON': // CanonCameraSettings (Canon)
|
182 |
+
$result = $data;
|
183 |
+
return $result;
|
184 |
+
break;
|
185 |
+
default: // InteropIndex
|
186 |
+
switch( $data ) {
|
187 |
+
case 'R03': $result = __( 'R03 - DCF option file (Adobe RGB)', 'wp-photo-album-plus' ); break;
|
188 |
+
case 'R98': $result = __( 'R98 - DCF basic file (sRGB)', 'wp-photo-album-plus' ); break;
|
189 |
+
case 'THM': $result = __( 'THM - DCF thumbnail file', 'wp-photo-album-plus' ); break;
|
190 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
191 |
+
}
|
192 |
+
return $result;
|
193 |
}
|
|
|
|
|
|
|
194 |
break;
|
195 |
|
196 |
+
case 'E#0002': // CanonFocalLength / DeviceType
|
197 |
+
switch( $brand ) {
|
198 |
+
case 'SAMSUNG': // DeviceType
|
199 |
+
switch( $data ) {
|
200 |
+
case 0x1000: $result = 'Compact Digital Camera'; break;
|
201 |
+
case 0x2000: $result = 'High-end NX Camera'; break;
|
202 |
+
case 0x3000: $result = 'HXM Video Camera'; break;
|
203 |
+
case 0x12000: $result = 'Cell Phone'; break;
|
204 |
+
case 0x300000: $result = 'SMX Video Camera'; break;
|
205 |
+
default: $result = $data;
|
206 |
+
}
|
207 |
+
return $result;
|
208 |
+
break;
|
209 |
|
210 |
+
default:
|
211 |
+
$result = $data;
|
212 |
+
return $data;
|
213 |
+
break;
|
214 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
break;
|
216 |
|
217 |
+
case 'E#0003': // CanonFlashInfo? / SamsungModelID
|
218 |
+
switch( $brand ) {
|
219 |
+
case 'SAMSUNG': // SamsungModelID
|
220 |
+
switch( $data ) {
|
221 |
+
case 0x100101c: $result = 'NX10'; break;
|
222 |
+
case 0x1001226: $result = 'HMX-S15BP'; break;
|
223 |
+
case 0x1001233: $result = 'HMX-Q10'; break;
|
224 |
+
case 0x1001234: $result = 'HMX-H304'; break;
|
225 |
+
case 0x100130c: $result = 'NX100'; break;
|
226 |
+
case 0x1001327: $result = 'NX11'; break;
|
227 |
+
case 0x170104b: $result = 'ES65, ES67 / VLUU ES65, ES67 / SL50'; break;
|
228 |
+
case 0x170104e: $result = 'ES70, ES71 / VLUU ES70, ES71 / SL600'; break;
|
229 |
+
case 0x1701052: $result = 'ES73 / VLUU ES73 / SL605'; break;
|
230 |
+
case 0x1701055: $result = 'ES25, ES27 / VLUU ES25, ES27 / SL45'; break;
|
231 |
+
case 0x1701300: $result = 'ES28 / VLUU ES28'; break;
|
232 |
+
case 0x1701303: $result = 'ES74,ES75,ES78 / VLUU ES75,ES78'; break;
|
233 |
+
case 0x2001046: $result = 'PL150 / VLUU PL150 / TL210 / PL151'; break;
|
234 |
+
case 0x2001048: $result = 'PL100 / TL205 / VLUU PL100 / PL101'; break;
|
235 |
+
case 0x2001311: $result = 'PL120,PL121 / VLUU PL120,PL121'; break;
|
236 |
+
case 0x2001315: $result = 'PL170,PL171 / VLUUPL170,PL171'; break;
|
237 |
+
case 0x200131e: $result = 'PL210, PL211 / VLUU PL210, PL211'; break;
|
238 |
+
case 0x2701317: $result = 'PL20,PL21 / VLUU PL20,PL21'; break;
|
239 |
+
case 0x2a0001b: $result = 'WP10 / VLUU WP10 / AQ100'; break;
|
240 |
+
case 0x3000000: $result = 'Various Models (0x3000000)'; break;
|
241 |
+
case 0x3a00018: $result = 'Various Models (0x3a00018)'; break;
|
242 |
+
case 0x400101f: $result = 'ST1000 / ST1100 / VLUU ST1000 / CL65'; break;
|
243 |
+
case 0x4001022: $result = 'ST550 / VLUU ST550 / TL225'; break;
|
244 |
+
case 0x4001025: $result = 'Various Models (0x4001025)'; break;
|
245 |
+
case 0x400103e: $result = 'VLUU ST5500, ST5500, CL80'; break;
|
246 |
+
case 0x4001041: $result = 'VLUU ST5000, ST5000, TL240'; break;
|
247 |
+
case 0x4001043: $result = 'ST70 / VLUU ST70 / ST71'; break;
|
248 |
+
case 0x400130a: $result = 'Various Models (0x400130a)'; break;
|
249 |
+
case 0x400130e: $result = 'ST90,ST91 / VLUU ST90,ST91'; break;
|
250 |
+
case 0x4001313: $result = 'VLUU ST95, ST95'; break;
|
251 |
+
case 0x4a00015: $result = 'VLUU ST60'; break;
|
252 |
+
case 0x4a0135b: $result = 'ST30, ST65 / VLUU ST65 / ST67'; break;
|
253 |
+
case 0x5000000: $result = 'Various Models (0x5000000)'; break;
|
254 |
+
case 0x5001038: $result = 'Various Models (0x5001038)'; break;
|
255 |
+
case 0x500103a: $result = 'WB650 / VLUU WB650 / WB660'; break;
|
256 |
+
case 0x500103c: $result = 'WB600 / VLUU WB600 / WB610'; break;
|
257 |
+
case 0x500133e: $result = 'WB150 / WB150F / WB152 / WB152F / WB151'; break;
|
258 |
+
case 0x5a0000f: $result = 'WB5000 / HZ25W'; break;
|
259 |
+
case 0x6001036: $result = 'EX1'; break;
|
260 |
+
case 0x700131c: $result = 'VLUU SH100, SH100'; break;
|
261 |
+
case 0x27127002: $result = 'SMX-C20N'; break;
|
262 |
+
default: $result = $data;
|
263 |
+
}
|
264 |
+
return $result;
|
265 |
+
break;
|
266 |
|
267 |
+
default:
|
268 |
+
$result = $data;
|
269 |
+
return $data;
|
270 |
+
break;
|
271 |
}
|
272 |
+
break;
|
273 |
|
274 |
+
case 'E#0004': // CanonShotInfo / Quality (Nikon)
|
275 |
+
case 'E#0005': // CanonPanorama / WhiteBalance (Nikon)
|
276 |
+
case 'E#0006': // CanonImageType / Sharpness (Nikon)
|
277 |
+
case 'E#0007': // CanonFirmwareVersion / FocusMode (Nikon)
|
278 |
+
case 'E#0008': // FileNumber (Canon) / FlashSetting (Nikon)
|
279 |
+
case 'E#0009': // OwnerName (Canon) / FlashType (Nikon)
|
280 |
+
case 'E#000A': // UnknownD30 (Canon)
|
281 |
+
case 'E#000B': // WhiteBalanceFineTune (Nikon)
|
282 |
+
case 'E#000C': // SerialNumber (Canon) / WB_RBLevels (Nikon)
|
283 |
+
case 'E#000D': // CanonCameraInfo / ProgramShift (Nikon)
|
284 |
+
case 'E#000E': // CanonFileLength / ExposureDifference (Nikon)
|
285 |
+
case 'E#000F': // CustomFunctions (Canon) / ISOSelection (Nikon)
|
286 |
+
$result = $data;
|
287 |
+
return $result;
|
288 |
+
break;
|
289 |
+
|
290 |
+
case 'E#0010': // CanonModelID (Canon) / DataDump (Nikon)
|
291 |
+
switch( $brand ) {
|
292 |
+
case 'CANON':
|
293 |
+
$data = dechex( $data );
|
294 |
+
switch( $data ) {
|
295 |
+
case '1010000': $result = 'PowerShot A30'; break;
|
296 |
+
case '1040000': $result = 'PowerShot S300 / Digital IXUS 300 / IXY Digital 300'; break;
|
297 |
+
case '1060000': $result = 'PowerShot A20'; break;
|
298 |
+
case '1080000': $result = 'PowerShot A10'; break;
|
299 |
+
case '1090000': $result = 'PowerShot S110 / Digital IXUS v / IXY Digital 200'; break;
|
300 |
+
case '1100000': $result = 'PowerShot G2'; break;
|
301 |
+
case '1110000': $result = 'PowerShot S40'; break;
|
302 |
+
case '1120000': $result = 'PowerShot S30'; break;
|
303 |
+
case '1130000': $result = 'PowerShot A40'; break;
|
304 |
+
case '1140000': $result = 'EOS D30'; break;
|
305 |
+
case '1150000': $result = 'PowerShot A100'; break;
|
306 |
+
case '1160000': $result = 'PowerShot S200 / Digital IXUS v2 / IXY Digital 200a'; break;
|
307 |
+
case '1170000': $result = 'PowerShot A200'; break;
|
308 |
+
case '1180000': $result = 'PowerShot S330 / Digital IXUS 330 / IXY Digital 300a'; break;
|
309 |
+
case '1190000': $result = 'PowerShot G3'; break;
|
310 |
+
case '1210000': $result = 'PowerShot S45'; break;
|
311 |
+
case '1230000': $result = 'PowerShot SD100 / Digital IXUS II / IXY Digital 30'; break;
|
312 |
+
case '1240000': $result = 'PowerShot S230 / Digital IXUS v3 / IXY Digital 320'; break;
|
313 |
+
case '1250000': $result = 'PowerShot A70'; break;
|
314 |
+
case '1260000': $result = 'PowerShot A60'; break;
|
315 |
+
case '1270000': $result = 'PowerShot S400 / Digital IXUS 400 / IXY Digital 400'; break;
|
316 |
+
case '1290000': $result = 'PowerShot G5'; break;
|
317 |
+
case '1300000': $result = 'PowerShot A300'; break;
|
318 |
+
case '1310000': $result = 'PowerShot S50'; break;
|
319 |
+
case '1340000': $result = 'PowerShot A80'; break;
|
320 |
+
case '1350000': $result = 'PowerShot SD10 / Digital IXUS i / IXY Digital L'; break;
|
321 |
+
case '1360000': $result = 'PowerShot S1 IS'; break;
|
322 |
+
case '1370000': $result = 'PowerShot Pro1'; break;
|
323 |
+
case '1380000': $result = 'PowerShot S70'; break;
|
324 |
+
case '1390000': $result = 'PowerShot S60'; break;
|
325 |
+
case '1400000': $result = 'PowerShot G6'; break;
|
326 |
+
case '1410000': $result = 'PowerShot S500 / Digital IXUS 500 / IXY Digital 500'; break;
|
327 |
+
case '1420000': $result = 'PowerShot A75'; break;
|
328 |
+
case '1440000': $result = 'PowerShot SD110 / Digital IXUS IIs / IXY Digital 30a'; break;
|
329 |
+
case '1450000': $result = 'PowerShot A400'; break;
|
330 |
+
case '1470000': $result = 'PowerShot A310'; break;
|
331 |
+
case '1490000': $result = 'PowerShot A85'; break;
|
332 |
+
case '1520000': $result = 'PowerShot S410 / Digital IXUS 430 / IXY Digital 450'; break;
|
333 |
+
case '1530000': $result = 'PowerShot A95'; break;
|
334 |
+
case '1540000': $result = 'PowerShot SD300 / Digital IXUS 40 / IXY Digital 50'; break;
|
335 |
+
case '1550000': $result = 'PowerShot SD200 / Digital IXUS 30 / IXY Digital 40'; break;
|
336 |
+
case '1560000': $result = 'PowerShot A520'; break;
|
337 |
+
case '1570000': $result = 'PowerShot A510'; break;
|
338 |
+
case '1590000': $result = 'PowerShot SD20 / Digital IXUS i5 / IXY Digital L2'; break;
|
339 |
+
case '1640000': $result = 'PowerShot S2 IS'; break;
|
340 |
+
case '1650000': $result = 'PowerShot SD430 / Digital IXUS Wireless / IXY Digital Wireless'; break;
|
341 |
+
case '1660000': $result = 'PowerShot SD500 / Digital IXUS 700 / IXY Digital 600'; break;
|
342 |
+
case '1668000': $result = 'EOS D60'; break;
|
343 |
+
case '1700000': $result = 'PowerShot SD30 / Digital IXUS i Zoom / IXY Digital L3'; break;
|
344 |
+
case '1740000': $result = 'PowerShot A430'; break;
|
345 |
+
case '1750000': $result = 'PowerShot A410'; break;
|
346 |
+
case '1760000': $result = 'PowerShot S80'; break;
|
347 |
+
case '1780000': $result = 'PowerShot A620'; break;
|
348 |
+
case '1790000': $result = 'PowerShot A610'; break;
|
349 |
+
case '1800000': $result = 'PowerShot SD630 / Digital IXUS 65 / IXY Digital 80'; break;
|
350 |
+
case '1810000': $result = 'PowerShot SD450 / Digital IXUS 55 / IXY Digital 60'; break;
|
351 |
+
case '1820000': $result = 'PowerShot TX1'; break;
|
352 |
+
case '1870000': $result = 'PowerShot SD400 / Digital IXUS 50 / IXY Digital 55'; break;
|
353 |
+
case '1880000': $result = 'PowerShot A420'; break;
|
354 |
+
case '1890000': $result = 'PowerShot SD900 / Digital IXUS 900 Ti / IXY Digital 1000'; break;
|
355 |
+
case '1900000': $result = 'PowerShot SD550 / Digital IXUS 750 / IXY Digital 700'; break;
|
356 |
+
case '1920000': $result = 'PowerShot A700'; break;
|
357 |
+
case '1940000': $result = 'PowerShot SD700 IS / Digital IXUS 800 IS / IXY Digital 800 IS'; break;
|
358 |
+
case '1950000': $result = 'PowerShot S3 IS'; break;
|
359 |
+
case '1960000': $result = 'PowerShot A540'; break;
|
360 |
+
case '1970000': $result = 'PowerShot SD600 / Digital IXUS 60 / IXY Digital 70'; break;
|
361 |
+
case '1980000': $result = 'PowerShot G7'; break;
|
362 |
+
case '1990000': $result = 'PowerShot A530'; break;
|
363 |
+
case '2000000': $result = 'PowerShot SD800 IS / Digital IXUS 850 IS / IXY Digital 900 IS'; break;
|
364 |
+
case '2010000': $result = 'PowerShot SD40 / Digital IXUS i7 / IXY Digital L4'; break;
|
365 |
+
case '2020000': $result = 'PowerShot A710 IS'; break;
|
366 |
+
case '2030000': $result = 'PowerShot A640'; break;
|
367 |
+
case '2040000': $result = 'PowerShot A630'; break;
|
368 |
+
case '2090000': $result = 'PowerShot S5 IS'; break;
|
369 |
+
case '2100000': $result = 'PowerShot A460'; break;
|
370 |
+
case '2120000': $result = 'PowerShot SD850 IS / Digital IXUS 950 IS / IXY Digital 810 IS'; break;
|
371 |
+
case '2130000': $result = 'PowerShot A570 IS'; break;
|
372 |
+
case '2140000': $result = 'PowerShot A560'; break;
|
373 |
+
case '2150000': $result = 'PowerShot SD750 / Digital IXUS 75 / IXY Digital 90'; break;
|
374 |
+
case '2160000': $result = 'PowerShot SD1000 / Digital IXUS 70 / IXY Digital 10'; break;
|
375 |
+
case '2180000': $result = 'PowerShot A550'; break;
|
376 |
+
case '2190000': $result = 'PowerShot A450'; break;
|
377 |
+
case '2230000': $result = 'PowerShot G9'; break;
|
378 |
+
case '2240000': $result = 'PowerShot A650 IS'; break;
|
379 |
+
case '2260000': $result = 'PowerShot A720 IS'; break;
|
380 |
+
case '2290000': $result = 'PowerShot SX100 IS'; break;
|
381 |
+
case '2300000': $result = 'PowerShot SD950 IS / Digital IXUS 960 IS / IXY Digital 2000 IS'; break;
|
382 |
+
case '2310000': $result = 'PowerShot SD870 IS / Digital IXUS 860 IS / IXY Digital 910 IS'; break;
|
383 |
+
case '2320000': $result = 'PowerShot SD890 IS / Digital IXUS 970 IS / IXY Digital 820 IS'; break;
|
384 |
+
case '2360000': $result = 'PowerShot SD790 IS / Digital IXUS 90 IS / IXY Digital 95 IS'; break;
|
385 |
+
case '2370000': $result = 'PowerShot SD770 IS / Digital IXUS 85 IS / IXY Digital 25 IS'; break;
|
386 |
+
case '2380000': $result = 'PowerShot A590 IS'; break;
|
387 |
+
case '2390000': $result = 'PowerShot A580'; break;
|
388 |
+
case '2420000': $result = 'PowerShot A470'; break;
|
389 |
+
case '2430000': $result = 'PowerShot SD1100 IS / Digital IXUS 80 IS / IXY Digital 20 IS'; break;
|
390 |
+
case '2460000': $result = 'PowerShot SX1 IS'; break;
|
391 |
+
case '2470000': $result = 'PowerShot SX10 IS'; break;
|
392 |
+
case '2480000': $result = 'PowerShot A1000 IS'; break;
|
393 |
+
case '2490000': $result = 'PowerShot G10'; break;
|
394 |
+
case '2510000': $result = 'PowerShot A2000 IS'; break;
|
395 |
+
case '2520000': $result = 'PowerShot SX110 IS'; break;
|
396 |
+
case '2530000': $result = 'PowerShot SD990 IS / Digital IXUS 980 IS / IXY Digital 3000 IS'; break;
|
397 |
+
case '2540000': $result = 'PowerShot SD880 IS / Digital IXUS 870 IS / IXY Digital 920 IS'; break;
|
398 |
+
case '2550000': $result = 'PowerShot E1'; break;
|
399 |
+
case '2560000': $result = 'PowerShot D10'; break;
|
400 |
+
case '2570000': $result = 'PowerShot SD960 IS / Digital IXUS 110 IS / IXY Digital 510 IS'; break;
|
401 |
+
case '2580000': $result = 'PowerShot A2100 IS'; break;
|
402 |
+
case '2590000': $result = 'PowerShot A480'; break;
|
403 |
+
case '2600000': $result = 'PowerShot SX200 IS'; break;
|
404 |
+
case '2610000': $result = 'PowerShot SD970 IS / Digital IXUS 990 IS / IXY Digital 830 IS'; break;
|
405 |
+
case '2620000': $result = 'PowerShot SD780 IS / Digital IXUS 100 IS / IXY Digital 210 IS'; break;
|
406 |
+
case '2630000': $result = 'PowerShot A1100 IS'; break;
|
407 |
+
case '2640000': $result = 'PowerShot SD1200 IS / Digital IXUS 95 IS / IXY Digital 110 IS'; break;
|
408 |
+
case '2700000': $result = 'PowerShot G11'; break;
|
409 |
+
case '2710000': $result = 'PowerShot SX120 IS'; break;
|
410 |
+
case '2720000': $result = 'PowerShot S90'; break;
|
411 |
+
case '2750000': $result = 'PowerShot SX20 IS'; break;
|
412 |
+
case '2760000': $result = 'PowerShot SD980 IS / Digital IXUS 200 IS / IXY Digital 930 IS'; break;
|
413 |
+
case '2770000': $result = 'PowerShot SD940 IS / Digital IXUS 120 IS / IXY Digital 220 IS'; break;
|
414 |
+
case '2800000': $result = 'PowerShot A495'; break;
|
415 |
+
case '2810000': $result = 'PowerShot A490'; break;
|
416 |
+
case '2820000': $result = 'PowerShot A3100/A3150 IS'; break;
|
417 |
+
case '2830000': $result = 'PowerShot A3000 IS'; break;
|
418 |
+
case '2840000': $result = 'PowerShot SD1400 IS / IXUS 130 / IXY 400F'; break;
|
419 |
+
case '2850000': $result = 'PowerShot SD1300 IS / IXUS 105 / IXY 200F'; break;
|
420 |
+
case '2860000': $result = 'PowerShot SD3500 IS / IXUS 210 / IXY 10S'; break;
|
421 |
+
case '2870000': $result = 'PowerShot SX210 IS'; break;
|
422 |
+
case '2880000': $result = 'PowerShot SD4000 IS / IXUS 300 HS / IXY 30S'; break;
|
423 |
+
case '2890000': $result = 'PowerShot SD4500 IS / IXUS 1000 HS / IXY 50S'; break;
|
424 |
+
case '2920000': $result = 'PowerShot G12'; break;
|
425 |
+
case '2930000': $result = 'PowerShot SX30 IS'; break;
|
426 |
+
case '2940000': $result = 'PowerShot SX130 IS'; break;
|
427 |
+
case '2950000': $result = 'PowerShot S95'; break;
|
428 |
+
case '2980000': $result = 'PowerShot A3300 IS'; break;
|
429 |
+
case '2990000': $result = 'PowerShot A3200 IS'; break;
|
430 |
+
case '3000000': $result = 'PowerShot ELPH 500 HS / IXUS 310 HS / IXY 31S'; break;
|
431 |
+
case '3010000': $result = 'PowerShot Pro90 IS'; break;
|
432 |
+
case '3010001': $result = 'PowerShot A800'; break;
|
433 |
+
case '3020000': $result = 'PowerShot ELPH 100 HS / IXUS 115 HS / IXY 210F'; break;
|
434 |
+
case '3030000': $result = 'PowerShot SX230 HS'; break;
|
435 |
+
case '3040000': $result = 'PowerShot ELPH 300 HS / IXUS 220 HS / IXY 410F'; break;
|
436 |
+
case '3050000': $result = 'PowerShot A2200'; break;
|
437 |
+
case '3060000': $result = 'PowerShot A1200'; break;
|
438 |
+
case '3070000': $result = 'PowerShot SX220 HS'; break;
|
439 |
+
case '3080000': $result = 'PowerShot G1 X'; break;
|
440 |
+
case '3090000': $result = 'PowerShot SX150 IS'; break;
|
441 |
+
case '3100000': $result = 'PowerShot ELPH 510 HS / IXUS 1100 HS / IXY 51S'; break;
|
442 |
+
case '3110000': $result = 'PowerShot S100 (new)'; break;
|
443 |
+
case '3120000': $result = 'PowerShot ELPH 310 HS / IXUS 230 HS / IXY 600F'; break;
|
444 |
+
case '3130000': $result = 'PowerShot SX40 HS'; break;
|
445 |
+
case '3140000': $result = 'IXY 32S'; break;
|
446 |
+
case '3160000': $result = 'PowerShot A1300'; break;
|
447 |
+
case '3170000': $result = 'PowerShot A810'; break;
|
448 |
+
case '3180000': $result = 'PowerShot ELPH 320 HS / IXUS 240 HS / IXY 420F'; break;
|
449 |
+
case '3190000': $result = 'PowerShot ELPH 110 HS / IXUS 125 HS / IXY 220F'; break;
|
450 |
+
case '3200000': $result = 'PowerShot D20'; break;
|
451 |
+
case '3210000': $result = 'PowerShot A4000 IS'; break;
|
452 |
+
case '3220000': $result = 'PowerShot SX260 HS'; break;
|
453 |
+
case '3230000': $result = 'PowerShot SX240 HS'; break;
|
454 |
+
case '3240000': $result = 'PowerShot ELPH 530 HS / IXUS 510 HS / IXY 1'; break;
|
455 |
+
case '3250000': $result = 'PowerShot ELPH 520 HS / IXUS 500 HS / IXY 3'; break;
|
456 |
+
case '3260000': $result = 'PowerShot A3400 IS'; break;
|
457 |
+
case '3270000': $result = 'PowerShot A2400 IS'; break;
|
458 |
+
case '3280000': $result = 'PowerShot A2300'; break;
|
459 |
+
case '3330000': $result = 'PowerShot G15'; break;
|
460 |
+
case '3340000': $result = 'PowerShot SX50 HS'; break;
|
461 |
+
case '3350000': $result = 'PowerShot SX160 IS'; break;
|
462 |
+
case '3360000': $result = 'PowerShot S110 (new)'; break;
|
463 |
+
case '3370000': $result = 'PowerShot SX500 IS'; break;
|
464 |
+
case '3380000': $result = 'PowerShot N'; break;
|
465 |
+
case '3390000': $result = 'IXUS 245 HS / IXY 430F'; break;
|
466 |
+
case '3400000': $result = 'PowerShot SX280 HS'; break;
|
467 |
+
case '3410000': $result = 'PowerShot SX270 HS'; break;
|
468 |
+
case '3420000': $result = 'PowerShot A3500 IS'; break;
|
469 |
+
case '3430000': $result = 'PowerShot A2600'; break;
|
470 |
+
case '3440000': $result = 'PowerShot SX275 HS'; break;
|
471 |
+
case '3450000': $result = 'PowerShot A1400'; break;
|
472 |
+
case '3460000': $result = 'PowerShot ELPH 130 IS / IXUS 140 / IXY 110F'; break;
|
473 |
+
case '3470000': $result = 'PowerShot ELPH 115/120 IS / IXUS 132/135 / IXY 90F/100F'; break;
|
474 |
+
case '3490000': $result = 'PowerShot ELPH 330 HS / IXUS 255 HS / IXY 610F'; break;
|
475 |
+
case '3510000': $result = 'PowerShot A2500'; break;
|
476 |
+
case '3540000': $result = 'PowerShot G16'; break;
|
477 |
+
case '3550000': $result = 'PowerShot S120'; break;
|
478 |
+
case '3560000': $result = 'PowerShot SX170 IS'; break;
|
479 |
+
case '3580000': $result = 'PowerShot SX510 HS'; break;
|
480 |
+
case '3590000': $result = 'PowerShot S200 (new)'; break;
|
481 |
+
case '3600000': $result = 'IXY 620F'; break;
|
482 |
+
case '3610000': $result = 'PowerShot N100'; break;
|
483 |
+
case '3640000': $result = 'PowerShot G1 X Mark II'; break;
|
484 |
+
case '3650000': $result = 'PowerShot D30'; break;
|
485 |
+
case '3660000': $result = 'PowerShot SX700 HS'; break;
|
486 |
+
case '3670000': $result = 'PowerShot SX600 HS'; break;
|
487 |
+
case '3680000': $result = 'PowerShot ELPH 140 IS / IXUS 150 / IXY 130'; break;
|
488 |
+
case '3690000': $result = 'PowerShot ELPH 135 / IXUS 145 / IXY 120'; break;
|
489 |
+
case '3700000': $result = 'PowerShot ELPH 340 HS / IXUS 265 HS / IXY 630'; break;
|
490 |
+
case '3710000': $result = 'PowerShot ELPH 150 IS / IXUS 155 / IXY 140'; break;
|
491 |
+
case '3740000': $result = 'EOS M3'; break;
|
492 |
+
case '3750000': $result = 'PowerShot SX60 HS'; break;
|
493 |
+
case '3760000': $result = 'PowerShot SX520 HS'; break;
|
494 |
+
case '3770000': $result = 'PowerShot SX400 IS'; break;
|
495 |
+
case '3780000': $result = 'PowerShot G7 X'; break;
|
496 |
+
case '3790000': $result = 'PowerShot N2'; break;
|
497 |
+
case '3800000': $result = 'PowerShot SX530 HS'; break;
|
498 |
+
case '3820000': $result = 'PowerShot SX710 HS'; break;
|
499 |
+
case '3830000': $result = 'PowerShot SX610 HS'; break;
|
500 |
+
case '3840000': $result = 'EOS M10'; break;
|
501 |
+
case '3850000': $result = 'PowerShot G3 X'; break;
|
502 |
+
case '3860000': $result = 'PowerShot ELPH 165 HS / IXUS 165 / IXY 160'; break;
|
503 |
+
case '3870000': $result = 'PowerShot ELPH 160 / IXUS 160'; break;
|
504 |
+
case '3880000': $result = 'PowerShot ELPH 350 HS / IXUS 275 HS / IXY 640'; break;
|
505 |
+
case '3890000': $result = 'PowerShot ELPH 170 IS / IXUS 170'; break;
|
506 |
+
case '3910000': $result = 'PowerShot SX410 IS'; break;
|
507 |
+
case '3930000': $result = 'PowerShot G9 X'; break;
|
508 |
+
case '3940000': $result = 'EOS M5'; break;
|
509 |
+
case '3950000': $result = 'PowerShot G5 X'; break;
|
510 |
+
case '3970000': $result = 'PowerShot G7 X Mark II'; break;
|
511 |
+
case '3980000': $result = 'EOS M100'; break;
|
512 |
+
case '3990000': $result = 'PowerShot ELPH 360 HS / IXUS 285 HS / IXY 650'; break;
|
513 |
+
case '4010000': $result = 'PowerShot SX540 HS'; break;
|
514 |
+
case '4020000': $result = 'PowerShot SX420 IS'; break;
|
515 |
+
case '4030000': $result = 'PowerShot ELPH 190 IS / IXUS 180 / IXY 190'; break;
|
516 |
+
case '4040000': $result = 'PowerShot G1'; break;
|
517 |
+
case '4040001': $result = 'IXY 180'; break;
|
518 |
+
case '4050000': $result = 'PowerShot SX720 HS'; break;
|
519 |
+
case '4060000': $result = 'PowerShot SX620 HS'; break;
|
520 |
+
case '4070000': $result = 'EOS M6'; break;
|
521 |
+
case '4100000': $result = 'PowerShot G9 X Mark II'; break;
|
522 |
+
case '4150000': $result = 'PowerShot ELPH 185 / IXUS 185 / IXY 200'; break;
|
523 |
+
case '4160000': $result = 'PowerShot SX430 IS'; break;
|
524 |
+
case '4170000': $result = 'PowerShot SX730 HS'; break;
|
525 |
+
case '4180000': $result = 'PowerShot G1 X Mark III'; break;
|
526 |
+
case '6040000': $result = 'PowerShot S100 / Digital IXUS / IXY Digital'; break;
|
527 |
+
case '4007d673': $result = 'DC19/DC21/DC22'; break;
|
528 |
+
case '4007d674': $result = 'XH A1'; break;
|
529 |
+
case '4007d675': $result = 'HV10'; break;
|
530 |
+
case '4007d676': $result = 'MD130/MD140/MD150/MD160/ZR850'; break;
|
531 |
+
case '4007d777': $result = 'DC50'; break;
|
532 |
+
case '4007d778': $result = 'HV20'; break;
|
533 |
+
case '4007d779': $result = 'DC211'; break;
|
534 |
+
case '4007d77a': $result = 'HG10'; break;
|
535 |
+
case '4007d77b': $result = 'HR10'; break;
|
536 |
+
case '4007d77d': $result = 'MD255/ZR950'; break;
|
537 |
+
case '4007d81c': $result = 'HF11'; break;
|
538 |
+
case '4007d878': $result = 'HV30'; break;
|
539 |
+
case '4007d87c': $result = 'XH A1S'; break;
|
540 |
+
case '4007d87e': $result = 'DC301/DC310/DC311/DC320/DC330'; break;
|
541 |
+
case '4007d87f': $result = 'FS100'; break;
|
542 |
+
case '4007d880': $result = 'HF10'; break;
|
543 |
+
case '4007d882': $result = 'HG20/HG21'; break;
|
544 |
+
case '4007d925': $result = 'HF21'; break;
|
545 |
+
case '4007d926': $result = 'HF S11'; break;
|
546 |
+
case '4007d978': $result = 'HV40'; break;
|
547 |
+
case '4007d987': $result = 'DC410/DC411/DC420'; break;
|
548 |
+
case '4007d988': $result = 'FS19/FS20/FS21/FS22/FS200'; break;
|
549 |
+
case '4007d989': $result = 'HF20/HF200'; break;
|
550 |
+
case '4007d98a': $result = 'HF S10/S100'; break;
|
551 |
+
case '4007da8e': $result = 'HF R10/R16/R17/R18/R100/R106'; break;
|
552 |
+
case '4007da8f': $result = 'HF M30/M31/M36/M300/M306'; break;
|
553 |
+
case '4007da90': $result = 'HF S20/S21/S200'; break;
|
554 |
+
case '4007da92': $result = 'FS31/FS36/FS37/FS300/FS305/FS306/FS307'; break;
|
555 |
+
case '4007dca0': $result = 'EOS C300'; break;
|
556 |
+
case '4007dda9': $result = 'HF G25'; break;
|
557 |
+
case '4007dfb4': $result = 'XC10'; break;
|
558 |
+
case '80000001': $result = 'EOS-1D'; break;
|
559 |
+
case '80000167': $result = 'EOS-1DS'; break;
|
560 |
+
case '80000168': $result = 'EOS 10D'; break;
|
561 |
+
case '80000169': $result = 'EOS-1D Mark III'; break;
|
562 |
+
case '80000170': $result = 'EOS Digital Rebel / 300D / Kiss Digital'; break;
|
563 |
+
case '80000174': $result = 'EOS-1D Mark II'; break;
|
564 |
+
case '80000175': $result = 'EOS 20D'; break;
|
565 |
+
case '80000176': $result = 'EOS Digital Rebel XSi / 450D / Kiss X2'; break;
|
566 |
+
case '80000188': $result = 'EOS-1Ds Mark II'; break;
|
567 |
+
case '80000189': $result = 'EOS Digital Rebel XT / 350D / Kiss Digital N'; break;
|
568 |
+
case '80000190': $result = 'EOS 40D'; break;
|
569 |
+
case '80000213': $result = 'EOS 5D'; break;
|
570 |
+
case '80000215': $result = 'EOS-1Ds Mark III'; break;
|
571 |
+
case '80000218': $result = 'EOS 5D Mark II'; break;
|
572 |
+
case '80000219': $result = 'WFT-E1'; break;
|
573 |
+
case '80000232': $result = 'EOS-1D Mark II N'; break;
|
574 |
+
case '80000234': $result = 'EOS 30D'; break;
|
575 |
+
case '80000236': $result = 'EOS Digital Rebel XTi / 400D / Kiss Digital X'; break;
|
576 |
+
case '80000241': $result = 'WFT-E2'; break;
|
577 |
+
case '80000246': $result = 'WFT-E3'; break;
|
578 |
+
case '80000250': $result = 'EOS 7D'; break;
|
579 |
+
case '80000252': $result = 'EOS Rebel T1i / 500D / Kiss X3'; break;
|
580 |
+
case '80000254': $result = 'EOS Rebel XS / 1000D / Kiss F'; break;
|
581 |
+
case '80000261': $result = 'EOS 50D'; break;
|
582 |
+
case '80000269': $result = 'EOS-1D X'; break;
|
583 |
+
case '80000270': $result = 'EOS Rebel T2i / 550D / Kiss X4'; break;
|
584 |
+
case '80000271': $result = 'WFT-E4'; break;
|
585 |
+
case '80000273': $result = 'WFT-E5'; break;
|
586 |
+
case '80000281': $result = 'EOS-1D Mark IV'; break;
|
587 |
+
case '80000285': $result = 'EOS 5D Mark III'; break;
|
588 |
+
case '80000286': $result = 'EOS Rebel T3i / 600D / Kiss X5'; break;
|
589 |
+
case '80000287': $result = 'EOS 60D'; break;
|
590 |
+
case '80000288': $result = 'EOS Rebel T3 / 1100D / Kiss X50'; break;
|
591 |
+
case '80000289': $result = 'EOS 7D Mark II'; break;
|
592 |
+
case '80000297': $result = 'WFT-E2 II'; break;
|
593 |
+
case '80000298': $result = 'WFT-E4 II'; break;
|
594 |
+
case '80000301': $result = 'EOS Rebel T4i / 650D / Kiss X6i'; break;
|
595 |
+
case '80000302': $result = 'EOS 6D'; break;
|
596 |
+
case '80000324': $result = 'EOS-1D C'; break;
|
597 |
+
case '80000325': $result = 'EOS 70D'; break;
|
598 |
+
case '80000326': $result = 'EOS Rebel T5i / 700D / Kiss X7i'; break;
|
599 |
+
case '80000327': $result = 'EOS Rebel T5 / 1200D / Kiss X70'; break;
|
600 |
+
case '80000328': $result = 'EOS-1D X MARK II'; break;
|
601 |
+
case '80000331': $result = 'EOS M'; break;
|
602 |
+
case '80000346': $result = 'EOS Rebel SL1 / 100D / Kiss X7'; break;
|
603 |
+
case '80000347': $result = 'EOS Rebel T6s / 760D / 8000D'; break;
|
604 |
+
case '80000349': $result = 'EOS 5D Mark IV'; break;
|
605 |
+
case '80000350': $result = 'EOS 80D'; break;
|
606 |
+
case '80000355': $result = 'EOS M2'; break;
|
607 |
+
case '80000382': $result = 'EOS 5DS'; break;
|
608 |
+
case '80000393': $result = 'EOS Rebel T6i / 750D / Kiss X8i'; break;
|
609 |
+
case '80000401': $result = 'EOS 5DS R'; break;
|
610 |
+
case '80000404': $result = 'EOS Rebel T6 / 1300D / Kiss X80'; break;
|
611 |
+
case '80000405': $result = 'EOS Rebel T7i / 800D / Kiss X9i'; break;
|
612 |
+
case '80000406': $result = 'EOS 6D Mark II'; break;
|
613 |
+
case '80000408': $result = 'EOS 77D / 9000D'; break;
|
614 |
+
case '80000417': $result = 'EOS Rebel SL2 / 200D / Kiss X9'; break;
|
615 |
+
|
616 |
+
default:
|
617 |
+
$result = $data;
|
618 |
+
}
|
619 |
+
return $result;
|
620 |
break;
|
621 |
+
case 'NIKON':
|
622 |
+
$result = $data;
|
623 |
+
return $result;
|
624 |
break;
|
625 |
default:
|
626 |
+
$result = $data;
|
627 |
+
return $result;
|
628 |
}
|
|
|
629 |
break;
|
630 |
|
631 |
+
case 'E#0011': // MovieInfo / OrientationInfo
|
632 |
+
switch( $brand ) {
|
633 |
+
case 'SAMSUNG': // OrientationInfo
|
634 |
|
635 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
636 |
+
return $wppa_exif_error_output;
|
637 |
+
}
|
638 |
|
639 |
+
$temp = explode( '/', $data );
|
640 |
+
$x = $temp[0];
|
641 |
+
$y = $temp[1];
|
642 |
|
643 |
+
$result = ( $x / $y ) . ' ' . __( 'degrees', 'wp-photo-album-plus' );
|
|
|
|
|
|
|
644 |
|
645 |
+
return $result;
|
646 |
+
break;
|
647 |
+
default:
|
648 |
+
$result = $data;
|
649 |
+
return $result;
|
650 |
+
}
|
651 |
break;
|
652 |
|
653 |
+
case 'E#0012': // CanonAFInfo
|
654 |
+
case 'E#0013': // ThumbnailImageValidArea
|
655 |
+
$result = $data;
|
656 |
+
return $result;
|
657 |
|
658 |
+
case 'E#0015': // SerialNumberFormat
|
659 |
+
|
660 |
+
switch( $brand ) {
|
661 |
+
case 'CANON':
|
662 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
663 |
+
$data = dechex( $data );
|
664 |
+
switch( $data ) {
|
665 |
+
case '90000000': $result = __( 'Format 1', 'wp-photo-album-plus' ); break;
|
666 |
+
case 'a0000000': $result = __( 'Format 2', 'wp-photo-album-plus' ); break;
|
667 |
+
default: $result = __( 'undefined', 'wp-photo-album-plus' );
|
668 |
+
}
|
669 |
+
return $result;
|
670 |
+
default:
|
671 |
+
$result = $data;
|
672 |
+
return $result;
|
673 |
}
|
674 |
+
break;
|
675 |
|
676 |
+
case 'E#001A': // SuperMacro
|
677 |
+
case 'E#001C': // DateStampMode
|
678 |
+
case 'E#001D': // MyColors
|
679 |
+
$result = $data;
|
680 |
+
return $result;
|
681 |
+
|
682 |
+
case 'E#001E': // FirmwareRevision (Canon) / ColorSpace (Nikon)
|
683 |
+
switch( $brand ) {
|
684 |
+
case 'CANON':
|
685 |
+
$result = $data;
|
686 |
+
return $result;
|
687 |
break;
|
688 |
+
case 'NIKON':
|
689 |
+
switch( $data ) {
|
690 |
+
case 1: $result = 'sRGB'; break;
|
691 |
+
case 2: $result = 'Adobe RGB'; break;
|
692 |
+
default: $result = $data;
|
693 |
+
}
|
694 |
+
return $result;
|
695 |
break;
|
696 |
default:
|
697 |
+
$result = $data;
|
698 |
+
return $result;
|
699 |
}
|
|
|
|
|
700 |
break;
|
701 |
|
702 |
+
case 'E#0020': // SmartAlbumColor ( samsung ) / ImageAuthentication (Nikon)
|
703 |
+
switch( $brand ) {
|
704 |
+
case 'SAMSUNG':
|
705 |
+
switch( $data ) {
|
706 |
+
case '0 0': $result = __( 'n.a.', 'wp-photo-album-plus' ); break;
|
707 |
+
case 0: $result = __( 'Red', 'wp-photo-album-plus' ); break;
|
708 |
+
case 1: $result = __( 'Yellow', 'wp-photo-album-plus' ); break;
|
709 |
+
case 2: $result = __( 'Green', 'wp-photo-album-plus' ); break;
|
710 |
+
case 3: $result = __( 'Blue', 'wp-photo-album-plus' ); break;
|
711 |
+
case 4: $result = __( 'Magenta', 'wp-photo-album-plus' ); break;
|
712 |
+
case 5: $result = __( 'Black', 'wp-photo-album-plus' ); break;
|
713 |
+
case 6: $result = __( 'White', 'wp-photo-album-plus' ); break;
|
714 |
+
case 7: $result = __( 'Various', 'wp-photo-album-plus' ); break;
|
715 |
+
default: $result = $data;
|
716 |
+
}
|
717 |
+
return $result;
|
718 |
+
break;
|
719 |
+
case 'NIKON':
|
720 |
+
switch( $data ) {
|
721 |
+
case 0: $result = __( 'Off', 'wp-photo-album-plus' ); break;
|
722 |
+
case 1: $result = __( 'On', 'wp-photo-album-plus' ); break;
|
723 |
+
default: $result = $data;
|
724 |
+
}
|
725 |
+
return $result;
|
726 |
+
default:
|
727 |
+
$result = $data;
|
728 |
+
return $result;
|
729 |
}
|
730 |
|
731 |
+
case 'E#0023': // Categories
|
732 |
+
case 'E#0024': // FaceDetect1
|
733 |
+
case 'E#0025': // FaceDetect2
|
734 |
+
case 'E#0026': // CanonAFInfo2
|
735 |
+
case 'E#0027': // ContrastInfo
|
736 |
+
case 'E#0028': // ImageUniqueID
|
737 |
+
case 'E#002F': // FaceDetect3
|
738 |
+
case 'E#0035': // TimeInfo
|
739 |
+
case 'E#003C': // AFInfo3
|
740 |
+
case 'E#0081': // RawDataOffset
|
741 |
+
case 'E#0083': // OriginalDecisionDataOffset
|
742 |
+
case 'E#0090': // CustomFunctions1D
|
743 |
+
case 'E#0091': // PersonalFunctions
|
744 |
+
case 'E#0092': // PersonalFunctionValues
|
745 |
+
case 'E#0093': // CanonFileInfo
|
746 |
+
case 'E#0094': // AFPointsInFocus1D
|
747 |
+
case 'E#0095': // LensModel
|
748 |
+
case 'E#0096': // SerialInfo
|
749 |
+
case 'E#0097': // DustRemovalData
|
750 |
+
case 'E#0098': // CropInfo
|
751 |
+
case 'E#0099': // CustomFunctions2
|
752 |
+
case 'E#009A': // AspectInfo
|
753 |
+
case 'E#00A0': // ProcessingInfo
|
754 |
+
case 'E#00A1': // ToneCurveTable
|
755 |
+
case 'E#00A2': // SharpnessTable
|
756 |
+
case 'E#00A3': // SharpnessFreqTable
|
757 |
+
case 'E#00A4': // WhiteBalanceTable
|
758 |
+
case 'E#00A9': // ColorBalance
|
759 |
+
case 'E#00AA': // MeasuredColor
|
760 |
+
case 'E#00AE': // ColorTemperature
|
761 |
+
case 'E#00B0': // CanonFlags
|
762 |
+
case 'E#00B1': // ModifiedInfo
|
763 |
+
case 'E#00B2': // ToneCurveMatching
|
764 |
+
case 'E#00B3': // WhiteBalanceMatching
|
765 |
+
case 'E#00B4': // ColorSpace
|
766 |
+
case 'E#00B6': // PreviewImageInfo
|
767 |
+
case 'E#00D0': // VRDOffset
|
768 |
+
case 'E#00E0': // SensorInfo
|
769 |
|
770 |
+
$result = $data;
|
771 |
return $result;
|
772 |
break;
|
773 |
|
774 |
+
case 'E#00FE': // SubfileType (called NewSubfileType by the TIFF specification)
|
775 |
+
|
776 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
777 |
+
|
778 |
+
switch( $data ) {
|
779 |
+
case 0x0: $result = __( 'Full-resolution Image', 'wp-photo-album-plus' ); break;
|
780 |
+
case 0x1: $result = __( 'Reduced-resolution image', 'wp-photo-album-plus' ); break;
|
781 |
+
case 0x2: $result = __( 'Single page of multi-page image', 'wp-photo-album-plus' ); break;
|
782 |
+
case 0x3: $result = __( 'Single page of multi-page reduced-resolution image', 'wp-photo-album-plus' ); break;
|
783 |
+
case 0x4: $result = __( 'Transparency mask', 'wp-photo-album-plus' ); break;
|
784 |
+
case 0x5: $result = __( 'Transparency mask of reduced-resolution image', 'wp-photo-album-plus' ); break;
|
785 |
+
case 0x6: $result = __( 'Transparency mask of multi-page image', 'wp-photo-album-plus' ); break;
|
786 |
+
case 0x7: $result = __( 'Transparency mask of reduced-resolution multi-page image', 'wp-photo-album-plus' ); break;
|
787 |
+
case 0x10001: $result = __( 'Alternate reduced-resolution image', 'wp-photo-album-plus' ); break;
|
788 |
+
case 0xffffffff: $result = __( 'invalid', 'wp-photo-album-plus' ); break;
|
789 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
790 |
+
}
|
791 |
+
return $result;
|
792 |
|
793 |
+
case 'E#00FF': // OldSubfileType (called SubfileType by the TIFF specification)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
794 |
|
795 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
796 |
return $wppa_exif_error_output;
|
797 |
}
|
798 |
|
799 |
+
switch( $data ) {
|
800 |
+
case 1: $result = __( 'Full-resolution image', 'wp-photo-album-plus' ); break;
|
801 |
+
case 2: $result = __( 'Reduced-resolution image', 'wp-photo-album-plus' ); break;
|
802 |
+
case 3: $result = __( 'Single page of multi-page image', 'wp-photo-album-plus' ); break;
|
803 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
|
|
|
|
|
|
|
|
|
|
|
|
804 |
}
|
805 |
return $result;
|
|
|
806 |
|
807 |
+
case 'E#0100': // Image width (pixels), Short or long, 1 item
|
808 |
+
case 'E#0101': // Image length (pixels), Short or long, 1 item
|
809 |
+
|
810 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
|
|
811 |
return $wppa_exif_error_output;
|
812 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
813 |
|
814 |
+
$result = $data . ' ' . __( 'px.', 'wp-photo-album-plus' );
|
815 |
+
return $result;
|
816 |
+
break;
|
817 |
|
818 |
+
case 'E#0106': // PhotometricInterpretation
|
819 |
+
|
820 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
821 |
+
|
822 |
+
switch( $data ) {
|
823 |
+
case 0: $result = __( 'WhiteIsZero', 'wp-photo-album-plus' ); break;
|
824 |
+
case 1: $result = __( 'BlackIsZero', 'wp-photo-album-plus' ); break;
|
825 |
+
case 2: $result = __( 'RGB', 'wp-photo-album-plus' ); break;
|
826 |
+
case 3: $result = __( 'RGB Palette', 'wp-photo-album-plus' ); break;
|
827 |
+
case 4: $result = __( 'Transparency Mask', 'wp-photo-album-plus' ); break;
|
828 |
+
case 5: $result = __( 'CMYK', 'wp-photo-album-plus' ); break;
|
829 |
+
case 6: $result = __( 'YCbCr', 'wp-photo-album-plus' ); break;
|
830 |
+
case 8: $result = __( 'CIELab', 'wp-photo-album-plus' ); break;
|
831 |
+
case 9: $result = __( 'ICCLab', 'wp-photo-album-plus' ); break;
|
832 |
+
case 10: $result = __( 'ITULab', 'wp-photo-album-plus' ); break;
|
833 |
+
case 32803: $result = __( 'Color Filter Array', 'wp-photo-album-plus' ); break;
|
834 |
+
case 32844: $result = __( 'Pixar LogL', 'wp-photo-album-plus' ); break;
|
835 |
+
case 32845: $result = __( 'Pixar LogLuv', 'wp-photo-album-plus' ); break;
|
836 |
+
case 34892: $result = __( 'Linear Raw', 'wp-photo-album-plus' ); break;
|
837 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
838 |
}
|
839 |
+
return $result;
|
840 |
|
841 |
+
case 'E#0107': // Thresholding
|
|
|
|
|
|
|
842 |
|
843 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
|
|
|
|
|
|
|
|
844 |
|
845 |
+
switch( $data ) {
|
846 |
+
case 1: $result = __( 'No dithering or halftoning', 'wp-photo-album-plus' ); break;
|
847 |
+
case 2: $result = __( 'Ordered dither or halftone', 'wp-photo-album-plus' ); break;
|
848 |
+
case 3: $result = __( 'Randomized dither', 'wp-photo-album-plus' ); break;
|
849 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
850 |
}
|
851 |
+
return $result;
|
852 |
|
853 |
+
case 'E#010A': // FillOrder
|
|
|
|
|
|
|
|
|
854 |
|
855 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
856 |
|
857 |
+
switch( $data ) {
|
858 |
+
case 1: $result = __( 'Normal', 'wp-photo-album-plus' ); break;
|
859 |
+
case 2: $result = __( 'Reversed', 'wp-photo-album-plus' ); break;
|
860 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
|
|
|
|
|
|
|
|
|
|
|
|
861 |
}
|
862 |
+
return $result;
|
863 |
+
|
864 |
+
case 'E#0112': // Orientation
|
865 |
+
|
866 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
867 |
+
|
868 |
+
switch( $data ) {
|
869 |
+
case 1: $result = __( 'Horizontal (normal)', 'wp-photo-album-plus' ); break;
|
870 |
+
case 2: $result = __( 'Mirror horizontal', 'wp-photo-album-plus' ); break;
|
871 |
+
case 3: $result = __( 'Rotate 180', 'wp-photo-album-plus' ); break;
|
872 |
+
case 4: $result = __( 'Mirror vertical', 'wp-photo-album-plus' ); break;
|
873 |
+
case 5: $result = __( 'Mirror horizontal and rotate 270 CW', 'wp-photo-album-plus' ); break;
|
874 |
+
case 6: $result = __( 'Rotate 90 CW', 'wp-photo-album-plus' ); break;
|
875 |
+
case 7: $result = __( 'Mirror horizontal and rotate 90 CW', 'wp-photo-album-plus' ); break;
|
876 |
+
case 8: $result = __( 'Rotate 270 CW', 'wp-photo-album-plus' ); break;
|
877 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
878 |
}
|
879 |
return $result;
|
|
|
880 |
|
881 |
+
case 'E#011A': // XResolution
|
882 |
+
case 'E#011B': // YResolution
|
883 |
|
|
|
884 |
if ( ! wppa_is_valid_rational( $data ) ) {
|
885 |
return $wppa_exif_error_output;
|
886 |
}
|
890 |
$x = $temp[0];
|
891 |
$y = $temp[1];
|
892 |
|
893 |
+
$result = ( $x / $y );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
894 |
return $result;
|
895 |
break;
|
896 |
|
897 |
+
case 'E#011C': // PlanarConfiguration
|
|
|
898 |
|
899 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
900 |
+
|
901 |
+
switch( $data ) {
|
902 |
+
case 1: $result = __( 'Chunky', 'wp-photo-album-plus' ); break;
|
903 |
+
case 2: $result = __( 'Planar', 'wp-photo-album-plus' ); break;
|
904 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
905 |
}
|
906 |
+
return $result;
|
907 |
+
break;
|
908 |
|
909 |
+
case 'E#0122': // GrayResponseUnit
|
|
|
|
|
|
|
910 |
|
911 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
912 |
+
|
913 |
+
switch( $data ) {
|
914 |
+
case 1: $result = '0.1'; break;
|
915 |
+
case 2: $result = '0.001'; break;
|
916 |
+
case 3: $result = '0.0001'; break;
|
917 |
+
case 4: $result = '1e-05'; break;
|
918 |
+
case 5: $result = '1e-06'; break;
|
919 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
920 |
+
}
|
921 |
return $result;
|
922 |
break;
|
923 |
|
924 |
+
case 'E#0124': // T4Options
|
|
|
|
|
|
|
925 |
|
926 |
+
$result = '';
|
927 |
+
if ( $data & 0x0001 ) $result .= __( '2-Dimensional encoding', 'wp-photo-album-plus' ) . ' ';
|
928 |
+
if ( $data & 0x0002 ) $result .= __( 'Uncompressed', 'wp-photo-album-plus' ) . ' ';
|
929 |
+
if ( $data & 0x0004 ) $result .= __( 'Fill bits added', 'wp-photo-album-plus' );
|
930 |
+
$result = trim( $result );
|
931 |
+
if ( ! $result ) $result = __( 'Undefined', 'wp-photo-album-plus' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
932 |
return $result;
|
933 |
break;
|
934 |
|
935 |
+
case 'E#0125': // T6Options
|
936 |
+
if ( $data & 0x0001 ) $result = __( 'Uncompressed', 'wp-photo-album-plus' );
|
937 |
+
else $result = __( 'Undefined', 'wp-photo-album-plus' );
|
938 |
return $result;
|
939 |
break;
|
940 |
|
941 |
+
case 'E#0128': // Resolution unit
|
942 |
+
|
943 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
944 |
+
|
945 |
switch ( $data ) {
|
946 |
+
case 2: $result = __( 'inches', 'wp-photo-album-plus' ); break;
|
947 |
+
case 3: $result = __( 'centimeters', 'wp-photo-album-plus' ); break;
|
948 |
+
default: $result = __( 'reserved', 'wp-photo-album-plus' );
|
|
|
|
|
|
|
|
|
|
|
|
|
949 |
}
|
950 |
return $result;
|
951 |
break;
|
952 |
|
953 |
+
case 'E#013D': // Predictor
|
954 |
+
|
955 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
956 |
+
|
957 |
switch ( $data ) {
|
958 |
+
case 1: $result = __( 'None', 'wp-photo-album-plus' ); break;
|
959 |
+
case 2: $result = __( 'Horizontal differencing', 'wp-photo-album-plus' ); break;
|
960 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
961 |
+
}
|
962 |
+
return $result;
|
963 |
+
break;
|
964 |
+
|
965 |
+
case 'E#0147': // CleanFaxData
|
966 |
+
|
967 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
968 |
+
|
969 |
+
switch ( $data ) {
|
970 |
+
case 0: $result = __( 'Clean', 'wp-photo-album-plus' ); break;
|
971 |
+
case 1: $result = __( 'Regenerated', 'wp-photo-album-plus' ); break;
|
972 |
+
case 2: $result = __( 'Unclean', 'wp-photo-album-plus' ); break;
|
973 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
974 |
+
}
|
975 |
+
return $result;
|
976 |
+
break;
|
977 |
+
|
978 |
+
case 'E#014C': // InkSet
|
979 |
+
|
980 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
981 |
+
|
982 |
+
switch ( $data ) {
|
983 |
+
case 1: $result = __( 'CMYK', 'wp-photo-album-plus' ); break;
|
984 |
+
case 2: $result = __( 'Not CMYK', 'wp-photo-album-plus' ); break;
|
985 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
986 |
+
}
|
987 |
+
return $result;
|
988 |
+
break;
|
989 |
+
|
990 |
+
case 'E#0152': // ExtraSamples
|
991 |
+
|
992 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
993 |
+
|
994 |
+
switch ( $data ) {
|
995 |
+
case 0: $result = __( 'Unspecified', 'wp-photo-album-plus' ); break;
|
996 |
+
case 1: $result = __( 'Associated Alpha', 'wp-photo-album-plus' ); break;
|
997 |
+
case 2: $result = __( 'Unassociated Alpha', 'wp-photo-album-plus' ); break;
|
998 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
999 |
+
}
|
1000 |
+
return $result;
|
1001 |
+
break;
|
1002 |
+
|
1003 |
+
case 'E#0153': // SampleFormat
|
1004 |
+
|
1005 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1006 |
+
|
1007 |
+
switch ( $data ) {
|
1008 |
+
case 1: $result = __( 'Unsigned', 'wp-photo-album-plus' ); break;
|
1009 |
+
case 2: $result = __( 'Signed', 'wp-photo-album-plus' ); break;
|
1010 |
+
case 3: $result = __( 'Float', 'wp-photo-album-plus' ); break;
|
1011 |
+
case 4: $result = __( 'Undefined', 'wp-photo-album-plus' ); break;
|
1012 |
+
case 5: $result = __( 'Complex int', 'wp-photo-album-plus' ); break;
|
1013 |
+
case 6: $result = __( 'Complex float', 'wp-photo-album-plus' ); break;
|
1014 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
1015 |
+
}
|
1016 |
+
return $result;
|
1017 |
+
break;
|
1018 |
+
|
1019 |
+
case 'E#015A': // Indexed
|
1020 |
+
|
1021 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1022 |
+
|
1023 |
+
switch ( $data ) {
|
1024 |
+
case 0: $result = __( 'Not indexed', 'wp-photo-album-plus' ); break;
|
1025 |
+
case 1: $result = __( 'Indexed', 'wp-photo-album-plus' ); break;
|
1026 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
1027 |
+
}
|
1028 |
+
return $result;
|
1029 |
+
break;
|
1030 |
+
|
1031 |
+
case 'E#015F': // OPIProxy
|
1032 |
+
|
1033 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1034 |
+
|
1035 |
+
switch ( $data ) {
|
1036 |
+
case 0: $result = __( 'Higher resolution image does not exist', 'wp-photo-album-plus' ); break;
|
1037 |
+
case 1: $result = __( 'Higher resolution image exists', 'wp-photo-album-plus' ); break;
|
1038 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
1039 |
+
}
|
1040 |
+
return $result;
|
1041 |
+
break;
|
1042 |
+
|
1043 |
+
case 'E#0191': // ProfileType
|
1044 |
+
|
1045 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1046 |
+
|
1047 |
+
switch ( $data ) {
|
1048 |
+
case 0: $result = __( 'Unspecified', 'wp-photo-album-plus' ); break;
|
1049 |
+
case 1: $result = __( 'Group 3 FAX', 'wp-photo-album-plus' ); break;
|
1050 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
1051 |
+
}
|
1052 |
+
return $result;
|
1053 |
+
break;
|
1054 |
+
|
1055 |
+
case 'E#0192': // FaxProfile
|
1056 |
+
|
1057 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1058 |
+
|
1059 |
+
switch ( $data ) {
|
1060 |
+
case 0: $result = __( 'Unknown', 'wp-photo-album-plus' ); break;
|
1061 |
+
case 1: $result = __( 'Minimal B&W lossless, S', 'wp-photo-album-plus' ); break;
|
1062 |
+
case 2: $result = __( 'Extended B&W lossless, F', 'wp-photo-album-plus' ); break;
|
1063 |
+
case 3: $result = __( 'Lossless JBIG B&W, J', 'wp-photo-album-plus' ); break;
|
1064 |
+
case 4: $result = __( 'Lossy color and grayscale, C', 'wp-photo-album-plus' ); break;
|
1065 |
+
case 5: $result = __( 'Lossless color and grayscale, L', 'wp-photo-album-plus' ); break;
|
1066 |
+
case 6: $result = __( 'Mixed raster content, M', 'wp-photo-album-plus' ); break;
|
1067 |
+
case 7: $result = __( 'Profile T', 'wp-photo-album-plus' ); break;
|
1068 |
+
case 255: $result = __( 'Multi Profiles', 'wp-photo-album-plus' ); break;
|
1069 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
1070 |
+
}
|
1071 |
+
return $result;
|
1072 |
+
break;
|
1073 |
+
|
1074 |
+
case 'E#0193': // CodingMethods
|
1075 |
+
|
1076 |
+
$result = '';
|
1077 |
+
if ( $data & 0x01 ) {
|
1078 |
+
$result .= __( 'Unspecified compression', 'wp-photo-album-plus' ) . ', ';
|
1079 |
+
}
|
1080 |
+
if ( $data & 0x02 ) {
|
1081 |
+
$result .= __( 'Modified Huffman', 'wp-photo-album-plus' ) . ', ';
|
1082 |
+
}
|
1083 |
+
if ( $data & 0x04 ) {
|
1084 |
+
$result .= __( 'Modified Read', 'wp-photo-album-plus' ) . ', ';
|
1085 |
+
}
|
1086 |
+
if ( $data & 0x08 ) {
|
1087 |
+
$result .= __( 'Modified MR', 'wp-photo-album-plus' ) . ', ';
|
1088 |
+
}
|
1089 |
+
if ( $data & 0x10 ) {
|
1090 |
+
$result .= __( 'JBIG', 'wp-photo-album-plus' ) . ', ';
|
1091 |
+
}
|
1092 |
+
if ( $data & 0x20 ) {
|
1093 |
+
$result .= __( 'Baseline JPEG', 'wp-photo-album-plus' ) . ', ';
|
1094 |
+
}
|
1095 |
+
if ( $data & 0x40 ) {
|
1096 |
+
$result .= __( 'JBIG color', 'wp-photo-album-plus' ) . ', ';
|
1097 |
+
}
|
1098 |
+
$result = trim( $result, ', ' );
|
1099 |
+
if ( ! $result ) $result = __( 'Undefined', 'wp-photo-album-plus' );
|
1100 |
+
return $result;
|
1101 |
+
break;
|
1102 |
+
|
1103 |
+
case 'E#A210': // FocalPlaneResolutionUnit
|
1104 |
+
|
1105 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1106 |
+
|
1107 |
+
switch ( $data ) {
|
1108 |
+
case 2: $result = __( 'inches', 'wp-photo-album-plus' ); break;
|
1109 |
+
case 3: $result = __( 'centimeters', 'wp-photo-album-plus' ); break;
|
1110 |
+
default: $result = __( 'reserved', 'wp-photo-album-plus' );
|
1111 |
+
}
|
1112 |
+
return $result;
|
1113 |
+
break;
|
1114 |
+
|
1115 |
+
case 'E#0212': // YCbCrSubSampling
|
1116 |
+
|
1117 |
+
/*
|
1118 |
+
'1 1' = YCbCr4:4:4 (1 1)
|
1119 |
+
'1 2' = YCbCr4:4:0 (1 2)
|
1120 |
+
'1 4' = YCbCr4:4:1 (1 4)
|
1121 |
+
'2 1' = YCbCr4:2:2 (2 1)
|
1122 |
+
'2 2' = YCbCr4:2:0 (2 2)
|
1123 |
+
'2 4' = YCbCr4:2:1 (2 4)
|
1124 |
+
'4 1' = YCbCr4:1:1 (4 1)
|
1125 |
+
'4 2' = YCbCr4:1:0 (4 2)
|
1126 |
+
*/
|
1127 |
+
$result = $data;
|
1128 |
+
return $result;
|
1129 |
+
break;
|
1130 |
+
|
1131 |
+
case 'E#0213': // YCbCrPositioning
|
1132 |
+
|
1133 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1134 |
+
|
1135 |
+
switch ( $data ) {
|
1136 |
+
case 1:
|
1137 |
+
$result = __( 'centered', 'wp-photo-album-plus' );
|
1138 |
+
break;
|
1139 |
+
case 2:
|
1140 |
+
$result = __( 'co-sited', 'wp-photo-album-plus' );
|
1141 |
+
break;
|
1142 |
+
default:
|
1143 |
+
$result = __( 'reserved', 'wp-photo-album-plus' );
|
1144 |
+
}
|
1145 |
+
|
1146 |
+
return $result;
|
1147 |
+
break;
|
1148 |
+
|
1149 |
+
case 'E#4001': // ColorData
|
1150 |
+
case 'E#4002': // CRWParam?
|
1151 |
+
case 'E#4003': // ColorInfo
|
1152 |
+
case 'E#4005': // Flavor?
|
1153 |
+
|
1154 |
+
$result = $data;
|
1155 |
+
return $result;
|
1156 |
+
break;
|
1157 |
+
|
1158 |
+
case 'E#4008': // PictureStyleUserDef
|
1159 |
+
switch( $brand ) {
|
1160 |
+
case 'CANON':
|
1161 |
+
switch( $data ) {
|
1162 |
+
case 0x0: $result = __( 'None', 'wp-photo-album-plus' ); break;
|
1163 |
+
case 0x1: $result = __( 'Standard', 'wp-photo-album-plus' ); break;
|
1164 |
+
case 0x2: $result = __( 'Portrait', 'wp-photo-album-plus' ); break;
|
1165 |
+
case 0x3: $result = __( 'High Saturation', 'wp-photo-album-plus' ); break;
|
1166 |
+
case 0x4: $result = __( 'Adobe RGB', 'wp-photo-album-plus' ); break;
|
1167 |
+
case 0x5: $result = __( 'Low Saturation', 'wp-photo-album-plus' ); break;
|
1168 |
+
case 0x6: $result = __( 'CM Set 1', 'wp-photo-album-plus' ); break;
|
1169 |
+
case 0x7: $result = __( 'CM Set 2', 'wp-photo-album-plus' ); break;
|
1170 |
+
case 0x21: $result = __( 'User Def. 1', 'wp-photo-album-plus' ); break;
|
1171 |
+
case 0x22: $result = __( 'User Def. 2', 'wp-photo-album-plus' ); break;
|
1172 |
+
case 0x23: $result = __( 'User Def. 3', 'wp-photo-album-plus' ); break;
|
1173 |
+
case 0x41: $result = __( 'PC 1', 'wp-photo-album-plus' ); break;
|
1174 |
+
case 0x42: $result = __( 'PC 2', 'wp-photo-album-plus' ); break;
|
1175 |
+
case 0x43: $result = __( 'PC 3', 'wp-photo-album-plus' ); break;
|
1176 |
+
case 0x81: $result = __( 'Standard', 'wp-photo-album-plus' ); break;
|
1177 |
+
case 0x82: $result = __( 'Portrait', 'wp-photo-album-plus' ); break;
|
1178 |
+
case 0x83: $result = __( 'Landscape', 'wp-photo-album-plus' ); break;
|
1179 |
+
case 0x84: $result = __( 'Neutral', 'wp-photo-album-plus' ); break;
|
1180 |
+
case 0x85: $result = __( 'Faithful', 'wp-photo-album-plus' ); break;
|
1181 |
+
case 0x86: $result = __( 'Monochrome', 'wp-photo-album-plus' ); break;
|
1182 |
+
case 0x87: $result = __( 'Auto', 'wp-photo-album-plus' ); break;
|
1183 |
+
case 0x88: $result = __( 'Fine Detail', 'wp-photo-album-plus' ); break;
|
1184 |
+
case 0xff: $result = __( 'n/a', 'wp-photo-album-plus' ); break;
|
1185 |
+
case 0xffff: $result = __( 'n/a', 'wp-photo-album-plus' ); break;
|
1186 |
+
default: $result = $data;
|
1187 |
+
}
|
1188 |
+
break;
|
1189 |
+
|
1190 |
+
default:
|
1191 |
+
$result = $data;
|
1192 |
+
}
|
1193 |
+
return $result;
|
1194 |
+
break;
|
1195 |
+
|
1196 |
+
case 'E#4009': // PictureStylePC
|
1197 |
+
case 'E#4010': // CustomPictureStyleFileName
|
1198 |
+
case 'E#4013': // AFMicroAdj
|
1199 |
+
case 'E#4015': // VignettingCorr
|
1200 |
+
case 'E#4016': // VignettingCorr2
|
1201 |
+
case 'E#4018': // LightingOpt
|
1202 |
+
case 'E#4019': // LensInfo
|
1203 |
+
$result = $data;
|
1204 |
+
return $result;
|
1205 |
+
break;
|
1206 |
+
|
1207 |
+
|
1208 |
+
case 'E#4020': // AmbienceInfo
|
1209 |
+
if ( $brand == 'CANON' ) {
|
1210 |
+
switch( $data ) {
|
1211 |
+
case 0: $result = __( 'Standard', 'wp-photo-album-plus' ); break;
|
1212 |
+
case 1: $result = __( 'Vivid', 'wp-photo-album-plus' ); break;
|
1213 |
+
case 2: $result = __( 'Warm', 'wp-photo-album-plus' ); break;
|
1214 |
+
case 3: $result = __( 'Soft', 'wp-photo-album-plus' ); break;
|
1215 |
+
case 4: $result = __( 'Cool', 'wp-photo-album-plus' ); break;
|
1216 |
+
case 5: $result = __( 'Intense', 'wp-photo-album-plus' ); break;
|
1217 |
+
case 6: $result = __( 'Brighter', 'wp-photo-album-plus' ); break;
|
1218 |
+
case 7: $result = __( 'Darker', 'wp-photo-album-plus' ); break;
|
1219 |
+
case 8: $result = __( 'Monochrome', 'wp-photo-album-plus' ); break;
|
1220 |
+
default: $result = $data;
|
1221 |
+
}
|
1222 |
+
return $result;
|
1223 |
+
}
|
1224 |
+
else {
|
1225 |
+
$result = $data;
|
1226 |
+
}
|
1227 |
+
return $result;
|
1228 |
+
|
1229 |
+
case 'E#4021': // MultiExp
|
1230 |
+
case 'E#4024': // FilterInfo
|
1231 |
+
case 'E#4025': // HDRInfo
|
1232 |
+
case 'E#4028': // AFConfig
|
1233 |
+
|
1234 |
+
$result = $data;
|
1235 |
+
return $result;
|
1236 |
+
break;
|
1237 |
+
|
1238 |
+
case 'E#7000': // SonyRawFileType
|
1239 |
+
|
1240 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1241 |
+
|
1242 |
+
switch ( $data ) {
|
1243 |
+
case 0: $result = __( 'Sony Uncompressed 14-bit RAW', 'wp-photo-album-plus' ); break;
|
1244 |
+
case 1: $result = __( 'Sony Uncompressed 12-bit RAW', 'wp-photo-album-plus' ); break;
|
1245 |
+
case 2: $result = __( 'Sony Compressed RAW', 'wp-photo-album-plus' ); break;
|
1246 |
+
case 3: $result = __( 'Sony Lossless Compressed RAW', 'wp-photo-album-plus' ); break;
|
1247 |
+
default: $result = __( 'reserved', 'wp-photo-album-plus' );
|
1248 |
+
}
|
1249 |
+
|
1250 |
+
return $result;
|
1251 |
+
break;
|
1252 |
+
|
1253 |
+
case 'E#829A': // Exposure time
|
1254 |
+
|
1255 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
1256 |
+
return $wppa_exif_error_output;
|
1257 |
+
}
|
1258 |
+
|
1259 |
+
// Format is valid
|
1260 |
+
$temp = explode( '/', $data );
|
1261 |
+
$x = $temp[0];
|
1262 |
+
$y = $temp[1];
|
1263 |
+
|
1264 |
+
// 1 s.
|
1265 |
+
if ( $x / $y == 1 ) {
|
1266 |
+
$result = '1 s.';
|
1267 |
+
return $result;
|
1268 |
+
}
|
1269 |
+
|
1270 |
+
// Normal: 1/nn s.
|
1271 |
+
if ( $x == 1 ) {
|
1272 |
+
$result = $data . ' s.';
|
1273 |
+
return $result;
|
1274 |
+
}
|
1275 |
+
|
1276 |
+
// 'nn/1'
|
1277 |
+
if ( $y == 1 ) {
|
1278 |
+
$result = $x . ' s.';
|
1279 |
+
return $result;
|
1280 |
+
}
|
1281 |
+
|
1282 |
+
// Simplify nnn/mmm > 1
|
1283 |
+
if ( ( $x / $y ) > 1 ) {
|
1284 |
+
$result = sprintf( '%2.1f', $x / $y );
|
1285 |
+
if ( substr( $result, -2 ) == '.0' ) { // Remove trailing '.0'
|
1286 |
+
$result = substr( $result, 0, strlen( $result ) -2 ) . ' s.';
|
1287 |
+
}
|
1288 |
+
else {
|
1289 |
+
$result .= ' s.';
|
1290 |
+
}
|
1291 |
+
return $result;
|
1292 |
+
}
|
1293 |
+
|
1294 |
+
// Simplify nnn/mmm < 1
|
1295 |
+
$v = $y / $x;
|
1296 |
+
$z = round( $v ) / $v;
|
1297 |
+
if ( 0.99 < $z && $z < 1.01 ) {
|
1298 |
+
if ( round( $v ) == '1' ) {
|
1299 |
+
$result = '1 s.';
|
1300 |
+
}
|
1301 |
+
else {
|
1302 |
+
$result = '1/' . round( $v ) . ' s.';
|
1303 |
+
}
|
1304 |
+
}
|
1305 |
+
else {
|
1306 |
+
$z = $x / $y;
|
1307 |
+
$i = 2;
|
1308 |
+
$n = 0;
|
1309 |
+
while ( $n < 2 && $i < strlen( $z ) ) {
|
1310 |
+
if ( substr( $z, $i, 1 ) != '0' ) {
|
1311 |
+
$n++;
|
1312 |
+
}
|
1313 |
+
$i++;
|
1314 |
+
}
|
1315 |
+
$result = substr( $z, 0, $i ) . ' s.';
|
1316 |
+
}
|
1317 |
+
return $result;
|
1318 |
+
break;
|
1319 |
+
|
1320 |
+
case 'E#829D': // F-Stop
|
1321 |
+
|
1322 |
+
// Invalid format?
|
1323 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
1324 |
+
return $wppa_exif_error_output;
|
1325 |
+
}
|
1326 |
+
|
1327 |
+
// Format is valid
|
1328 |
+
$temp = explode( '/', $data );
|
1329 |
+
$x = $temp[0];
|
1330 |
+
$y = $temp[1];
|
1331 |
+
|
1332 |
+
// Bogus data?
|
1333 |
+
if ( $x / $y > 100 || ( round( 10 * $x / $y ) / 10 ) == 0 ) {
|
1334 |
+
$result = '<span title="' . esc_attr( __( 'Impossible data', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
1335 |
+
return $result;
|
1336 |
+
}
|
1337 |
+
|
1338 |
+
// Valid meaningful data
|
1339 |
+
$result = 'f/' . ( round( 10 * $x / $y ) / 10 );
|
1340 |
+
|
1341 |
+
return $result;
|
1342 |
+
break;
|
1343 |
+
|
1344 |
+
case 'E#84E3': // RasterPadding
|
1345 |
+
|
1346 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1347 |
+
|
1348 |
+
switch ( $data ) {
|
1349 |
+
case 0: $result = __( 'Byte', 'wp-photo-album-plus' ); break;
|
1350 |
+
case 1: $result = __( 'Word', 'wp-photo-album-plus' ); break;
|
1351 |
+
case 2: $result = __( 'Long Word', 'wp-photo-album-plus' ); break;
|
1352 |
+
case 9: $result = __( 'Sector', 'wp-photo-album-plus' ); break;
|
1353 |
+
case 10: $result = __( 'Long Sector', 'wp-photo-album-plus' ); break;
|
1354 |
+
default: $result = __( 'reserved', 'wp-photo-album-plus' );
|
1355 |
+
}
|
1356 |
+
return $result;
|
1357 |
+
break;
|
1358 |
+
|
1359 |
+
case 'E#84E7': // ImageColorIndicator
|
1360 |
+
|
1361 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1362 |
+
|
1363 |
+
switch ( $data ) {
|
1364 |
+
case 0: $result = __( 'Unspecified Image Color', 'wp-photo-album-plus' ); break;
|
1365 |
+
case 1: $result = __( 'Specified Image Color', 'wp-photo-album-plus' ); break;
|
1366 |
+
default: $result = __( 'reserved', 'wp-photo-album-plus' );
|
1367 |
+
}
|
1368 |
+
return $result;
|
1369 |
+
break;
|
1370 |
+
|
1371 |
+
case 'E#84E8': // BackgroundColorIndicator
|
1372 |
+
|
1373 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1374 |
+
|
1375 |
+
switch ( $data ) {
|
1376 |
+
case 0: $result = __( 'Unspecified Background Color', 'wp-photo-album-plus' ); break;
|
1377 |
+
case 1: $result = __( 'Specified Background Color', 'wp-photo-album-plus' ); break;
|
1378 |
+
default: $result = __( 'reserved', 'wp-photo-album-plus' );
|
1379 |
+
}
|
1380 |
+
return $result;
|
1381 |
+
break;
|
1382 |
+
|
1383 |
+
case 'E#84EE': // HCUsage
|
1384 |
+
|
1385 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1386 |
+
|
1387 |
+
switch ( $data ) {
|
1388 |
+
case 0: $result = __( 'CT', 'wp-photo-album-plus' ); break;
|
1389 |
+
case 1: $result = __( 'Line Art', 'wp-photo-album-plus' ); break;
|
1390 |
+
case 2: $result = __( 'Trap', 'wp-photo-album-plus' ); break;
|
1391 |
+
default: $result = __( 'reserved', 'wp-photo-album-plus' );
|
1392 |
+
}
|
1393 |
+
return $result;
|
1394 |
+
break;
|
1395 |
+
|
1396 |
+
case 'E#877F': // TIFF_FXExtensions
|
1397 |
+
|
1398 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1399 |
+
|
1400 |
+
$result = '';
|
1401 |
+
if ( $data & 0x01 ) $data .= __( 'Resolution/Image Width', 'wp-photo-album-plus' ) . ', ';
|
1402 |
+
if ( $data & 0x02 ) $data .= __( 'N Layer Profile M', 'wp-photo-album-plus' ) . ', ';
|
1403 |
+
if ( $data & 0x04 ) $data .= __( 'Shared Data', 'wp-photo-album-plus' ) . ', ';
|
1404 |
+
if ( $data & 0x08 ) $data .= __( 'B&W JBIG2', 'wp-photo-album-plus' ) . ', ';
|
1405 |
+
if ( $data & 0x10 ) $data .= __( 'JBIG2 Profile M', 'wp-photo-album-plus' ) . ', ';
|
1406 |
+
$result = trim( $result, ', ' );
|
1407 |
+
if ( ! $result ) $result = __( 'Undefined', 'wp-photo-album-plus' );
|
1408 |
+
return $result;
|
1409 |
+
break;
|
1410 |
+
|
1411 |
+
case 'E#8780': // MultiProfiles
|
1412 |
+
|
1413 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1414 |
+
|
1415 |
+
$result = '';
|
1416 |
+
if ( $data & 0x001 ) $data .= __( 'Profile S', 'wp-photo-album-plus' ) . ', ';
|
1417 |
+
if ( $data & 0x002 ) $data .= __( 'Profile F', 'wp-photo-album-plus' ) . ', ';
|
1418 |
+
if ( $data & 0x004 ) $data .= __( 'Profile J', 'wp-photo-album-plus' ) . ', ';
|
1419 |
+
if ( $data & 0x008 ) $data .= __( 'Profile C', 'wp-photo-album-plus' ) . ', ';
|
1420 |
+
if ( $data & 0x010 ) $data .= __( 'Profile L', 'wp-photo-album-plus' ) . ', ';
|
1421 |
+
if ( $data & 0x020 ) $data .= __( 'Profile M', 'wp-photo-album-plus' ) . ', ';
|
1422 |
+
if ( $data & 0x040 ) $data .= __( 'Profile T', 'wp-photo-album-plus' ) . ', ';
|
1423 |
+
if ( $data & 0x080 ) $data .= __( 'Resolution/Image Width', 'wp-photo-album-plus' ) . ', ';
|
1424 |
+
if ( $data & 0x100 ) $data .= __( 'N Layer Profile M', 'wp-photo-album-plus' ) . ', ';
|
1425 |
+
if ( $data & 0x200 ) $data .= __( 'Shared Data', 'wp-photo-album-plus' ) . ', ';
|
1426 |
+
if ( $data & 0x400 ) $data .= __( 'JBIG2 Profile M', 'wp-photo-album-plus' ) . ', ';
|
1427 |
+
$result = trim( $result, ', ' );
|
1428 |
+
if ( ! $result ) $result = __( 'Undefined', 'wp-photo-album-plus' );
|
1429 |
+
return $result;
|
1430 |
+
break;
|
1431 |
+
|
1432 |
+
case 'E#8822': // Exposure program
|
1433 |
+
|
1434 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1435 |
+
|
1436 |
+
switch ( $data ) {
|
1437 |
+
case '0': $result = __('Not Defined', 'wp-photo-album-plus'); break;
|
1438 |
+
case '1': $result = __('Manual', 'wp-photo-album-plus'); break;
|
1439 |
+
case '2': $result = __('Program AE', 'wp-photo-album-plus'); break;
|
1440 |
+
case '3': $result = __('Aperture-priority AE', 'wp-photo-album-plus'); break;
|
1441 |
+
case '4': $result = __('Shutter speed priority AE', 'wp-photo-album-plus'); break;
|
1442 |
+
case '5': $result = __('Creative (Slow speed)', 'wp-photo-album-plus'); break;
|
1443 |
+
case '6': $result = __('Action (High speed)', 'wp-photo-album-plus'); break;
|
1444 |
+
case '7': $result = __('Portrait', 'wp-photo-album-plus'); break;
|
1445 |
+
case '8': $result = __('Landscape', 'wp-photo-album-plus'); break;
|
1446 |
+
case '9': $result = __('Bulb', 'wp-photo-album-plus'); break;
|
1447 |
+
default:
|
1448 |
+
$result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
1449 |
+
}
|
1450 |
+
return $result;
|
1451 |
+
break;
|
1452 |
+
|
1453 |
+
case 'E#8830': // SensitivityType
|
1454 |
+
|
1455 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1456 |
+
|
1457 |
+
switch ( $data ) {
|
1458 |
+
case '0': $result = __('Unknown', 'wp-photo-album-plus'); break;
|
1459 |
+
case '1': $result = __('Standard Output Sensitivity', 'wp-photo-album-plus'); break;
|
1460 |
+
case '2': $result = __('Recommended Exposure Index', 'wp-photo-album-plus'); break;
|
1461 |
+
case '3': $result = __('ISO Speed', 'wp-photo-album-plus'); break;
|
1462 |
+
case '4': $result = __('Standard Output Sensitivity and Recommended Exposure Index', 'wp-photo-album-plus'); break;
|
1463 |
+
case '5': $result = __('Standard Output Sensitivity and ISO Speed', 'wp-photo-album-plus'); break;
|
1464 |
+
case '6': $result = __('Recommended Exposure Index and ISO Speed', 'wp-photo-album-plus'); break;
|
1465 |
+
case '7': $result = __('Standard Output Sensitivity, Recommended Exposure Index and ISO Speed', 'wp-photo-album-plus'); break;
|
1466 |
+
default:
|
1467 |
+
$result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
1468 |
+
}
|
1469 |
+
return $result;
|
1470 |
+
break;
|
1471 |
+
|
1472 |
+
case 'E#9101': // ComponentsConfiguration
|
1473 |
+
|
1474 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1475 |
+
|
1476 |
+
switch ( $data ) {
|
1477 |
+
case '0': $result = '-'; break;
|
1478 |
+
case '1': $result = 'Y'; break;
|
1479 |
+
case '2': $result = 'Cb'; break;
|
1480 |
+
case '3': $result = 'Cr'; break;
|
1481 |
+
case '4': $result = 'R'; break;
|
1482 |
+
case '5': $result = 'G'; break;
|
1483 |
+
case '6': $result = 'B'; break;
|
1484 |
+
default:
|
1485 |
+
$result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
1486 |
+
}
|
1487 |
+
return $result;
|
1488 |
+
break;
|
1489 |
+
|
1490 |
+
case 'E#9102': // CompressedBitsPerPixel
|
1491 |
+
|
1492 |
+
if ( ! wppa_is_valid_rational( $data ) ) return $wppa_exif_error_output;
|
1493 |
+
|
1494 |
+
$result = wppa_simplify_ratio( $data );
|
1495 |
+
return $result;
|
1496 |
+
break;
|
1497 |
+
|
1498 |
+
case 'E#9201': // Shutter speed value
|
1499 |
+
|
1500 |
+
if ( ! wppa_is_valid_rational( $data, true ) ) {
|
1501 |
+
return $wppa_exif_error_output;
|
1502 |
+
}
|
1503 |
+
|
1504 |
+
// Format is valid
|
1505 |
+
$temp = explode( '/', $data );
|
1506 |
+
$x = $temp[0];
|
1507 |
+
$y = $temp[1];
|
1508 |
+
|
1509 |
+
$result = round( 10 * $x / $y ) / 10;
|
1510 |
+
return $result;
|
1511 |
+
break;
|
1512 |
+
|
1513 |
+
case 'E#9202': // Aperture value
|
1514 |
+
|
1515 |
+
// Invalid format?
|
1516 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
1517 |
+
return $wppa_exif_error_output;
|
1518 |
+
}
|
1519 |
+
|
1520 |
+
// Format is valid
|
1521 |
+
$temp = explode( '/', $data );
|
1522 |
+
$x = $temp[0];
|
1523 |
+
$y = $temp[1];
|
1524 |
+
|
1525 |
+
$result = round( 10 * $x / $y ) / 10;
|
1526 |
+
|
1527 |
+
return $result;
|
1528 |
+
break;
|
1529 |
+
|
1530 |
+
case 'E#9204': // ExposureBiasValue
|
1531 |
+
|
1532 |
+
// Invalid format?
|
1533 |
+
if ( ! wppa_is_valid_rational( $data, true ) ) {
|
1534 |
+
return $wppa_exif_error_output;
|
1535 |
+
}
|
1536 |
+
|
1537 |
+
$t = explode( '/', $data );
|
1538 |
+
$x = $t[0];
|
1539 |
+
$y = $t[1];
|
1540 |
+
|
1541 |
+
$result = sprintf( '%5.2f EV', $x/$y );
|
1542 |
+
return $result;
|
1543 |
+
break;
|
1544 |
+
|
1545 |
+
case 'E#9205': // Max aperture value
|
1546 |
+
|
1547 |
+
// Invalid format?
|
1548 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
1549 |
+
return $wppa_exif_error_output;
|
1550 |
+
}
|
1551 |
+
|
1552 |
+
// Format is valid
|
1553 |
+
$temp = explode( '/', $data );
|
1554 |
+
$x = $temp[0];
|
1555 |
+
$y = $temp[1];
|
1556 |
+
|
1557 |
+
$result = round( 10 * $x / $y ) / 10;
|
1558 |
+
|
1559 |
+
return $result;
|
1560 |
+
break;
|
1561 |
+
|
1562 |
+
case 'E#9206': // Subject distance
|
1563 |
+
|
1564 |
+
// Invalid format?
|
1565 |
+
if ( ! wppa_is_valid_rational( $data, true ) ) {
|
1566 |
+
return $wppa_exif_error_output;
|
1567 |
+
}
|
1568 |
+
|
1569 |
+
// Format is valid
|
1570 |
+
$temp = explode( '/', $data );
|
1571 |
+
$x = $temp[0];
|
1572 |
+
$y = $temp[1];
|
1573 |
+
|
1574 |
+
if ( $x == 0 || $y == 0 || $x/$y > 1000 ) {
|
1575 |
+
$result = '<span title="' . esc_attr( __( 'Impossible data', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
1576 |
+
}
|
1577 |
+
else {
|
1578 |
+
if ( $temp[1] != 0 ) {
|
1579 |
+
$result = round( 100*$temp[0]/$temp[1] ) / 100;
|
1580 |
+
}
|
1581 |
+
if ( $result == -1 ) {
|
1582 |
+
$result = 'inf';
|
1583 |
+
}
|
1584 |
+
else {
|
1585 |
+
$result .= ' m.';
|
1586 |
+
}
|
1587 |
+
}
|
1588 |
+
|
1589 |
+
return $result;
|
1590 |
+
break;
|
1591 |
+
|
1592 |
+
|
1593 |
+
|
1594 |
+
case 'E#9207': // Metering mode
|
1595 |
+
switch ( $data ) {
|
1596 |
+
case '1': $result = __('Average', 'wp-photo-album-plus'); break;
|
1597 |
+
case '2': $result = __('Center-weighted average', 'wp-photo-album-plus'); break;
|
1598 |
+
case '3': $result = __('Spot', 'wp-photo-album-plus'); break;
|
1599 |
+
case '4': $result = __('Multi-spot', 'wp-photo-album-plus'); break;
|
1600 |
+
case '5': $result = __('Multi-segment', 'wp-photo-album-plus'); break;
|
1601 |
+
case '6': $result = __('Partial', 'wp-photo-album-plus'); break;
|
1602 |
+
case '255': $result = __('Other', 'wp-photo-album-plus'); break;
|
1603 |
+
default:
|
1604 |
+
$result = '<span title="' . esc_attr( __( 'reserved', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
1605 |
+
}
|
1606 |
+
return $result;
|
1607 |
+
break;
|
1608 |
+
|
1609 |
+
case 'E#9208': // LghtSource
|
1610 |
+
switch ( $data ) {
|
1611 |
+
case '0': $result = __('unknown', 'wp-photo-album-plus'); break;
|
1612 |
+
case '1': $result = __('Daylight', 'wp-photo-album-plus'); break;
|
1613 |
+
case '2': $result = __('Fluorescent', 'wp-photo-album-plus'); break;
|
1614 |
+
case '3': $result = __('Tungsten (incandescent light)', 'wp-photo-album-plus'); break;
|
1615 |
+
case '4': $result = __('Flash', 'wp-photo-album-plus'); break;
|
1616 |
+
case '9': $result = __('Fine weather', 'wp-photo-album-plus'); break;
|
1617 |
+
case '10': $result = __('Cloudy weather', 'wp-photo-album-plus'); break;
|
1618 |
+
case '11': $result = __('Shade', 'wp-photo-album-plus'); break;
|
1619 |
+
case '12': $result = __('Daylight fluorescent (D 5700 – 7100K)', 'wp-photo-album-plus'); break;
|
1620 |
+
case '13': $result = __('Day white fluorescent (N 4600 – 5400K)', 'wp-photo-album-plus'); break;
|
1621 |
+
case '14': $result = __('Cool white fluorescent (W 3900 – 4500K)', 'wp-photo-album-plus'); break;
|
1622 |
+
case '15': $result = __('White fluorescent (WW 3200 – 3700K)', 'wp-photo-album-plus'); break;
|
1623 |
+
case '17': $result = __('Standard light A', 'wp-photo-album-plus'); break;
|
1624 |
+
case '18': $result = __('Standard light B', 'wp-photo-album-plus'); break;
|
1625 |
+
case '19': $result = __('Standard light C', 'wp-photo-album-plus'); break;
|
1626 |
+
case '20': $result = __('D55', 'wp-photo-album-plus'); break;
|
1627 |
+
case '21': $result = __('D65', 'wp-photo-album-plus'); break;
|
1628 |
+
case '22': $result = __('D75', 'wp-photo-album-plus'); break;
|
1629 |
+
case '23': $result = __('D50', 'wp-photo-album-plus'); break;
|
1630 |
+
case '24': $result = __('ISO studio tungsten', 'wp-photo-album-plus'); break;
|
1631 |
+
case '255': $result = __('other light source', 'wp-photo-album-plus'); break;
|
1632 |
+
default: $result = __('reserved', 'wp-photo-album-plus'); break;
|
1633 |
+
}
|
1634 |
+
return $result;
|
1635 |
+
break;
|
1636 |
+
|
1637 |
+
case 'E#9209': // Flash
|
1638 |
+
switch ( $data ) {
|
1639 |
+
case '0': $result = __('No Flash', 'wp-photo-album-plus'); break;
|
1640 |
+
case '1': $result = __('Fired', 'wp-photo-album-plus'); break;
|
1641 |
case '5': $result = __('Fired, Return not detected', 'wp-photo-album-plus'); break;
|
|
|
1642 |
case '7': $result = __('Fired, Return detected', 'wp-photo-album-plus'); break;
|
|
|
1643 |
case '8': $result = __('On, Did not fire', 'wp-photo-album-plus'); break;
|
|
|
1644 |
case '9': $result = __('On, Fired', 'wp-photo-album-plus'); break;
|
|
|
1645 |
case '13': $result = __('On, Return not detected', 'wp-photo-album-plus'); break;
|
|
|
1646 |
case '15': $result = __('On, Return detected', 'wp-photo-album-plus'); break;
|
|
|
1647 |
case '16': $result = __('Off, Did not fire', 'wp-photo-album-plus'); break;
|
|
|
1648 |
case '20': $result = __('Off, Did not fire, Return not detected', 'wp-photo-album-plus'); break;
|
|
|
1649 |
case '24': $result = __('Auto, Did not fire', 'wp-photo-album-plus'); break;
|
|
|
1650 |
case '25': $result = __('Auto, Fired', 'wp-photo-album-plus'); break;
|
|
|
1651 |
case '29': $result = __('Auto, Fired, Return not detected', 'wp-photo-album-plus'); break;
|
|
|
1652 |
case '31': $result = __('Auto, Fired, Return detected', 'wp-photo-album-plus'); break;
|
|
|
1653 |
case '32': $result = __('No flash function', 'wp-photo-album-plus'); break;
|
|
|
1654 |
case '48': $result = __('Off, No flash function', 'wp-photo-album-plus'); break;
|
|
|
1655 |
case '65': $result = __('Fired, Red-eye reduction', 'wp-photo-album-plus'); break;
|
|
|
1656 |
case '69': $result = __('Fired, Red-eye reduction, Return not detected', 'wp-photo-album-plus'); break;
|
|
|
1657 |
case '71': $result = __('Fired, Red-eye reduction, Return detected', 'wp-photo-album-plus'); break;
|
|
|
1658 |
case '73': $result = __('On, Red-eye reduction', 'wp-photo-album-plus'); break;
|
|
|
1659 |
case '77': $result = __('Red-eye reduction, Return not detected', 'wp-photo-album-plus'); break;
|
|
|
1660 |
case '79': $result = __('On, Red-eye reduction, Return detected', 'wp-photo-album-plus'); break;
|
|
|
1661 |
case '80': $result = __('Off, Red-eye reduction', 'wp-photo-album-plus'); break;
|
|
|
1662 |
case '88': $result = __('Auto, Did not fire, Red-eye reduction', 'wp-photo-album-plus'); break;
|
|
|
1663 |
case '89': $result = __('Auto, Fired, Red-eye reduction', 'wp-photo-album-plus'); break;
|
|
|
1664 |
case '93': $result = __('Auto, Fired, Red-eye reduction, Return not detected', 'wp-photo-album-plus'); break;
|
|
|
1665 |
case '95': $result = __('Auto, Fired, Red-eye reduction, Return detected', 'wp-photo-album-plus'); break;
|
1666 |
default:
|
1667 |
+
$result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
1668 |
+
}
|
1669 |
+
|
1670 |
+
return $result;
|
1671 |
+
break;
|
1672 |
+
|
1673 |
+
case 'E#9210': // FocalPlaneResolutionUnit
|
1674 |
+
|
1675 |
+
switch( $data ) {
|
1676 |
+
case 1: $result = __( 'None', 'wp-photo-album-plus' ); break;
|
1677 |
+
case 2: $result = 'inches'; break;
|
1678 |
+
case 3: $result = 'cm'; break;
|
1679 |
+
case 4: $result = 'mm'; break;
|
1680 |
+
case 5: $result = 'μm'; break;
|
1681 |
+
default: $result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
1682 |
+
}
|
1683 |
+
|
1684 |
+
return $result;
|
1685 |
+
break;
|
1686 |
+
|
1687 |
+
case 'E#920A': // Focal length
|
1688 |
+
|
1689 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
1690 |
+
return $wppa_exif_error_output;
|
1691 |
+
}
|
1692 |
+
|
1693 |
+
// Format is valid
|
1694 |
+
$temp = explode( '/', $data );
|
1695 |
+
$x = $temp[0];
|
1696 |
+
$y = $temp[1];
|
1697 |
+
|
1698 |
+
$z = round( $x / $y );
|
1699 |
+
if ( $z < 10 ) {
|
1700 |
+
$result = round( $x * 10 / $y ) / 10 . ' mm.';
|
1701 |
+
}
|
1702 |
+
else {
|
1703 |
+
$result = round( $x / $y ) . ' mm.';
|
1704 |
+
}
|
1705 |
+
return $result;
|
1706 |
+
break;
|
1707 |
+
|
1708 |
+
case 'E#9212': // SecurityClassification
|
1709 |
+
|
1710 |
+
switch( $data ) {
|
1711 |
+
case 'C': $result = __( 'Confidential', 'wp-photo-album-plus' ); break;
|
1712 |
+
case 'R': $result = __( 'Restricted', 'wp-photo-album-plus' ); break;
|
1713 |
+
case 'S': $result = __( 'Secret', 'wp-photo-album-plus' ); break;
|
1714 |
+
case 'T': $result = __( 'Top Secret', 'wp-photo-album-plus' ); break;
|
1715 |
+
case 'U': $result = __( 'Unclassified', 'wp-photo-album-plus' ); break;
|
1716 |
+
default: $result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
1717 |
+
}
|
1718 |
+
|
1719 |
+
return $result;
|
1720 |
+
break;
|
1721 |
+
|
1722 |
+
case 'E#9217': // SensingMethod
|
1723 |
+
|
1724 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1725 |
+
|
1726 |
+
switch( $data ) {
|
1727 |
+
case 1: $result = __( 'Monochrome area', 'wp-photo-album-plus' ); break;
|
1728 |
+
case 2: $result = __( 'One-chip color area', 'wp-photo-album-plus' ); break;
|
1729 |
+
case 3: $result = __( 'Two-chip color area', 'wp-photo-album-plus' ); break;
|
1730 |
+
case 4: $result = __( 'Three-chip color area', 'wp-photo-album-plus' ); break;
|
1731 |
+
case 5: $result = __( 'Color sequential area', 'wp-photo-album-plus' ); break;
|
1732 |
+
case 6: $result = __( 'Monochrome linear', 'wp-photo-album-plus' ); break;
|
1733 |
+
case 7: $result = __( 'Trilinear', 'wp-photo-album-plus' ); break;
|
1734 |
+
case 8: $result = __( 'Color sequential linear', 'wp-photo-album-plus' ); break;
|
1735 |
+
default: $result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
1736 |
+
}
|
1737 |
+
|
1738 |
+
return $result;
|
1739 |
+
break;
|
1740 |
+
|
1741 |
+
case 'E#A001': // ColorSpace
|
1742 |
+
|
1743 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1744 |
+
|
1745 |
+
switch ( $data ) {
|
1746 |
+
case 1: $result = __( 'sRGB', 'wp-photo-album-plus' ); break;
|
1747 |
+
case 0x2: $result = __( 'Adobe RGB', 'wp-photo-album-plus' ); break;
|
1748 |
+
case 0xfffd: $result = __( 'Wide Gamut RGB', 'wp-photo-album-plus' ); break;
|
1749 |
+
case 0xfffe: $result = __( 'ICC Profile', 'wp-photo-album-plus' ); break;
|
1750 |
+
case 0xFFFF: $result = __( 'Uncalibrated', 'wp-photo-album-plus' ); break;
|
1751 |
+
default: $result = __( 'reserved', 'wp-photo-album-plus' );
|
1752 |
+
}
|
1753 |
+
return $result;
|
1754 |
+
break;
|
1755 |
+
|
1756 |
+
case 'E#A002': // PixelXDimension
|
1757 |
+
case 'E#A003': // PixelYDimension
|
1758 |
+
|
1759 |
+
switch( $brand ) {
|
1760 |
+
case 'SAMSUNG': // LensType
|
1761 |
+
|
1762 |
+
switch ( $data ) {
|
1763 |
+
case 0: $result = 'Built-in or Manual Lens'; break;
|
1764 |
+
case 1: $result = 'Samsung NX 30mm F2 Pancake'; break;
|
1765 |
+
case 2: $result = 'Samsung NX 18-55mm F3.5-5.6 OIS'; break;
|
1766 |
+
case 3: $result = 'Samsung NX 50-200mm F4-5.6 ED OIS'; break;
|
1767 |
+
case 4: $result = 'Samsung NX 20-50mm F3.5-5.6 ED'; break;
|
1768 |
+
case 5: $result = 'Samsung NX 20mm F2.8 Pancake'; break;
|
1769 |
+
case 6: $result = 'Samsung NX 18-200mm F3.5-6.3 ED OIS'; break;
|
1770 |
+
case 7: $result = 'Samsung NX 60mm F2.8 Macro ED OIS SSA'; break;
|
1771 |
+
case 8: $result = 'Samsung NX 16mm F2.4 Pancake'; break;
|
1772 |
+
case 9: $result = 'Samsung NX 85mm F1.4 ED SSA'; break;
|
1773 |
+
case 10: $result = 'Samsung NX 45mm F1.8'; break;
|
1774 |
+
case 11: $result = 'Samsung NX 45mm F1.8 2D/3D'; break;
|
1775 |
+
case 12: $result = 'Samsung NX 12-24mm F4-5.6 ED'; break;
|
1776 |
+
case 13: $result = 'Samsung NX 16-50mm F2-2.8 S ED OIS'; break;
|
1777 |
+
case 14: $result = 'Samsung NX 10mm F3.5 Fisheye'; break;
|
1778 |
+
case 15: $result = 'Samsung NX 16-50mm F3.5-5.6 Power Zoom ED OIS'; break;
|
1779 |
+
case 20: $result = 'Samsung NX 50-150mm F2.8 S ED OIS'; break;
|
1780 |
+
case 21: $result = 'Samsung NX 300mm F2.8 ED OIS'; break;
|
1781 |
+
default: $result = $data;
|
1782 |
+
}
|
1783 |
+
|
1784 |
+
return $result;
|
1785 |
+
break;
|
1786 |
+
|
1787 |
+
default:
|
1788 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
1789 |
+
return $wppa_exif_error_output;
|
1790 |
+
}
|
1791 |
+
|
1792 |
+
$result = $data . ' px.';
|
1793 |
+
return $result;
|
1794 |
+
}
|
1795 |
+
break;
|
1796 |
+
|
1797 |
+
case 'E#A011': // ColorSpace (Samsung)
|
1798 |
+
|
1799 |
+
switch( $brand ) {
|
1800 |
+
case 'SAMSUNG': // ColorSpace
|
1801 |
+
|
1802 |
+
switch ( $data ) {
|
1803 |
+
case 0: $result = 'sRGB'; break;
|
1804 |
+
case 1: $result = 'Adobe RGB'; break;
|
1805 |
+
default: $result = $data;
|
1806 |
+
}
|
1807 |
+
|
1808 |
+
return $result;
|
1809 |
+
break;
|
1810 |
+
|
1811 |
+
default:
|
1812 |
+
|
1813 |
+
$result = $data;
|
1814 |
+
return $result;
|
1815 |
+
}
|
1816 |
+
break;
|
1817 |
+
|
1818 |
+
case 'E#A012': // SmartRange (Samsung)
|
1819 |
+
|
1820 |
+
switch( $brand ) {
|
1821 |
+
case 'SAMSUNG': // ColorSpace
|
1822 |
+
|
1823 |
+
switch ( $data ) {
|
1824 |
+
case 0: $result = __( 'Off', 'wp-photo-album-plus' ); break;
|
1825 |
+
case 1: $result = __( 'On', 'wp-photo-album-plus' ); break;
|
1826 |
+
default: $result = $data;
|
1827 |
+
}
|
1828 |
+
|
1829 |
+
return $result;
|
1830 |
+
break;
|
1831 |
+
|
1832 |
+
default:
|
1833 |
+
|
1834 |
+
$result = $data;
|
1835 |
+
return $result;
|
1836 |
+
}
|
1837 |
+
break;
|
1838 |
+
|
1839 |
+
case 'E#A20E': // FocalPlaneXResolution
|
1840 |
+
case 'E#A20F': // FocalPlaneYResolution
|
1841 |
+
|
1842 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
1843 |
+
return $wppa_exif_error_output;
|
1844 |
+
}
|
1845 |
+
|
1846 |
+
// Format is valid
|
1847 |
+
$temp = explode( '/', $data );
|
1848 |
+
$x = $temp[0];
|
1849 |
+
$y = $temp[1];
|
1850 |
+
|
1851 |
+
$result = round( $x / $y );
|
1852 |
+
return $result;
|
1853 |
+
break;
|
1854 |
+
|
1855 |
+
case 'E#A210': // FocalPlaneResolutionUnit
|
1856 |
+
|
1857 |
+
switch( $data ) {
|
1858 |
+
case 1: $result = __( 'None', 'wp-photo-album-plus' ); break;
|
1859 |
+
case 2: $result = 'inches'; break;
|
1860 |
+
case 3: $result = 'cm'; break;
|
1861 |
+
case 4: $result = 'mm'; break;
|
1862 |
+
case 5: $result = 'μm'; break;
|
1863 |
+
default: $result = '<span title="' . esc_attr( __( 'Unknown', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
1864 |
+
}
|
1865 |
+
|
1866 |
+
return $result;
|
1867 |
+
break;
|
1868 |
+
|
1869 |
+
case 'E#A217': // SensingMethod
|
1870 |
+
|
1871 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
1872 |
+
return $wppa_exif_error_output;
|
1873 |
+
}
|
1874 |
+
|
1875 |
+
switch ( $data ) {
|
1876 |
+
case 1:
|
1877 |
+
$result = __( 'Not defined', 'wp-photo-album-plus' );
|
1878 |
+
break;
|
1879 |
+
case 2:
|
1880 |
+
$result = __( 'One-chip color area sensor', 'wp-photo-album-plus' );
|
1881 |
+
break;
|
1882 |
+
case 3:
|
1883 |
+
$result = __( 'Two-chip color area sensor', 'wp-photo-album-plus' );
|
1884 |
+
break;
|
1885 |
+
case 4:
|
1886 |
+
$result = __( 'Three-chip color area sensor', 'wp-photo-album-plus' );
|
1887 |
+
break;
|
1888 |
+
case 5:
|
1889 |
+
$result = __( 'Color sequential area sensor', 'wp-photo-album-plus' );
|
1890 |
+
break;
|
1891 |
+
case 7:
|
1892 |
+
$result = __( 'Trilinear sensor', 'wp-photo-album-plus' );
|
1893 |
+
break;
|
1894 |
+
case 8:
|
1895 |
+
$result = __( 'Color sequential linear sensor', 'wp-photo-album-plus' );
|
1896 |
+
break;
|
1897 |
+
default:
|
1898 |
+
$result = __( 'reserved', 'wp-photo-album-plus' );
|
1899 |
+
}
|
1900 |
+
|
1901 |
+
return $result;
|
1902 |
+
break;
|
1903 |
+
|
1904 |
+
case 'E#A300': // FileSource
|
1905 |
+
|
1906 |
+
switch( $data ) {
|
1907 |
+
case 1: $result = __( 'Film Scanner', 'wp-photo-album-plus' ); break;
|
1908 |
+
case 2: $result = __( 'Reflection Print Scanner', 'wp-photo-album-plus' ); break;
|
1909 |
+
case 3: $result = __( 'Digital Camera', 'wp-photo-album-plus' ); break;
|
1910 |
+
case "\x03\x00\x00\x00": $result = __( 'Sigma Digital Camera', 'wp-photo-album-plus' ); break;
|
1911 |
+
default: $result = __( 'reserved', 'wp-photo-album-plus' );
|
1912 |
+
}
|
1913 |
+
return $result;
|
1914 |
+
break;
|
1915 |
+
|
1916 |
+
case 'E#A401': // CustomRendered
|
1917 |
+
|
1918 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1919 |
+
|
1920 |
+
switch ( $data ) {
|
1921 |
+
case 0: $result = __( 'Normal', 'wp-photo-album-plus' ); break;
|
1922 |
+
case 1: $result = __( 'Custom', 'wp-photo-album-plus' ); break;
|
1923 |
+
case 3: $result = __( 'HDR', 'wp-photo-album-plus' ); break;
|
1924 |
+
case 6: $result = __( 'Panorama', 'wp-photo-album-plus' ); break;
|
1925 |
+
case 8: $result = __( 'Portrait', 'wp-photo-album-plus' ); break;
|
1926 |
+
default: $result = __( 'reserved', 'wp-photo-album-plus' );
|
1927 |
+
}
|
1928 |
+
return $result;
|
1929 |
+
break;
|
1930 |
+
|
1931 |
+
case 'E#A402': // ExposureMode
|
1932 |
+
|
1933 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
1934 |
+
|
1935 |
+
switch ( $data ) {
|
1936 |
+
case 0:
|
1937 |
+
$result = __( 'Auto exposure', 'wp-photo-album-plus' );
|
1938 |
+
break;
|
1939 |
+
case 1:
|
1940 |
+
$result = __( 'Manual exposure', 'wp-photo-album-plus' );
|
1941 |
+
break;
|
1942 |
+
case 2:
|
1943 |
+
$result = __( 'Auto bracket', 'wp-photo-album-plus' );
|
1944 |
+
break;
|
1945 |
+
default:
|
1946 |
+
$result = __( 'reserved', 'wp-photo-album-plus' );
|
1947 |
+
}
|
1948 |
+
|
1949 |
+
return $result;
|
1950 |
+
break;
|
1951 |
+
|
1952 |
+
case 'E#A403': // WhiteBalance
|
1953 |
+
|
1954 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
1955 |
+
return $wppa_exif_error_output;
|
1956 |
+
}
|
1957 |
+
|
1958 |
+
switch ( $data ) {
|
1959 |
+
case 0: $result = __( 'Auto white balance', 'wp-photo-album-plus' );
|
1960 |
+
break;
|
1961 |
+
case 1: $result = __( 'Manual white balance', 'wp-photo-album-plus' );
|
1962 |
+
break;
|
1963 |
+
default:
|
1964 |
+
$result = __( 'reserved', 'wp-photo-album-plus' );
|
1965 |
+
}
|
1966 |
+
|
1967 |
+
return $result;
|
1968 |
+
break;
|
1969 |
+
|
1970 |
+
case 'E#A404': // DigitalZoomRatio
|
1971 |
+
|
1972 |
+
// Invalid format?
|
1973 |
+
if ( ! wppa_is_valid_rational( $data ) ) {
|
1974 |
+
return $wppa_exif_error_output;
|
1975 |
+
}
|
1976 |
+
|
1977 |
+
$temp = explode( '/', $data );
|
1978 |
+
$x = $temp[0];
|
1979 |
+
$y = $temp[1];
|
1980 |
+
|
1981 |
+
if ( $x == 0 ) {
|
1982 |
+
$result = __( 'Not used', 'wp-photo-album-plus' );
|
1983 |
+
return $result;
|
1984 |
+
}
|
1985 |
+
|
1986 |
+
$result = wppa_simplify_ratio( $data );
|
1987 |
+
return $result;
|
1988 |
+
break;
|
1989 |
+
|
1990 |
+
case 'E#A405': // FocalLengthIn35mmFilm
|
1991 |
+
|
1992 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
1993 |
+
return $wppa_exif_error_output;
|
1994 |
+
}
|
1995 |
+
|
1996 |
+
$result = $data . ' mm.';
|
1997 |
+
return $result;
|
1998 |
+
break;
|
1999 |
+
|
2000 |
+
case 'E#A406': // SceneCaptureType
|
2001 |
+
|
2002 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
2003 |
+
return $wppa_exif_error_output;
|
2004 |
+
}
|
2005 |
+
|
2006 |
+
switch( $data ) {
|
2007 |
+
case 0: $result = __( 'Standard', 'wp-photo-album-plus' );
|
2008 |
+
break;
|
2009 |
+
case 1: $result = __( 'Landscape', 'wp-photo-album-plus' );
|
2010 |
+
break;
|
2011 |
+
case 2: $result = __( 'Portrait', 'wp-photo-album-plus' );
|
2012 |
+
break;
|
2013 |
+
case 3: $result = __( 'Night scene', 'wp-photo-album-plus' );
|
2014 |
+
break;
|
2015 |
+
default:
|
2016 |
+
$result = __( 'reserved', 'wp-photo-album-plus' );
|
2017 |
+
break;
|
2018 |
+
}
|
2019 |
+
|
2020 |
+
return $result;
|
2021 |
+
break;
|
2022 |
+
|
2023 |
+
case 'E#A407': // GainControl
|
2024 |
+
|
2025 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
2026 |
+
return $wppa_exif_error_output;
|
2027 |
+
}
|
2028 |
+
|
2029 |
+
switch( $data ) {
|
2030 |
+
case 0: $result = __( 'None', 'wp-photo-album-plus' );
|
2031 |
+
break;
|
2032 |
+
case 1: $result = __( 'Low gain up', 'wp-photo-album-plus' );
|
2033 |
+
break;
|
2034 |
+
case 2: $result = __( 'High gain up', 'wp-photo-album-plus' );
|
2035 |
+
break;
|
2036 |
+
case 3: $result = __( 'Low gain down', 'wp-photo-album-plus' );
|
2037 |
+
break;
|
2038 |
+
case 4: $result = __( 'High gain down', 'wp-photo-album-plus' );
|
2039 |
+
break;
|
2040 |
+
default:
|
2041 |
+
$result = __( 'reserved', 'wp-photo-album-plus' );
|
2042 |
+
}
|
2043 |
+
|
2044 |
+
return $result;
|
2045 |
+
break;
|
2046 |
+
|
2047 |
+
case 'E#A408': // Contrast
|
2048 |
+
|
2049 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
2050 |
+
return $wppa_exif_error_output;
|
2051 |
+
}
|
2052 |
+
|
2053 |
+
switch ( $data ) {
|
2054 |
+
case 0:
|
2055 |
+
$result = __( 'Normal', 'wp-photo-album-plus' );
|
2056 |
+
break;
|
2057 |
+
case 1:
|
2058 |
+
$result = __( 'Soft', 'wp-photo-album-plus' );
|
2059 |
+
break;
|
2060 |
+
case 2:
|
2061 |
+
$result = __( 'Hard', 'wp-photo-album-plus' );
|
2062 |
+
break;
|
2063 |
+
default:
|
2064 |
+
$result = __( 'reserved', 'wp-photo-album-plus' );
|
2065 |
+
}
|
2066 |
+
|
2067 |
+
return $result;
|
2068 |
+
break;
|
2069 |
+
|
2070 |
+
case 'E#A409': // Saturation
|
2071 |
+
|
2072 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
2073 |
+
return $wppa_exif_error_output;
|
2074 |
+
}
|
2075 |
+
|
2076 |
+
switch ( $data ) {
|
2077 |
+
case 0:
|
2078 |
+
$result = __( 'Normal', 'wp-photo-album-plus' );
|
2079 |
+
break;
|
2080 |
+
case 1:
|
2081 |
+
$result = __( 'Low saturation', 'wp-photo-album-plus' );
|
2082 |
+
break;
|
2083 |
+
case 2:
|
2084 |
+
$result = __( 'High saturation', 'wp-photo-album-plus' );
|
2085 |
+
break;
|
2086 |
+
default:
|
2087 |
+
$result = __( 'reserved', 'wp-photo-album-plus' );
|
2088 |
+
}
|
2089 |
+
|
2090 |
+
return $result;
|
2091 |
+
break;
|
2092 |
+
|
2093 |
+
case 'E#A40A': // Sharpness
|
2094 |
+
|
2095 |
+
if ( ! wppa_is_valid_integer( $data ) ) {
|
2096 |
+
return $wppa_exif_error_output;
|
2097 |
+
}
|
2098 |
+
|
2099 |
+
switch ( $data ) {
|
2100 |
+
case 0:
|
2101 |
+
$result = __( 'Normal', 'wp-photo-album-plus' );
|
2102 |
+
break;
|
2103 |
+
case 1:
|
2104 |
+
$result = __( 'Soft', 'wp-photo-album-plus' );
|
2105 |
+
break;
|
2106 |
+
case 2:
|
2107 |
+
$result = __( 'Hard', 'wp-photo-album-plus' );
|
2108 |
+
break;
|
2109 |
+
default:
|
2110 |
+
$result = __( 'reserved', 'wp-photo-album-plus' );
|
2111 |
+
}
|
2112 |
+
|
2113 |
+
return $result;
|
2114 |
+
break;
|
2115 |
+
|
2116 |
+
case 'E#A40C': // SubjectDistanceRange
|
2117 |
+
|
2118 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
2119 |
+
|
2120 |
+
switch ( $data ) {
|
2121 |
+
case 0: $result = __( 'unknown', 'wp-photo-album-plus' ); break;
|
2122 |
+
case 1: $result = __( 'Macro', 'wp-photo-album-plus' ); break;
|
2123 |
+
case 2: $result = __( 'Close view', 'wp-photo-album-plus' ); break;
|
2124 |
+
case 3: $result = __( 'Distant view', 'wp-photo-album-plus' ); break;
|
2125 |
+
default: $result = __( 'reserved', 'wp-photo-album-plus' );
|
2126 |
+
}
|
2127 |
+
return $result;
|
2128 |
+
break;
|
2129 |
+
|
2130 |
+
case 'E#BC01': // PixelFormat
|
2131 |
+
|
2132 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
2133 |
+
|
2134 |
+
switch ( $data ) {
|
2135 |
+
case 0x5: $result = __( 'Black & White', 'wp-photo-album-plus' ); break;
|
2136 |
+
case 0x8: $result = __( '8-bit Gray', 'wp-photo-album-plus' ); break;
|
2137 |
+
case 0x9: $result = __( '16-bit BGR555', 'wp-photo-album-plus' ); break;
|
2138 |
+
case 0xa: $result = __( '16-bit BGR565', 'wp-photo-album-plus' ); break;
|
2139 |
+
case 0xb: $result = __( '16-bit Gray', 'wp-photo-album-plus' ); break;
|
2140 |
+
case 0xc: $result = __( '24-bit BGR', 'wp-photo-album-plus' ); break;
|
2141 |
+
case 0xd: $result = __( '24-bit RGB', 'wp-photo-album-plus' ); break;
|
2142 |
+
case 0xe: $result = __( '32-bit BGR', 'wp-photo-album-plus' ); break;
|
2143 |
+
case 0xf: $result = __( '32-bit BGRA', 'wp-photo-album-plus' ); break;
|
2144 |
+
case 0x10: $result = __( '32-bit PBGRA', 'wp-photo-album-plus' ); break;
|
2145 |
+
case 0x11: $result = __( '32-bit Gray Float', 'wp-photo-album-plus' ); break;
|
2146 |
+
case 0x12: $result = __( '48-bit RGB Fixed Point', 'wp-photo-album-plus' ); break;
|
2147 |
+
case 0x13: $result = __( '32-bit BGR101010', 'wp-photo-album-plus' ); break;
|
2148 |
+
case 0x15: $result = __( '48-bit RGB', 'wp-photo-album-plus' ); break;
|
2149 |
+
case 0x16: $result = __( '64-bit RGBA', 'wp-photo-album-plus' ); break;
|
2150 |
+
case 0x17: $result = __( '64-bit PRGBA', 'wp-photo-album-plus' ); break;
|
2151 |
+
case 0x18: $result = __( '96-bit RGB Fixed Point', 'wp-photo-album-plus' ); break;
|
2152 |
+
case 0x19: $result = __( '128-bit RGBA Float', 'wp-photo-album-plus' ); break;
|
2153 |
+
case 0x1a: $result = __( '128-bit PRGBA Float', 'wp-photo-album-plus' ); break;
|
2154 |
+
case 0x1b: $result = __( '128-bit RGB Float', 'wp-photo-album-plus' ); break;
|
2155 |
+
case 0x1c: $result = __( '32-bit CMYK', 'wp-photo-album-plus' ); break;
|
2156 |
+
case 0x1d: $result = __( '64-bit RGBA Fixed Point', 'wp-photo-album-plus' ); break;
|
2157 |
+
case 0x1e: $result = __( '128-bit RGBA Fixed Point', 'wp-photo-album-plus' ); break;
|
2158 |
+
case 0x1f: $result = __( '64-bit CMYK', 'wp-photo-album-plus' ); break;
|
2159 |
+
case 0x20: $result = __( '24-bit 3 Channels', 'wp-photo-album-plus' ); break;
|
2160 |
+
case 0x21: $result = __( '32-bit 4 Channels', 'wp-photo-album-plus' ); break;
|
2161 |
+
case 0x22: $result = __( '40-bit 5 Channels', 'wp-photo-album-plus' ); break;
|
2162 |
+
case 0x23: $result = __( '48-bit 6 Channels', 'wp-photo-album-plus' ); break;
|
2163 |
+
case 0x24: $result = __( '56-bit 7 Channels', 'wp-photo-album-plus' ); break;
|
2164 |
+
case 0x25: $result = __( '64-bit 8 Channels', 'wp-photo-album-plus' ); break;
|
2165 |
+
case 0x26: $result = __( '48-bit 3 Channels', 'wp-photo-album-plus' ); break;
|
2166 |
+
case 0x27: $result = __( '64-bit 4 Channels', 'wp-photo-album-plus' ); break;
|
2167 |
+
case 0x28: $result = __( '80-bit 5 Channels', 'wp-photo-album-plus' ); break;
|
2168 |
+
case 0x29: $result = __( '96-bit 6 Channels', 'wp-photo-album-plus' ); break;
|
2169 |
+
case 0x2a: $result = __( '112-bit 7 Channels', 'wp-photo-album-plus' ); break;
|
2170 |
+
case 0x2b: $result = __( '128-bit 8 Channels', 'wp-photo-album-plus' ); break;
|
2171 |
+
case 0x2c: $result = __( '40-bit CMYK Alpha', 'wp-photo-album-plus' ); break;
|
2172 |
+
case 0x2d: $result = __( '80-bit CMYK Alpha', 'wp-photo-album-plus' ); break;
|
2173 |
+
case 0x2e: $result = __( '32-bit 3 Channels Alpha', 'wp-photo-album-plus' ); break;
|
2174 |
+
case 0x2f: $result = __( '40-bit 4 Channels Alpha', 'wp-photo-album-plus' ); break;
|
2175 |
+
case 0x30: $result = __( '48-bit 5 Channels Alpha', 'wp-photo-album-plus' ); break;
|
2176 |
+
case 0x31: $result = __( '56-bit 6 Channels Alpha', 'wp-photo-album-plus' ); break;
|
2177 |
+
case 0x32: $result = __( '64-bit 7 Channels Alpha', 'wp-photo-album-plus' ); break;
|
2178 |
+
case 0x33: $result = __( '72-bit 8 Channels Alpha', 'wp-photo-album-plus' ); break;
|
2179 |
+
case 0x34: $result = __( '64-bit 3 Channels Alpha', 'wp-photo-album-plus' ); break;
|
2180 |
+
case 0x35: $result = __( '80-bit 4 Channels Alpha', 'wp-photo-album-plus' ); break;
|
2181 |
+
case 0x36: $result = __( '96-bit 5 Channels Alpha', 'wp-photo-album-plus' ); break;
|
2182 |
+
case 0x37: $result = __( '112-bit 6 Channels Alpha', 'wp-photo-album-plus' ); break;
|
2183 |
+
case 0x38: $result = __( '128-bit 7 Channels Alpha', 'wp-photo-album-plus' ); break;
|
2184 |
+
case 0x39: $result = __( '144-bit 8 Channels Alpha', 'wp-photo-album-plus' ); break;
|
2185 |
+
case 0x3a: $result = __( '64-bit RGBA Half', 'wp-photo-album-plus' ); break;
|
2186 |
+
case 0x3b: $result = __( '48-bit RGB Half', 'wp-photo-album-plus' ); break;
|
2187 |
+
case 0x3d: $result = __( '32-bit RGBE', 'wp-photo-album-plus' ); break;
|
2188 |
+
case 0x3e: $result = __( '16-bit Gray Half', 'wp-photo-album-plus' ); break;
|
2189 |
+
case 0x3f: $result = __( '32-bit Gray Fixed Point', 'wp-photo-album-plus' ); break;
|
2190 |
+
default: $result = __( 'reserved', 'wp-photo-album-plus' );
|
2191 |
+
}
|
2192 |
+
return $result;
|
2193 |
+
break;
|
2194 |
+
|
2195 |
+
case 'E#BC02': // Transformation
|
2196 |
+
|
2197 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
2198 |
+
|
2199 |
+
switch( $data ) {
|
2200 |
+
case 0: $result = __( 'Horizontal (normal)', 'wp-photo-album-plus' ); break;
|
2201 |
+
case 1: $result = __( 'Mirror vertical', 'wp-photo-album-plus' ); break;
|
2202 |
+
case 2: $result = __( 'Mirror horizontal', 'wp-photo-album-plus' ); break;
|
2203 |
+
case 3: $result = __( 'Rotate 180', 'wp-photo-album-plus' ); break;
|
2204 |
+
case 4: $result = __( 'Rotate 90 CW', 'wp-photo-album-plus' ); break;
|
2205 |
+
case 5: $result = __( 'Mirror horizontal and rotate 90 CW', 'wp-photo-album-plus' ); break;
|
2206 |
+
case 6: $result = __( 'Mirror horizontal and rotate 270 CW', 'wp-photo-album-plus' ); break;
|
2207 |
+
case 7: $result = __( 'Rotate 270 CW', 'wp-photo-album-plus' ); break;
|
2208 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
2209 |
}
|
2210 |
+
return $result;
|
2211 |
+
|
2212 |
+
case 'E#BC03': // Uncompressed
|
2213 |
+
|
2214 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
2215 |
|
2216 |
+
switch( $data ) {
|
2217 |
+
case 0: $result = __( 'No', 'wp-photo-album-plus' ); break;
|
2218 |
+
case 1: $result = __( 'Yes', 'wp-photo-album-plus' ); break;
|
2219 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
2220 |
+
}
|
2221 |
return $result;
|
|
|
2222 |
|
2223 |
+
case 'E#BC04': // ImageType
|
2224 |
|
2225 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
2226 |
+
|
2227 |
+
switch( $data ) {
|
2228 |
+
case 1: $result = __( 'Preview', 'wp-photo-album-plus' ); break;
|
2229 |
+
case 2: $result = __( 'Page', 'wp-photo-album-plus' ); break;
|
2230 |
+
case 3: $result = __( 'Preview', 'wp-photo-album-plus' ) . ' ' . __( 'Page', 'wp-photo-album-plus' ); break;
|
2231 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
2232 |
}
|
2233 |
+
return $result;
|
2234 |
|
2235 |
+
/*
|
2236 |
+
0xbc80 ImageWidth
|
2237 |
+
0xbc81 ImageHeight
|
2238 |
+
0xbc82 WidthResolution
|
2239 |
+
0xbc83 HeightResolution
|
2240 |
+
0xbcc0 ImageOffset
|
2241 |
+
0xbcc1 ImageByteCount
|
2242 |
+
0xbcc2 AlphaOffset
|
2243 |
+
0xbcc3 AlphaByteCount
|
2244 |
+
*/
|
2245 |
+
|
2246 |
+
|
2247 |
+
case 'E#BCC4': // ImageDataDiscard
|
2248 |
+
|
2249 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
2250 |
+
|
2251 |
+
switch( $data ) {
|
2252 |
+
case 0: $result = __( 'Full Resolution', 'wp-photo-album-plus' ); break;
|
2253 |
+
case 1: $result = __( 'Flexbits Discarded', 'wp-photo-album-plus' ); break;
|
2254 |
+
case 2: $result = __( 'HighPass Frequency Data Discarded', 'wp-photo-album-plus' ); break;
|
2255 |
+
case 3: $result = __( 'Highpass and LowPass Frequency Data Discarded', 'wp-photo-album-plus' ); break;
|
2256 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
2257 |
}
|
2258 |
+
return $result;
|
2259 |
+
|
2260 |
+
case 'E#BCC5': // AlphaDataDiscard
|
2261 |
|
2262 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
2263 |
+
|
2264 |
+
switch( $data ) {
|
2265 |
+
case 0: $result = __( 'Full Resolution', 'wp-photo-album-plus' ); break;
|
2266 |
+
case 1: $result = __( 'Flexbits Discarded', 'wp-photo-album-plus' ); break;
|
2267 |
+
case 2: $result = __( 'HighPass Frequency Data Discarded', 'wp-photo-album-plus' ); break;
|
2268 |
+
case 3: $result = __( 'Highpass and LowPass Frequency Data Discarded', 'wp-photo-album-plus' ); break;
|
2269 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
2270 |
+
}
|
2271 |
return $result;
|
2272 |
+
/*
|
2273 |
+
0xc427 OceScanjobDesc
|
2274 |
+
0xc428 OceApplicationSelector
|
2275 |
+
0xc429 OceIDNumber
|
2276 |
+
0xc42a OceImageLogic
|
2277 |
+
0xc44f Annotations
|
2278 |
+
0xc4a5 PrintIM
|
2279 |
+
0xc573 OriginalFileName
|
2280 |
+
*/
|
2281 |
+
case 'E#C580': // USPTOOriginalContentType
|
2282 |
|
2283 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
2284 |
|
2285 |
+
switch( $data ) {
|
2286 |
+
case 0: $result = __( 'Text or Drawing', 'wp-photo-album-plus' ); break;
|
2287 |
+
case 1: $result = __( 'Grayscale', 'wp-photo-album-plus' ); break;
|
2288 |
+
case 2: $result = __( 'Color', 'wp-photo-album-plus' ); break;
|
2289 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
2290 |
+
}
|
2291 |
+
return $result;
|
2292 |
+
|
2293 |
+
/*
|
2294 |
+
0xc5e0 CR2CFAPattern
|
2295 |
+
1 => '0 1 1 2' = [Red,Green][Green,Blue]
|
2296 |
+
4 => '1 0 2 1' = [Green,Red][Blue,Green]
|
2297 |
+
3 => '1 2 0 1' = [Green,Blue][Red,Green]
|
2298 |
+
2 => '2 1 1 0' = [Blue,Green][Green,Red]
|
2299 |
+
|
2300 |
+
|
2301 |
+
0xc612 DNGVersion int8u[4]! IFD0 (tags 0xc612-0xc7b5 are defined by the DNG specification unless otherwise noted. See https://helpx.adobe.com/photoshop/digital-negative.html for the specification)
|
2302 |
+
0xc613 DNGBackwardVersion int8u[4]! IFD0
|
2303 |
+
0xc614 UniqueCameraModel string IFD0
|
2304 |
+
0xc615 LocalizedCameraModel string IFD0
|
2305 |
+
0xc616 CFAPlaneColor no SubIFD
|
2306 |
+
*/
|
2307 |
+
|
2308 |
+
case 'E#C617': // CFALayout
|
2309 |
+
|
2310 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
2311 |
+
|
2312 |
+
switch( $data ) {
|
2313 |
+
case 1: $result = __( 'Rectangular', 'wp-photo-album-plus' ); break;
|
2314 |
+
case 2: $result = __( 'Even columns offset down 1/2 row', 'wp-photo-album-plus' ); break;
|
2315 |
+
case 3: $result = __( 'Even columns offset up 1/2 row', 'wp-photo-album-plus' ); break;
|
2316 |
+
case 4: $result = __( 'Even rows offset right 1/2 column', 'wp-photo-album-plus' ); break;
|
2317 |
+
case 5: $result = __( 'Even rows offset left 1/2 column', 'wp-photo-album-plus' ); break;
|
2318 |
+
case 6: $result = __( 'Even rows offset up by 1/2 row, even columns offset left by 1/2 column', 'wp-photo-album-plus' ); break;
|
2319 |
+
case 7: $result = __( 'Even rows offset up by 1/2 row, even columns offset right by 1/2 column', 'wp-photo-album-plus' ); break;
|
2320 |
+
case 8: $result = __( 'Even rows offset down by 1/2 row, even columns offset left by 1/2 column', 'wp-photo-album-plus' ); break;
|
2321 |
+
case 9: $result = __( 'Even rows offset down by 1/2 row, even columns offset right by 1/2 column', 'wp-photo-album-plus' ); break;
|
2322 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
2323 |
}
|
2324 |
+
return $result;
|
2325 |
|
2326 |
+
case 'E#C6FD': // ProfileEmbedPolicy
|
2327 |
+
|
2328 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
2329 |
+
|
2330 |
+
switch( $data ) {
|
2331 |
+
case 0: $result = __( 'Allow Copying', 'wp-photo-album-plus' ); break;
|
2332 |
+
case 1: $result = __( 'Embed if Used', 'wp-photo-album-plus' ); break;
|
2333 |
+
case 2: $result = __( 'Never Embed', 'wp-photo-album-plus' ); break;
|
2334 |
+
case 3: $result = __( 'No Restrictions', 'wp-photo-album-plus' ); break;
|
2335 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
2336 |
+
}
|
2337 |
+
return $result;
|
2338 |
+
|
2339 |
+
case 'E#C71A': // PreviewColorSpace
|
2340 |
+
|
2341 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
2342 |
+
|
2343 |
+
switch( $data ) {
|
2344 |
+
case 0: $result = __( 'Unknown', 'wp-photo-album-plus' ); break;
|
2345 |
+
case 1: $result = __( 'Gray Gamma 2.2', 'wp-photo-album-plus' ); break;
|
2346 |
+
case 2: $result = __( 'sRGB', 'wp-photo-album-plus' ); break;
|
2347 |
+
case 3: $result = __( 'Adobe RGB', 'wp-photo-album-plus' ); break;
|
2348 |
+
case 4: $result = __( 'ProPhoto RGB', 'wp-photo-album-plus' ); break;
|
2349 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
2350 |
}
|
2351 |
+
return $result;
|
2352 |
+
|
2353 |
+
case 'E#C7A3': // ProfileHueSatMapEncoding
|
2354 |
+
case 'E#C7A4': // ProfileLookTableEncoding
|
2355 |
|
2356 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
2357 |
+
|
2358 |
+
switch( $data ) {
|
2359 |
+
case 0: $result = __( 'Linear', 'wp-photo-album-plus' ); break;
|
2360 |
+
case 1: $result = __( 'sRGB', 'wp-photo-album-plus' ); break;
|
2361 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
2362 |
+
}
|
2363 |
return $result;
|
|
|
2364 |
|
2365 |
+
case 'E#C7A6': // DefaultBlackRender
|
2366 |
+
|
2367 |
+
if ( ! wppa_is_valid_integer( $data ) ) return $wppa_exif_error_output;
|
2368 |
+
|
2369 |
+
switch( $data ) {
|
2370 |
+
case 0: $result = __( 'Auto', 'wp-photo-album-plus' ); break;
|
2371 |
+
case 1: $result = __( 'None', 'wp-photo-album-plus' ); break;
|
2372 |
+
default: $result = __( 'Undefined', 'wp-photo-album-plus' );
|
2373 |
+
}
|
2374 |
+
return $result;
|
2375 |
|
2376 |
// Unformatted
|
2377 |
default:
|
2382 |
|
2383 |
// Empty data
|
2384 |
else {
|
2385 |
+
$result = '<span title="' . esc_attr( __( 'No data', 'wp-photo-album-plus' ) ) . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
2386 |
}
|
2387 |
|
2388 |
return $result;
|
2393 |
|
2394 |
// Must contain a '/'
|
2395 |
if ( strpos( $data, '/' ) == false ) {
|
2396 |
+
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Missing /', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
2397 |
return false;
|
2398 |
}
|
2399 |
|
2402 |
|
2403 |
// Divide by zero?
|
2404 |
if ( $t[1] == 0 ) {
|
2405 |
+
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Divide by zero', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
2406 |
return false;
|
2407 |
}
|
2408 |
|
2409 |
// Signed while not permitted?
|
2410 |
if ( ! $signed && ( $t[0] < 0 || $t[1] < 0 ) ) {
|
2411 |
+
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Must be positive', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
2412 |
+
return false;
|
2413 |
+
}
|
2414 |
+
|
2415 |
+
// May be zero
|
2416 |
+
if ( $t[0] / $t[1] == 0 ) {
|
2417 |
+
return true;
|
2418 |
+
}
|
2419 |
+
|
2420 |
+
// Unlikely value?
|
2421 |
+
if ( $t[0] / $t[1] > 100000 || abs( $t[0] / $t[1] ) < 0.00001 ) {
|
2422 |
+
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Unlikely value', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
2423 |
return false;
|
2424 |
}
|
2425 |
|
2427 |
return true;
|
2428 |
}
|
2429 |
|
2430 |
+
function wppa_simplify_ratio( $data ) {
|
2431 |
+
|
2432 |
+
// make array
|
2433 |
+
$t = explode( '/', $data );
|
2434 |
+
$x = $t[0];
|
2435 |
+
$y = $t[1];
|
2436 |
+
|
2437 |
+
// Is already simplified to the max?
|
2438 |
+
if ( $x == 1 ) {
|
2439 |
+
$result = $data;
|
2440 |
+
return $result;
|
2441 |
+
}
|
2442 |
+
|
2443 |
+
// Result is zero?
|
2444 |
+
if ( $x == 0 ) {
|
2445 |
+
$result = '0';
|
2446 |
+
return $result;
|
2447 |
+
}
|
2448 |
+
|
2449 |
+
// See if it can be simplified to '1/nn'
|
2450 |
+
if ( round( $y / $x ) == $y / $x ) {
|
2451 |
+
$result = '1/' . ( $y / $x );
|
2452 |
+
return $result;
|
2453 |
+
}
|
2454 |
+
|
2455 |
+
/* to be continued */
|
2456 |
+
$prime = array(2,3,5,7,11,13,17);
|
2457 |
+
foreach( $prime as $p ) {
|
2458 |
+
while ( wppa_is_divisible( $x, $p ) && wppa_is_divisible( $y, $p ) ) {
|
2459 |
+
$x = $x / $p;
|
2460 |
+
$y = $y / $p;
|
2461 |
+
}
|
2462 |
+
}
|
2463 |
+
$result = $x . '/' . $y;
|
2464 |
+
|
2465 |
+
$result = $data;
|
2466 |
+
return $result;
|
2467 |
+
}
|
2468 |
+
|
2469 |
+
function wppa_is_valid_integer( $data ) {
|
2470 |
global $wppa_exif_error_output;
|
2471 |
|
2472 |
// Must be integer
|
2473 |
if ( ! wppa_is_int( $data ) ) {
|
2474 |
+
$wppa_exif_error_output = '<span title="' . esc_attr( __( 'Invalid format', 'wp-photo-album-plus' ) ) . ':' . $data . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>';
|
2475 |
return false;
|
2476 |
}
|
2477 |
|
2478 |
+
// Ok.
|
2479 |
+
return true;
|
2480 |
+
}
|
2481 |
+
|
2482 |
+
function wppa_iptc_clean_garbage() {
|
2483 |
+
global $wpdb;
|
2484 |
+
|
2485 |
+
// Remove empty tags
|
2486 |
+
// $empty = $wpdb->query( "DELETE FROM `" . WPPA_IPTC . "` WHERE `description` = '' OR `description` = ' ' OR `description` = ' '" );
|
2487 |
+
// if ( $empty ) {
|
2488 |
+
// wppa_log( 'dbg', $empty . ' empty iptc entries removed.' );
|
2489 |
+
// }
|
2490 |
+
|
2491 |
+
// Remove labels that are no longer used
|
2492 |
+
$labels = $wpdb->get_results( "SELECT DISTINCT `tag` FROM `" . WPPA_IPTC . "` WHERE `photo` = '0'", ARRAY_A );
|
2493 |
+
if ( ! empty( $labels ) ) {
|
2494 |
+
foreach( $labels as $label ) {
|
2495 |
+
$used = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `" . WPPA_IPTC . "` WHERE `tag` = %s AND `photo` <> '0'", $label['tag'] ) );
|
2496 |
+
if ( $used == 0 ) {
|
2497 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM `" . WPPA_IPTC . "` WHERE `tag` = %s AND `photo` = '0'", $label['tag'] ) );
|
2498 |
+
wppa_log( 'dbg', 'Iptc tag label ' . $label['tag'] . ' removed.' );
|
2499 |
+
}
|
2500 |
+
}
|
2501 |
+
}
|
2502 |
+
}
|
2503 |
+
|
2504 |
+
function wppa_exif_clean_garbage() {
|
2505 |
+
global $wpdb;
|
2506 |
+
|
2507 |
+
// Remove empty tags
|
2508 |
+
// $empty = $wpdb->query( "DELETE FROM `" . WPPA_EXIF . "` WHERE `description` = '' OR `description` = ' ' OR `description` = ' '" );
|
2509 |
+
// wppa_log( 'dbg', $empty . ' empty exif entries removed.' );
|
2510 |
+
|
2511 |
+
// Remove labels that are no longer used
|
2512 |
+
$labels = $wpdb->get_results( "SELECT DISTINCT `tag` FROM `" . WPPA_EXIF . "` WHERE `photo` = '0'", ARRAY_A );
|
2513 |
+
if ( ! empty( $labels ) ) {
|
2514 |
+
foreach( $labels as $label ) {
|
2515 |
+
$used = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `" . WPPA_EXIF . "` WHERE `tag` = %s AND `photo` <> '0'", $label['tag'] ) );
|
2516 |
+
if ( $used == 0 ) {
|
2517 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM `" . WPPA_EXIF . "` WHERE `tag` = %s AND `photo` = '0'", $label['tag'] ) );
|
2518 |
+
wppa_log( 'dbg', 'Exif tag label ' . $label['tag'] . ' removed.' );
|
2519 |
+
}
|
2520 |
+
}
|
2521 |
+
}
|
2522 |
+
}
|
2523 |
+
|
2524 |
+
// (Re-)calculate and store formatted exif entries for photo $photo
|
2525 |
+
function wppa_fix_exif_format( $photo ) {
|
2526 |
+
global $wpdb;
|
2527 |
+
|
2528 |
+
if ( ! wppa_is_int( $photo ) ) {
|
2529 |
+
wppa_log( 'Err', 'wppa_fix_exif_format() called with arg: ' . $photo );
|
2530 |
return false;
|
2531 |
}
|
2532 |
|
2533 |
+
$exifs = $wpdb->get_results( "SELECT * FROM `" . WPPA_EXIF . "` WHERE `photo` = $photo", ARRAY_A );
|
2534 |
+
|
2535 |
+
if ( ! empty( $exifs ) ) {
|
2536 |
+
|
2537 |
+
$brand = wppa_get_camera_brand( $photo );
|
2538 |
+
|
2539 |
+
foreach( $exifs as $exif ) {
|
2540 |
+
|
2541 |
+
$f_description = strip_tags( wppa_format_exif( $exif['tag'], $exif['description'], $brand ) );
|
2542 |
+
$tagbrand = ( trim( wppa_exif_tagname( hexdec( substr( $exif['tag'], 2, 4 ) ), $brand, 'brandonly' ), ': ' ) ? $brand : '' );
|
2543 |
+
|
2544 |
+
// If f_description or thabrand changed: update
|
2545 |
+
if ( $f_description != $exif['f_description'] || $tagbrand != $exif['brand'] ) {
|
2546 |
+
$id = $exif['id'];
|
2547 |
+
$wpdb->query( $wpdb->prepare( "UPDATE `" . WPPA_EXIF . "` SET `f_description` = %s, `brand` = %s WHERE `id` = %s", $f_description, $tagbrand, $id ) );
|
2548 |
+
$photodata = wppa_cache_photo( $photo );
|
2549 |
+
|
2550 |
+
// If the format changed and the exif tag is used in the description, the photo must be re-indexed
|
2551 |
+
if ( strpos( $photodata['description'], $exif['tag'] ) !== false ) {
|
2552 |
+
$wpdb->query( "UPDATE `" . WPPA_PHOTOS . "` SET `indexdtm` = '' WHERE `id` = $photo" );
|
2553 |
+
wppa_schedule_maintenance_proc( 'wppa_remake_index_photos' );
|
2554 |
+
}
|
2555 |
+
}
|
2556 |
+
}
|
2557 |
+
}
|
2558 |
+
}
|
2559 |
+
|
2560 |
+
// Process the iptc data
|
2561 |
+
function wppa_import_iptc( $id, $info, $nodelete = false ) {
|
2562 |
+
global $wpdb;
|
2563 |
+
static $labels;
|
2564 |
+
|
2565 |
+
$doit = false;
|
2566 |
+
// Do we need this?
|
2567 |
+
if ( wppa_switch( 'save_iptc' ) ) $doit = true;
|
2568 |
+
if ( substr( wppa_opt( 'newphoto_name_method' ), 0, 2 ) == '2#' ) $doit = true;
|
2569 |
+
if ( ! $doit ) return;
|
2570 |
+
|
2571 |
+
wppa_dbg_msg( 'wppa_import_iptc called for id='.$id );
|
2572 |
+
wppa_dbg_msg( 'array is'.( is_array( $info ) ? ' ' : ' NOT ' ).'available' );
|
2573 |
+
wppa_dbg_msg( 'APP13 is '.( isset( $info['APP13'] ) ? 'set' : 'NOT set' ) );
|
2574 |
+
|
2575 |
+
// Is iptc data present?
|
2576 |
+
if ( !isset( $info['APP13'] ) ) return false; // No iptc data avail
|
2577 |
+
//var_dump( $info );
|
2578 |
+
// Parse
|
2579 |
+
$iptc = iptcparse( $info['APP13'] );
|
2580 |
+
if ( ! is_array( $iptc ) ) return false; // No data avail
|
2581 |
+
|
2582 |
+
// There is iptc data for this image.
|
2583 |
+
// First delete any existing ipts data for this image
|
2584 |
+
if ( ! $nodelete ) {
|
2585 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM `".WPPA_IPTC."` WHERE `photo` = %s", $id ) );
|
2586 |
+
}
|
2587 |
+
|
2588 |
+
// Find defined labels
|
2589 |
+
if ( ! is_array( $labels ) ) {
|
2590 |
+
$result = $wpdb->get_results( "SELECT `tag` FROM `".WPPA_IPTC."` WHERE `photo` = '0' ORDER BY `tag`", ARRAY_N );
|
2591 |
+
|
2592 |
+
if ( ! is_array( $result ) ) $result = array();
|
2593 |
+
$labels = array();
|
2594 |
+
foreach ( $result as $res ) {
|
2595 |
+
$labels[] = $res['0'];
|
2596 |
+
}
|
2597 |
+
}
|
2598 |
+
|
2599 |
+
foreach ( array_keys( $iptc ) as $s ) {
|
2600 |
+
|
2601 |
+
// Check for valid item
|
2602 |
+
if ( $s == '2#000' ) continue; // Skip this one
|
2603 |
+
if ( $s == '1#000' ) continue; // Skip this one
|
2604 |
+
|
2605 |
+
if ( is_array( $iptc[$s] ) ) {
|
2606 |
+
$c = count ( $iptc[$s] );
|
2607 |
+
for ( $i=0; $i <$c; $i++ ) {
|
2608 |
+
|
2609 |
+
// Process item
|
2610 |
+
wppa_dbg_msg( 'IPTC '.$s.' = '.$iptc[$s][$i] );
|
2611 |
+
|
2612 |
+
// Check labels first
|
2613 |
+
if ( ! in_array( $s, $labels ) ) {
|
2614 |
+
|
2615 |
+
// Add to labels
|
2616 |
+
$labels[] = $s;
|
2617 |
+
|
2618 |
+
// Add to db
|
2619 |
+
$photo = '0';
|
2620 |
+
$tag = $s;
|
2621 |
+
$desc = $s.':';
|
2622 |
+
if ( $s == '2#005' ) $desc = 'Graphic name:';
|
2623 |
+
if ( $s == '2#010' ) $desc = 'Urgency:';
|
2624 |
+
if ( $s == '2#015' ) $desc = 'Category:';
|
2625 |
+
if ( $s == '2#020' ) $desc = 'Supp categories:';
|
2626 |
+
if ( $s == '2#040' ) $desc = 'Spec instr:';
|
2627 |
+
if ( $s == '2#055' ) $desc = 'Creation date:';
|
2628 |
+
if ( $s == '2#080' ) $desc = 'Photographer:';
|
2629 |
+
if ( $s == '2#085' ) $desc = 'Credit byline title:';
|
2630 |
+
if ( $s == '2#090' ) $desc = 'City:';
|
2631 |
+
if ( $s == '2#095' ) $desc = 'State:';
|
2632 |
+
if ( $s == '2#101' ) $desc = 'Country:';
|
2633 |
+
if ( $s == '2#103' ) $desc = 'Otr:';
|
2634 |
+
if ( $s == '2#105' ) $desc = 'Headline:';
|
2635 |
+
if ( $s == '2#110' ) $desc = 'Source:';
|
2636 |
+
if ( $s == '2#115' ) $desc = 'Photo source:';
|
2637 |
+
if ( $s == '2#120' ) $desc = 'Caption:';
|
2638 |
+
$status = 'display';
|
2639 |
+
if ( $s == '1#090' ) $status = 'hide';
|
2640 |
+
if ( $desc == $s.':' ) $status= 'hide';
|
2641 |
+
// if ( $s == '2#000' ) $status = 'hide';
|
2642 |
+
$bret = wppa_create_iptc_entry( array( 'photo' => $photo, 'tag' => $tag, 'description' => $desc, 'status' => $status ) );
|
2643 |
+
if ( ! $bret ) wppa_log( 'Warning', 'Could not add IPTC tag '.$tag.' for photo '.$photo );
|
2644 |
+
}
|
2645 |
+
|
2646 |
+
// Now add poto specific data item
|
2647 |
+
$photo = $id;
|
2648 |
+
$tag = $s;
|
2649 |
+
$desc = $iptc[$s][$i];
|
2650 |
+
if ( ! seems_utf8( $desc ) ) {
|
2651 |
+
$desc = utf8_encode( $desc );
|
2652 |
+
}
|
2653 |
+
$status = 'default';
|
2654 |
+
$bret = wppa_create_iptc_entry( array( 'photo' => $photo, 'tag' => $tag, 'description' => $desc, 'status' => $status ) );
|
2655 |
+
if ( ! $bret ) wppa_log( 'Warning', 'Could not add IPTC tag '.$tag.' for photo '.$photo );
|
2656 |
+
}
|
2657 |
+
}
|
2658 |
+
}
|
2659 |
+
}
|
2660 |
+
|
2661 |
+
function wppa_get_exif_datetime( $file ) {
|
2662 |
+
|
2663 |
+
// Make sure we do not process a -o1.jpg file
|
2664 |
+
$file = str_replace( '-o1.jpg', '.jpg', $file );
|
2665 |
+
return wppa_get_exif_item( $file, 'DateTimeOriginal' );
|
2666 |
+
}
|
2667 |
+
|
2668 |
+
function wppa_get_exif_orientation( $file ) {
|
2669 |
+
|
2670 |
+
return wppa_get_exif_item( $file, 'Orientation' );
|
2671 |
+
}
|
2672 |
+
|
2673 |
+
function wppa_get_exif_item( $file, $item ) {
|
2674 |
+
|
2675 |
+
// File exists?
|
2676 |
+
if ( ! is_file( $file ) ) {
|
2677 |
+
return false;
|
2678 |
+
}
|
2679 |
+
|
2680 |
+
// Exif functions present?
|
2681 |
+
if ( ! function_exists( 'exif_imagetype' ) ) {
|
2682 |
+
return false;
|
2683 |
+
}
|
2684 |
+
|
2685 |
+
// Check filetype
|
2686 |
+
$image_type = @ exif_imagetype( $file );
|
2687 |
+
if ( $image_type != IMAGETYPE_JPEG ) {
|
2688 |
+
return false;
|
2689 |
+
}
|
2690 |
+
|
2691 |
+
// Can get exif data?
|
2692 |
+
if ( ! function_exists( 'exif_read_data' ) ) {
|
2693 |
+
return false;
|
2694 |
+
}
|
2695 |
+
|
2696 |
+
// Get exif data
|
2697 |
+
$exif = @ exif_read_data( $file, 'EXIF' );
|
2698 |
+
if ( ! is_array( $exif ) ) {
|
2699 |
+
return false;
|
2700 |
+
}
|
2701 |
+
|
2702 |
+
// Data present
|
2703 |
+
if ( isset( $exif[$item] ) ) {
|
2704 |
+
return $exif[$item];
|
2705 |
+
}
|
2706 |
+
|
2707 |
+
// Nothing found
|
2708 |
+
return false;
|
2709 |
}
|
2710 |
|
2711 |
+
|
2712 |
+
function wppa_import_exif( $id, $file, $nodelete = false ) {
|
2713 |
global $wpdb;
|
2714 |
+
static $labels;
|
2715 |
+
static $names;
|
2716 |
+
global $wppa;
|
2717 |
+
|
2718 |
+
// Do we need this?
|
2719 |
+
if ( ! wppa_switch( 'save_exif' ) ) return;
|
2720 |
+
|
2721 |
+
// Make sure we do not process a -o1.jpg file
|
2722 |
+
$file = str_replace( '-o1.jpg', '.jpg', $file );
|
2723 |
+
|
2724 |
+
// Check filetype
|
2725 |
+
if ( ! function_exists( 'exif_imagetype' ) ) return false;
|
2726 |
+
|
2727 |
+
$image_type = @ exif_imagetype( $file );
|
2728 |
+
if ( $image_type != IMAGETYPE_JPEG ) return false; // Not supported image type
|
2729 |
+
|
2730 |
+
// Get exif data
|
2731 |
+
if ( ! function_exists( 'exif_read_data' ) ) return false; // Not supported by the server
|
2732 |
+
$exif = @ exif_read_data( $file, 'EXIF' );
|
2733 |
+
if ( ! is_array( $exif ) ) return false; // No data present
|
2734 |
|
2735 |
+
// There is exif data for this image.
|
2736 |
+
// First delete any existing exif data for this image
|
2737 |
+
if ( ! $nodelete ) {
|
2738 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM `".WPPA_EXIF."` WHERE `photo` = %s", $id ) );
|
2739 |
+
}
|
2740 |
+
|
2741 |
+
// Find defined labels
|
2742 |
+
if ( ! is_array( $labels ) ) {
|
2743 |
+
$result = $wpdb->get_results( "SELECT * FROM `".WPPA_EXIF."` WHERE `photo` = '0' ORDER BY `tag`", ARRAY_A );
|
2744 |
+
|
2745 |
+
if ( ! is_array( $result ) ) $result = array();
|
2746 |
+
$labels = array();
|
2747 |
+
$names = array();
|
2748 |
+
foreach ( $result as $res ) {
|
2749 |
+
$labels[] = $res['tag'];
|
2750 |
+
$names[] = $res['description'];
|
2751 |
+
}
|
2752 |
+
}
|
2753 |
|
2754 |
+
// Process items
|
2755 |
+
foreach ( array_keys( $exif ) as $s ) {
|
2756 |
|
2757 |
+
// Check labels first
|
2758 |
+
$tag = '';
|
2759 |
+
if ( in_array( $s, $names ) ) {
|
2760 |
+
$i = 0;
|
2761 |
+
while ( $i < count( $labels ) ) {
|
2762 |
+
if ( $names[$i] == $s ) {
|
2763 |
+
$tag = $labels[$i];
|
2764 |
+
}
|
2765 |
+
$i++;
|
2766 |
+
}
|
2767 |
+
}
|
2768 |
|
2769 |
+
if ( $tag == '' ) $tag = wppa_exif_tag( $s );
|
2770 |
+
if ( $tag == 'E#EA1C' ) $tag = ''; // EA1C is explixitly undefined and will fail to register
|
2771 |
+
if ( $tag == '' ) continue;
|
2772 |
+
|
2773 |
+
if ( ! in_array( $tag, $labels ) ) {
|
2774 |
+
|
2775 |
+
// Add to labels
|
2776 |
+
$labels[] = $tag;
|
2777 |
+
$names[] = $s.':';
|
2778 |
+
|
2779 |
+
// Add to db
|
2780 |
+
$photo = '0';
|
2781 |
+
$desc = $s.':';
|
2782 |
+
$status = 'display';
|
2783 |
+
if ( substr( $s, 0, 12 ) == 'UndefinedTag' ) {
|
2784 |
+
$status = 'option';
|
2785 |
+
$desc = wppa_exif_tagname( hexdec( substr( $tag, 2, 4 ) ) );
|
2786 |
+
if ( substr( $desc, 0, 12 ) != 'UndefinedTag' ) {
|
2787 |
+
$status = 'display';
|
2788 |
}
|
2789 |
}
|
2790 |
+
$bret = wppa_create_exif_entry( array( 'photo' => $photo, 'tag' => $tag, 'description' => $desc, 'status' => $status ) );
|
2791 |
+
if ( ! $bret ) wppa_log( 'War', 'Could not add EXIF tag label '.$tag.' for photo '.$photo );
|
2792 |
+
}
|
2793 |
+
|
2794 |
+
// Now add poto specific data item
|
2795 |
+
// If its an array...
|
2796 |
+
if ( is_array( $exif[$s] ) ) { // continue;
|
2797 |
+
|
2798 |
+
$c = count ( $exif[$s] );
|
2799 |
+
$max = wppa_opt( 'exif_max_array_size' );
|
2800 |
+
if ( $max != '0' && $c > $max ) {
|
2801 |
+
wppa_dbg_msg( 'Exif tag '.$tag. ': array truncated form '.$c.' to '.$max.' elements for photo nr '.$id.'.', 'red' );
|
2802 |
+
$c = $max;
|
2803 |
+
}
|
2804 |
+
for ( $i=0; $i <$c; $i++ ) {
|
2805 |
+
$photo = $id;
|
2806 |
+
$desc = $exif[$s][$i];
|
2807 |
+
$status = 'default';
|
2808 |
+
$bret = wppa_create_exif_entry( array( 'photo' => $photo, 'tag' => $tag, 'description' => $desc, 'status' => $status ) );
|
2809 |
+
if ( ! $bret ) wppa_log( 'War', 'Could not add EXIF tag '.$tag.' for photo '.$photo );
|
2810 |
+
|
2811 |
+
}
|
2812 |
+
}
|
2813 |
+
// Its not an array
|
2814 |
+
else {
|
2815 |
+
|
2816 |
+
$photo = $id;
|
2817 |
+
$desc = $exif[$s];
|
2818 |
+
$status = 'default';
|
2819 |
+
$bret = wppa_create_exif_entry( array( 'photo' => $photo, 'tag' => $tag, 'description' => $desc, 'status' => $status ) );
|
2820 |
+
if ( ! $bret ) {} /* wppa_log( 'Warning 3', 'Could not add EXIF tag '.$tag.' for photo '.$photo.', desc = '.$desc ); */ // Is junk, dont care
|
2821 |
+
}
|
2822 |
+
}
|
2823 |
+
|
2824 |
+
wppa_fix_exif_format( $id );
|
2825 |
+
}
|
2826 |
+
|
2827 |
+
// Convert exif tagname as found by exif_read_data() to E#XXXX, Inverse of exif_tagname();
|
2828 |
+
function wppa_exif_tag( $tagname ) {
|
2829 |
+
static $wppa_inv_exiftags;
|
2830 |
+
|
2831 |
+
// Setup inverted matrix
|
2832 |
+
if ( ! is_array( $wppa_inv_exiftags ) ) {
|
2833 |
+
$key = 0;
|
2834 |
+
while ( $key < 65536 ) {
|
2835 |
+
$tag = exif_tagname( $key );
|
2836 |
+
if ( $tag != '' ) {
|
2837 |
+
$wppa_inv_exiftags[$tag] = $key;
|
2838 |
+
}
|
2839 |
+
$key++;
|
2840 |
+
if ( ! $key ) break; // 16 bit server wrap around ( do they still exist??? )
|
2841 |
+
}
|
2842 |
+
}
|
2843 |
+
|
2844 |
+
// Search
|
2845 |
+
if ( isset( $wppa_inv_exiftags[$tagname] ) ) return sprintf( 'E#%04X',$wppa_inv_exiftags[$tagname] );
|
2846 |
+
elseif ( strlen( $tagname ) == 19 ) {
|
2847 |
+
if ( substr( $tagname, 0, 12 ) == 'UndefinedTag' ) return 'E#'.substr( $tagname, -4 );
|
2848 |
+
}
|
2849 |
+
else return '';
|
2850 |
+
}
|
2851 |
+
|
2852 |
+
// Wrapper around exif_tagname(), convert 0xXXXX to TagName
|
2853 |
+
function wppa_exif_tagname( $tag, $brand = '', $brandonly = false ) {
|
2854 |
+
global $wpdb;
|
2855 |
+
static $canontags;
|
2856 |
+
static $nikontags;
|
2857 |
+
static $samsungtags;
|
2858 |
+
static $editabletags;
|
2859 |
+
static $commontags;
|
2860 |
+
|
2861 |
+
// Fill $canontags if not done yet
|
2862 |
+
if ( empty( $canontags ) ) {
|
2863 |
+
$canontags = array(
|
2864 |
+
0x0001 => 'CanonCameraSettings',
|
2865 |
+
0x0002 => 'CanonFocalLength',
|
2866 |
+
0x0003 => 'CanonFlashInfo?',
|
2867 |
+
0x0004 => 'CanonShotInfo',
|
2868 |
+
0x0005 => 'CanonPanorama',
|
2869 |
+
0x0006 => 'CanonImageType',
|
2870 |
+
0x0007 => 'CanonFirmwareVersion',
|
2871 |
+
0x0008 => 'FileNumber',
|
2872 |
+
0x0009 => 'OwnerName',
|
2873 |
+
0x000a => 'UnknownD30',
|
2874 |
+
0x000c => 'SerialNumber',
|
2875 |
+
0x000d => 'CanonCameraInfo',
|
2876 |
+
0x000e => 'CanonFileLength',
|
2877 |
+
0x000f => 'CustomFunctions',
|
2878 |
+
0x0010 => 'CanonModelID',
|
2879 |
+
0x0011 => 'MovieInfo',
|
2880 |
+
0x0012 => 'CanonAFInfo',
|
2881 |
+
0x0013 => 'ThumbnailImageValidArea',
|
2882 |
+
0x0015 => 'SerialNumberFormat',
|
2883 |
+
0x001a => 'SuperMacro',
|
2884 |
+
0x001c => 'DateStampMode',
|
2885 |
+
0x001d => 'MyColors',
|
2886 |
+
0x001e => 'FirmwareRevision',
|
2887 |
+
0x0023 => 'Categories',
|
2888 |
+
0x0024 => 'FaceDetect1',
|
2889 |
+
0x0025 => 'FaceDetect2',
|
2890 |
+
0x0026 => 'CanonAFInfo2',
|
2891 |
+
0x0027 => 'ContrastInfo',
|
2892 |
+
0x0028 => 'ImageUniqueID',
|
2893 |
+
0x002f => 'FaceDetect3',
|
2894 |
+
0x0035 => 'TimeInfo',
|
2895 |
+
0x003c => 'AFInfo3',
|
2896 |
+
0x0081 => 'RawDataOffset',
|
2897 |
+
0x0083 => 'OriginalDecisionDataOffset',
|
2898 |
+
0x0090 => 'CustomFunctions1D',
|
2899 |
+
0x0091 => 'PersonalFunctions',
|
2900 |
+
0x0092 => 'PersonalFunctionValues',
|
2901 |
+
0x0093 => 'CanonFileInfo',
|
2902 |
+
0x0094 => 'AFPointsInFocus1D',
|
2903 |
+
0x0095 => 'LensModel',
|
2904 |
+
0x0096 => 'SerialInfo',
|
2905 |
+
0x0097 => 'DustRemovalData',
|
2906 |
+
0x0098 => 'CropInfo',
|
2907 |
+
0x0099 => 'CustomFunctions2',
|
2908 |
+
0x009a => 'AspectInfo',
|
2909 |
+
0x00a0 => 'ProcessingInfo',
|
2910 |
+
0x00a1 => 'ToneCurveTable',
|
2911 |
+
0x00a2 => 'SharpnessTable',
|
2912 |
+
0x00a3 => 'SharpnessFreqTable',
|
2913 |
+
0x00a4 => 'WhiteBalanceTable',
|
2914 |
+
0x00a9 => 'ColorBalance',
|
2915 |
+
0x00aa => 'MeasuredColor',
|
2916 |
+
0x00ae => 'ColorTemperature',
|
2917 |
+
0x00b0 => 'CanonFlags',
|
2918 |
+
0x00b1 => 'ModifiedInfo',
|
2919 |
+
0x00b2 => 'ToneCurveMatching',
|
2920 |
+
0x00b3 => 'WhiteBalanceMatching',
|
2921 |
+
0x00b4 => 'ColorSpace',
|
2922 |
+
0x00b6 => 'PreviewImageInfo',
|
2923 |
+
0x00d0 => 'VRDOffset',
|
2924 |
+
0x00e0 => 'SensorInfo',
|
2925 |
+
0x4001 => 'ColorData',
|
2926 |
+
0x4002 => 'CRWParam?',
|
2927 |
+
0x4003 => 'ColorInfo',
|
2928 |
+
0x4005 => 'Flavor?',
|
2929 |
+
0x4008 => 'PictureStyleUserDef',
|
2930 |
+
0x4009 => 'PictureStylePC',
|
2931 |
+
0x4010 => 'CustomPictureStyleFileName',
|
2932 |
+
0x4013 => 'AFMicroAdj',
|
2933 |
+
0x4015 => 'VignettingCorr',
|
2934 |
+
0x4016 => 'VignettingCorr2',
|
2935 |
+
0x4018 => 'LightingOpt',
|
2936 |
+
0x4019 => 'LensInfo',
|
2937 |
+
0x4020 => 'AmbienceInfo',
|
2938 |
+
0x4021 => 'MultiExp',
|
2939 |
+
0x4024 => 'FilterInfo',
|
2940 |
+
0x4025 => 'HDRInfo',
|
2941 |
+
0x4028 => 'AFConfig',
|
2942 |
+
);
|
2943 |
+
}
|
2944 |
+
|
2945 |
+
// Fill $nikontags if not done yet
|
2946 |
+
if ( empty( $nikontags ) ) {
|
2947 |
+
$nikontags = array(
|
2948 |
+
0x0001 => 'MakerNoteVersion',
|
2949 |
+
0x0002 => 'ISO',
|
2950 |
+
0x0003 => 'ColorMode',
|
2951 |
+
0x0004 => 'Quality',
|
2952 |
+
0x0005 => 'WhiteBalance',
|
2953 |
+
0x0006 => 'Sharpness',
|
2954 |
+
0x0007 => 'FocusMode',
|
2955 |
+
0x0008 => 'FlashSetting',
|
2956 |
+
0x0009 => 'FlashType',
|
2957 |
+
0x000b => 'WhiteBalanceFineTune',
|
2958 |
+
0x000c => 'WB_RBLevels',
|
2959 |
+
0x000d => 'ProgramShift',
|
2960 |
+
0x000e => 'ExposureDifference',
|
2961 |
+
0x000f => 'ISOSelection',
|
2962 |
+
0x0010 => 'DataDump',
|
2963 |
+
0x0011 => 'PreviewIFD',
|
2964 |
+
0x0012 => 'FlashExposureComp',
|
2965 |
+
0x0013 => 'ISOSetting',
|
2966 |
+
0x0014 => 'ColorBalanceA',
|
2967 |
+
0x0016 => 'ImageBoundary',
|
2968 |
+
0x0017 => 'ExternalFlashExposureComp',
|
2969 |
+
0x0018 => 'FlashExposureBracketValue',
|
2970 |
+
0x0019 => 'ExposureBracketValue',
|
2971 |
+
0x001a => 'ImageProcessing',
|
2972 |
+
0x001b => 'CropHiSpeed',
|
2973 |
+
0x001c => 'ExposureTuning',
|
2974 |
+
0x001d => 'SerialNumber',
|
2975 |
+
0x001e => 'ColorSpace',
|
2976 |
+
0x001f => 'VRInfo',
|
2977 |
+
0x0020 => 'ImageAuthentication',
|
2978 |
+
0x0021 => 'FaceDetect',
|
2979 |
+
0x0022 => 'ActiveD-Lighting',
|
2980 |
+
0x0023 => 'PictureControlData',
|
2981 |
+
0x0024 => 'WorldTime',
|
2982 |
+
0x0025 => 'ISOInfo',
|
2983 |
+
0x002a => 'VignetteControl',
|
2984 |
+
0x002b => 'DistortInfo',
|
2985 |
+
0x002c => 'UnknownInfo',
|
2986 |
+
0x0032 => 'UnknownInfo2',
|
2987 |
+
0x0035 => 'HDRInfo',
|
2988 |
+
0x0039 => 'LocationInfo',
|
2989 |
+
0x003d => 'BlackLevel',
|
2990 |
+
0x004f => 'ColorTemperatureAuto',
|
2991 |
+
0x0080 => 'ImageAdjustment',
|
2992 |
+
0x0081 => 'ToneComp',
|
2993 |
+
0x0082 => 'AuxiliaryLens',
|
2994 |
+
0x0083 => 'LensType',
|
2995 |
+
0x0084 => 'Lens',
|
2996 |
+
0x0085 => 'ManualFocusDistance',
|
2997 |
+
0x0086 => 'DigitalZoom',
|
2998 |
+
0x0087 => 'FlashMode',
|
2999 |
+
0x0088 => 'AFInfo',
|
3000 |
+
0x0089 => 'ShootingMode',
|
3001 |
+
0x008b => 'LensFStops',
|
3002 |
+
0x008c => 'ContrastCurve',
|
3003 |
+
0x008d => 'ColorHue',
|
3004 |
+
0x008f => 'SceneMode',
|
3005 |
+
0x0090 => 'LightSource',
|
3006 |
+
0x0091 => 'ShotInfo',
|
3007 |
+
0x0092 => 'HueAdjustment',
|
3008 |
+
0x0093 => 'NEFCompression',
|
3009 |
+
0x0094 => 'Saturation',
|
3010 |
+
0x0095 => 'NoiseReduction',
|
3011 |
+
0x0096 => 'NEFLinearizationTable',
|
3012 |
+
0x0097 => 'ColorBalance',
|
3013 |
+
0x0099 => 'RawImageCenter',
|
3014 |
+
0x009a => 'SensorPixelSize',
|
3015 |
+
0x009c => 'SceneAssist',
|
3016 |
+
0x009e => 'RetouchHistory',
|
3017 |
+
0x00a0 => 'SerialNumber',
|
3018 |
+
0x00a2 => 'ImageDataSize',
|
3019 |
+
0x00a5 => 'ImageCount',
|
3020 |
+
0x00a6 => 'DeletedImageCount',
|
3021 |
+
0x00a7 => 'ShutterCount',
|
3022 |
+
0x00a8 => 'FlashInfo',
|
3023 |
+
0x00a9 => 'ImageOptimization',
|
3024 |
+
0x00aa => 'Saturation',
|
3025 |
+
0x00ab => 'VariProgram',
|
3026 |
+
0x00ac => 'ImageStabilization',
|
3027 |
+
0x00ad => 'AFResponse',
|
3028 |
+
0x00b0 => 'MultiExposure',
|
3029 |
+
0x00b1 => 'HighISONoiseReduction',
|
3030 |
+
0x00b3 => 'ToningEffect',
|
3031 |
+
0x00b6 => 'PowerUpTime',
|
3032 |
+
0x00b7 => 'AFInfo2',
|
3033 |
+
0x00b8 => 'FileInfo',
|
3034 |
+
0x00b9 => 'AFTune',
|
3035 |
+
0x00bb => 'RetouchInfo',
|
3036 |
+
0x00bd => 'PictureControlData',
|
3037 |
+
0x00c3 => 'BarometerInfo',
|
3038 |
+
0x0e00 => 'PrintIM',
|
3039 |
+
0x0e01 => 'NikonCaptureData',
|
3040 |
+
0x0e09 => 'NikonCaptureVersion',
|
3041 |
+
0x0e0e => 'NikonCaptureOffsets',
|
3042 |
+
0x0e10 => 'NikonScanIFD',
|
3043 |
+
0x0e13 => 'NikonCaptureEditVersions',
|
3044 |
+
0x0e1d => 'NikonICCProfile',
|
3045 |
+
0x0e1e => 'NikonCaptureOutput',
|
3046 |
+
0x0e22 => 'NEFBitDepth',
|
3047 |
+
|
3048 |
+
);
|
3049 |
+
}
|
3050 |
+
|
3051 |
+
// Fill $samsungtags
|
3052 |
+
if ( empty( $samsungtags ) ) {
|
3053 |
+
$samsungtags = array(
|
3054 |
+
0x0001 => 'MakerNoteVersion',
|
3055 |
+
0x0002 => 'DeviceType',
|
3056 |
+
0x0003 => 'SamsungModelID',
|
3057 |
+
0x0011 => 'OrientationInfo',
|
3058 |
+
0x0020 => 'SmartAlbumColor',
|
3059 |
+
0x0021 => 'PictureWizard',
|
3060 |
+
0x0030 => 'LocalLocationName',
|
3061 |
+
0x0031 => 'LocationName',
|
3062 |
+
0x0035 => 'PreviewIFD',
|
3063 |
+
0x0040 => 'RawDataByteOrder',
|
3064 |
+
0x0041 => 'WhiteBalanceSetup',
|
3065 |
+
0x0043 => 'CameraTemperature',
|
3066 |
+
0x0050 => 'RawDataCFAPattern',
|
3067 |
+
0x0100 => 'FaceDetect',
|
3068 |
+
0x0120 => 'FaceRecognition',
|
3069 |
+
0x0123 => 'FaceName',
|
3070 |
+
0xa001 => 'FirmwareName',
|
3071 |
+
0xa003 => 'LensType',
|
3072 |
+
0xa004 => 'LensFirmware',
|
3073 |
+
0xa005 => 'InternalLensSerialNumber',
|
3074 |
+
0xa010 => 'SensorAreas',
|
3075 |
+
0xa011 => 'ColorSpace',
|
3076 |
+
0xa012 => 'SmartRange',
|
3077 |
+
0xa013 => 'ExposureCompensation',
|
3078 |
+
0xa014 => 'ISO',
|
3079 |
+
0xa018 => 'ExposureTime',
|
3080 |
+
0xa019 => 'FNumber',
|
3081 |
+
0xa01a => 'FocalLengthIn35mmFormat',
|
3082 |
+
0xa020 => 'EncryptionKey',
|
3083 |
+
0xa021 => 'WB_RGGBLevelsUncorrected',
|
3084 |
+
0xa022 => 'WB_RGGBLevelsAuto',
|
3085 |
+
0xa023 => 'WB_RGGBLevelsIlluminator1',
|
3086 |
+
0xa024 => 'WB_RGGBLevelsIlluminator2',
|
3087 |
+
0xa025 => 'HighlightLinearityLimit',
|
3088 |
+
0xa028 => 'WB_RGGBLevelsBlack',
|
3089 |
+
0xa030 => 'ColorMatrix',
|
3090 |
+
0xa031 => 'ColorMatrixSRGB',
|
3091 |
+
0xa032 => 'ColorMatrixAdobeRGB',
|
3092 |
+
0xa033 => 'CbCrMatrixDefault',
|
3093 |
+
0xa034 => 'CbCrMatrix',
|
3094 |
+
0xa035 => 'CbCrGainDefault',
|
3095 |
+
0xa036 => 'CbCrGain',
|
3096 |
+
0xa040 => 'ToneCurveSRGBDefault',
|
3097 |
+
0xa041 => 'ToneCurveAdobeRGBDefault',
|
3098 |
+
0xa042 => 'ToneCurveSRGB',
|
3099 |
+
0xa043 => 'ToneCurveAdobeRGB',
|
3100 |
+
0xa048 => 'RawData?',
|
3101 |
+
0xa050 => 'Distortion?',
|
3102 |
+
0xa051 => 'ChromaticAberration?',
|
3103 |
+
0xa052 => 'Vignetting?',
|
3104 |
+
0xa053 => 'VignettingCorrection?',
|
3105 |
+
0xa054 => 'VignettingSetting?',
|
3106 |
+
|
3107 |
+
);
|
3108 |
+
}
|
3109 |
+
|
3110 |
+
// Fill $editabletags
|
3111 |
+
if ( empty( $editabletags ) ) {
|
3112 |
+
$temp = $wpdb->get_results( "SELECT * FROM `" . WPPA_EXIF . "` WHERE `photo` = '0'", ARRAY_A );
|
3113 |
+
$editabletags = array();
|
3114 |
+
if ( is_array( $temp ) ) foreach ( $temp as $item ) {
|
3115 |
+
$editabletags[ hexdec( substr( $item['tag'], 2, 4 ) ) ] = trim( $item['description'], ': ' );
|
3116 |
+
}
|
3117 |
+
}
|
3118 |
+
|
3119 |
+
if ( empty( $commontags ) ) {
|
3120 |
+
$commontags = array(
|
3121 |
+
0x0001 => 'InteropIndex',
|
3122 |
+
0x0002 => 'InteropVersion',
|
3123 |
+
0x000b => 'ProcessingSoftware',
|
3124 |
+
0x00fe => 'SubfileType',
|
3125 |
+
0x00ff => 'OldSubfileType',
|
3126 |
+
0x0100 => 'ImageWidth',
|
3127 |
+
0x0101 => 'ImageHeight',
|
3128 |
+
0x0102 => 'BitsPerSample',
|
3129 |
+
0x0103 => 'Compression',
|
3130 |
+
0x0106 => 'PhotometricInterpretation',
|
3131 |
+
0x0107 => 'Thresholding',
|
3132 |
+
0x0108 => 'CellWidth',
|
3133 |
+
0x0109 => 'CellLength',
|
3134 |
+
0x010a => 'FillOrder',
|
3135 |
+
0x010d => 'DocumentName',
|
3136 |
+
0x010e => 'ImageDescription',
|
3137 |
+
0x010f => 'Make',
|
3138 |
+
0x0110 => 'Model',
|
3139 |
+
0x0111 => 'StripOffsets',
|
3140 |
+
0x0112 => 'Orientation',
|
3141 |
+
0x0115 => 'SamplesPerPixel',
|
3142 |
+
0x0116 => 'RowsPerStrip',
|
3143 |
+
0x0117 => 'StripByteCounts',
|
3144 |
+
0x0118 => 'MinSampleValue',
|
3145 |
+
0x0119 => 'MaxSampleValue',
|
3146 |
+
0x011a => 'XResolution',
|
3147 |
+
0x011b => 'YResolution',
|
3148 |
+
0x011c => 'PlanarConfiguration',
|
3149 |
+
0x011d => 'PageName',
|
3150 |
+
0x011e => 'XPosition',
|
3151 |
+
0x011f => 'YPosition',
|
3152 |
+
0x0120 => 'FreeOffsets',
|
3153 |
+
0x0121 => 'FreeByteCounts',
|
3154 |
+
0x0122 => 'GrayResponseUnit',
|
3155 |
+
0x0123 => 'GrayResponseCurve',
|
3156 |
+
0x0124 => 'T4Options',
|
3157 |
+
0x0125 => 'T6Options',
|
3158 |
+
0x0128 => 'ResolutionUnit',
|
3159 |
+
0x0129 => 'PageNumber',
|
3160 |
+
0x012c => 'ColorResponseUnit',
|
3161 |
+
0x012d => 'TransferFunction',
|
3162 |
+
0x0131 => 'Software',
|
3163 |
+
0x0132 => 'ModifyDate',
|
3164 |
+
0x013b => 'Artist',
|
3165 |
+
0x013c => 'HostComputer',
|
3166 |
+
0x013d => 'Predictor',
|
3167 |
+
0x013e => 'WhitePoint',
|
3168 |
+
0x013f => 'PrimaryChromaticities',
|
3169 |
+
0x0140 => 'ColorMap',
|
3170 |
+
0x0141 => 'HalftoneHints',
|
3171 |
+
0x0142 => 'TileWidth',
|
3172 |
+
0x0143 => 'TileLength',
|
3173 |
+
0x0144 => 'TileOffsets',
|
3174 |
+
0x0145 => 'TileByteCounts',
|
3175 |
+
0x0146 => 'BadFaxLines',
|
3176 |
+
0x0147 => 'CleanFaxData',
|
3177 |
+
0x0148 => 'ConsecutiveBadFaxLines',
|
3178 |
+
0x014a => 'SubIFD',
|
3179 |
+
0x014c => 'InkSet',
|
3180 |
+
0x014d => 'InkNames',
|
3181 |
+
0x014e => 'NumberofInks',
|
3182 |
+
0x0150 => 'DotRange',
|
3183 |
+
0x0151 => 'TargetPrinter',
|
3184 |
+
0x0152 => 'ExtraSamples',
|
3185 |
+
0x0153 => 'SampleFormat',
|
3186 |
+
0x0154 => 'SMinSampleValue',
|
3187 |
+
0x0155 => 'SMaxSampleValue',
|
3188 |
+
0x0156 => 'TransferRange',
|
3189 |
+
0x0157 => 'ClipPath',
|
3190 |
+
0x0158 => 'XClipPathUnits',
|
3191 |
+
0x0159 => 'YClipPathUnits',
|
3192 |
+
0x015a => 'Indexed',
|
3193 |
+
0x015b => 'JPEGTables',
|
3194 |
+
0x015f => 'OPIProxy',
|
3195 |
+
0x0190 => 'GlobalParametersIFD',
|
3196 |
+
0x0191 => 'ProfileType',
|
3197 |
+
0x0192 => 'FaxProfile',
|
3198 |
+
0x0193 => 'CodingMethods',
|
3199 |
+
0x0194 => 'VersionYear',
|
3200 |
+
0x0195 => 'ModeNumber',
|
3201 |
+
0x01b1 => 'Decode',
|
3202 |
+
0x01b2 => 'DefaultImageColor',
|
3203 |
+
0x01b3 => 'T82Options',
|
3204 |
+
0x01b5 => 'JPEGTables',
|
3205 |
+
0x0200 => 'JPEGProc',
|
3206 |
+
0x0201 => 'ThumbnailOffset',
|
3207 |
+
0x0202 => 'ThumbnailLength',
|
3208 |
+
0x0203 => 'JPEGRestartInterval',
|
3209 |
+
0x0205 => 'JPEGLosslessPredictors',
|
3210 |
+
0x0206 => 'JPEGPointTransforms',
|
3211 |
+
0x0207 => 'JPEGQTables',
|
3212 |
+
0x0208 => 'JPEGDCTables',
|
3213 |
+
0x0209 => 'JPEGACTables',
|
3214 |
+
0x0211 => 'YCbCrCoefficients',
|
3215 |
+
0x0212 => 'YCbCrSubSampling',
|
3216 |
+
0x0213 => 'YCbCrPositioning',
|
3217 |
+
0x0214 => 'ReferenceBlackWhite',
|
3218 |
+
0x022f => 'StripRowCounts',
|
3219 |
+
0x02bc => 'ApplicationNotes',
|
3220 |
+
0x03e7 => 'USPTOMiscellaneous',
|
3221 |
+
0x1000 => 'RelatedImageFileFormat',
|
3222 |
+
0x1001 => 'RelatedImageWidth',
|
3223 |
+
0x1002 => 'RelatedImageHeight',
|
3224 |
+
0x4746 => 'Rating',
|
3225 |
+
0x4747 => 'XP_DIP_XML',
|
3226 |
+
0x4748 => 'StitchInfo',
|
3227 |
+
0x4749 => 'RatingPercent',
|
3228 |
+
0x7000 => 'SonyRawFileType',
|
3229 |
+
0x7032 => 'VignettingCorrParams',
|
3230 |
+
0x7035 => 'ChromaticAberrationCorrParams',
|
3231 |
+
0x7037 => 'DistortionCorrParams',
|
3232 |
+
0x800d => 'ImageID',
|
3233 |
+
0x80a3 => 'WangTag1',
|
3234 |
+
0x80a4 => 'WangAnnotation',
|
3235 |
+
0x80a5 => 'WangTag3',
|
3236 |
+
0x80a6 => 'WangTag4',
|
3237 |
+
0x80b9 => 'ImageReferencePoints',
|
3238 |
+
0x80ba => 'RegionXformTackPoint',
|
3239 |
+
0x80bb => 'WarpQuadrilateral',
|
3240 |
+
0x80bc => 'AffineTransformMat',
|
3241 |
+
0x80e3 => 'Matteing',
|
3242 |
+
0x80e4 => 'DataType',
|
3243 |
+
0x80e5 => 'ImageDepth',
|
3244 |
+
0x80e6 => 'TileDepth',
|
3245 |
+
0x8214 => 'ImageFullWidth',
|
3246 |
+
0x8215 => 'ImageFullHeight',
|
3247 |
+
0x8216 => 'TextureFormat',
|
3248 |
+
0x8217 => 'WrapModes',
|
3249 |
+
0x8218 => 'FovCot',
|
3250 |
+
0x8219 => 'MatrixWorldToScreen',
|
3251 |
+
0x821a => 'MatrixWorldToCamera',
|
3252 |
+
0x827d => 'Model2',
|
3253 |
+
0x828d => 'CFARepeatPatternDim',
|
3254 |
+
0x828e => 'CFAPattern2',
|
3255 |
+
0x828f => 'BatteryLevel',
|
3256 |
+
0x8290 => 'KodakIFD',
|
3257 |
+
0x8298 => 'Copyright',
|
3258 |
+
0x829a => 'ExposureTime',
|
3259 |
+
0x829d => 'FNumber',
|
3260 |
+
0x82a5 => 'MDFileTag',
|
3261 |
+
0x82a6 => 'MDScalePixel',
|
3262 |
+
0x82a7 => 'MDColorTable',
|
3263 |
+
0x82a8 => 'MDLabName',
|
3264 |
+
0x82a9 => 'MDSampleInfo',
|
3265 |
+
0x82aa => 'MDPrepDate',
|
3266 |
+
0x82ab => 'MDPrepTime',
|
3267 |
+
0x82ac => 'MDFileUnits',
|
3268 |
+
0x830e => 'PixelScale',
|
3269 |
+
0x8335 => 'AdventScale',
|
3270 |
+
0x8336 => 'AdventRevision',
|
3271 |
+
0x835c => 'UIC1Tag',
|
3272 |
+
0x835d => 'UIC2Tag',
|
3273 |
+
0x835e => 'UIC3Tag',
|
3274 |
+
0x835f => 'UIC4Tag',
|
3275 |
+
0x83bb => 'IPTC-NAA',
|
3276 |
+
0x847e => 'IntergraphPacketData',
|
3277 |
+
0x847f => 'IntergraphFlagRegisters',
|
3278 |
+
0x8480 => 'IntergraphMatrix',
|
3279 |
+
0x8481 => 'INGRReserved',
|
3280 |
+
0x8482 => 'ModelTiePoint',
|
3281 |
+
0x84e0 => 'Site',
|
3282 |
+
0x84e1 => 'ColorSequence',
|
3283 |
+
0x84e2 => 'IT8Header',
|
3284 |
+
0x84e3 => 'RasterPadding',
|
3285 |
+
0x84e4 => 'BitsPerRunLength',
|
3286 |
+
0x84e5 => 'BitsPerExtendedRunLength',
|
3287 |
+
0x84e6 => 'ColorTable',
|
3288 |
+
0x84e7 => 'ImageColorIndicator',
|
3289 |
+
0x84e8 => 'BackgroundColorIndicator',
|
3290 |
+
0x84e9 => 'ImageColorValue',
|
3291 |
+
0x84ea => 'BackgroundColorValue',
|
3292 |
+
0x84eb => 'PixelIntensityRange',
|
3293 |
+
0x84ec => 'TransparencyIndicator',
|
3294 |
+
0x84ed => 'ColorCharacterization',
|
3295 |
+
0x84ee => 'HCUsage',
|
3296 |
+
0x84ef => 'TrapIndicator',
|
3297 |
+
0x84f0 => 'CMYKEquivalent',
|
3298 |
+
0x8546 => 'SEMInfo',
|
3299 |
+
0x8568 => 'AFCP_IPTC',
|
3300 |
+
0x85b8 => 'PixelMagicJBIGOptions',
|
3301 |
+
0x85d7 => 'JPLCartoIFD',
|
3302 |
+
0x85d8 => 'ModelTransform',
|
3303 |
+
0x8602 => 'WB_GRGBLevels',
|
3304 |
+
0x8606 => 'LeafData',
|
3305 |
+
0x8649 => 'PhotoshopSettings',
|
3306 |
+
0x8769 => 'ExifOffset',
|
3307 |
+
0x8773 => 'ICC_Profile',
|
3308 |
+
0x877f => 'TIFF_FXExtensions',
|
3309 |
+
0x8780 => 'MultiProfiles',
|
3310 |
+
0x8781 => 'SharedData',
|
3311 |
+
0x8782 => 'T88Options',
|
3312 |
+
0x87ac => 'ImageLayer',
|
3313 |
+
0x87af => 'GeoTiffDirectory',
|
3314 |
+
0x87b0 => 'GeoTiffDoubleParams',
|
3315 |
+
0x87b1 => 'GeoTiffAsciiParams',
|
3316 |
+
0x87be => 'JBIGOptions',
|
3317 |
+
0x8822 => 'ExposureProgram',
|
3318 |
+
0x8824 => 'SpectralSensitivity',
|
3319 |
+
0x8825 => 'GPSInfo',
|
3320 |
+
0x8827 => 'ISO',
|
3321 |
+
0x8828 => 'Opto-ElectricConvFactor',
|
3322 |
+
0x8829 => 'Interlace',
|
3323 |
+
0x882a => 'TimeZoneOffset',
|
3324 |
+
0x882b => 'SelfTimerMode',
|
3325 |
+
0x8830 => 'SensitivityType',
|
3326 |
+
0x8831 => 'StandardOutputSensitivity',
|
3327 |
+
0x8832 => 'RecommendedExposureIndex',
|
3328 |
+
0x8833 => 'ISOSpeed',
|
3329 |
+
0x8834 => 'ISOSpeedLatitudeyyy',
|
3330 |
+
0x8835 => 'ISOSpeedLatitudezzz',
|
3331 |
+
0x885c => 'FaxRecvParams',
|
3332 |
+
0x885d => 'FaxSubAddress',
|
3333 |
+
0x885e => 'FaxRecvTime',
|
3334 |
+
0x8871 => 'FedexEDR',
|
3335 |
+
0x888a => 'LeafSubIFD',
|
3336 |
+
0x9000 => 'ExifVersion',
|
3337 |
+
0x9003 => 'DateTimeOriginal',
|
3338 |
+
0x9004 => 'CreateDate',
|
3339 |
+
0x9009 => 'GooglePlusUploadCode',
|
3340 |
+
0x9010 => 'OffsetTime',
|
3341 |
+
0x9011 => 'OffsetTimeOriginal',
|
3342 |
+
0x9012 => 'OffsetTimeDigitized',
|
3343 |
+
0x9101 => 'ComponentsConfiguration',
|
3344 |
+
0x9102 => 'CompressedBitsPerPixel',
|
3345 |
+
0x9201 => 'ShutterSpeedValue',
|
3346 |
+
0x9202 => 'ApertureValue',
|
3347 |
+
0x9203 => 'BrightnessValue',
|
3348 |
+
0x9204 => 'ExposureCompensation',
|
3349 |
+
0x9205 => 'MaxApertureValue',
|
3350 |
+
0x9206 => 'SubjectDistance',
|
3351 |
+
0x9207 => 'MeteringMode',
|
3352 |
+
0x9208 => 'LightSource',
|
3353 |
+
0x9209 => 'Flash',
|
3354 |
+
0x920a => 'FocalLength',
|
3355 |
+
0x920b => 'FlashEnergy',
|
3356 |
+
0x920c => 'SpatialFrequencyResponse',
|
3357 |
+
0x920d => 'Noise',
|
3358 |
+
0x920e => 'FocalPlaneXResolution',
|
3359 |
+
0x920f => 'FocalPlaneYResolution',
|
3360 |
+
0x9210 => 'FocalPlaneResolutionUnit',
|
3361 |
+
0x9211 => 'ImageNumber',
|
3362 |
+
0x9212 => 'SecurityClassification',
|
3363 |
+
0x9213 => 'ImageHistory',
|
3364 |
+
0x9214 => 'SubjectArea',
|
3365 |
+
0x9215 => 'ExposureIndex',
|
3366 |
+
0x9216 => 'TIFF-EPStandardID',
|
3367 |
+
0x9217 => 'SensingMethod',
|
3368 |
+
0x923a => 'CIP3DataFile',
|
3369 |
+
0x923b => 'CIP3Sheet',
|
3370 |
+
0x923c => 'CIP3Side',
|
3371 |
+
0x923f => 'StoNits',
|
3372 |
+
0x927c => 'MakerNote',
|
3373 |
+
0x9286 => 'UserComment',
|
3374 |
+
0x9290 => 'SubSecTime',
|
3375 |
+
0x9291 => 'SubSecTimeOriginal',
|
3376 |
+
0x9292 => 'SubSecTimeDigitized',
|
3377 |
+
0x932f => 'MSDocumentText',
|
3378 |
+
0x9330 => 'MSPropertySetStorage',
|
3379 |
+
0x9331 => 'MSDocumentTextPosition',
|
3380 |
+
0x935c => 'ImageSourceData',
|
3381 |
+
0x9400 => 'AmbientTemperature',
|
3382 |
+
0x9401 => 'Humidity',
|
3383 |
+
0x9402 => 'Pressure',
|
3384 |
+
0x9403 => 'WaterDepth',
|
3385 |
+
0x9404 => 'Acceleration',
|
3386 |
+
0x9405 => 'CameraElevationAngle',
|
3387 |
+
0x9c9b => 'XPTitle',
|
3388 |
+
0x9c9c => 'XPComment',
|
3389 |
+
0x9c9d => 'XPAuthor',
|
3390 |
+
0x9c9e => 'XPKeywords',
|
3391 |
+
0x9c9f => 'XPSubject',
|
3392 |
+
0xa000 => 'FlashpixVersion',
|
3393 |
+
0xa001 => 'ColorSpace',
|
3394 |
+
0xa002 => 'ExifImageWidth',
|
3395 |
+
0xa003 => 'ExifImageHeight',
|
3396 |
+
0xa004 => 'RelatedSoundFile',
|
3397 |
+
0xa005 => 'InteropOffset',
|
3398 |
+
0xa010 => 'SamsungRawPointersOffset',
|
3399 |
+
0xa011 => 'SamsungRawPointersLength',
|
3400 |
+
0xa101 => 'SamsungRawByteOrder',
|
3401 |
+
0xa102 => 'SamsungRawUnknown?',
|
3402 |
+
0xa20b => 'FlashEnergy',
|
3403 |
+
0xa20c => 'SpatialFrequencyResponse',
|
3404 |
+
0xa20d => 'Noise',
|
3405 |
+
0xa20e => 'FocalPlaneXResolution',
|
3406 |
+
0xa20f => 'FocalPlaneYResolution',
|
3407 |
+
0xa210 => 'FocalPlaneResolutionUnit',
|
3408 |
+
0xa211 => 'ImageNumber',
|
3409 |
+
0xa212 => 'SecurityClassification',
|
3410 |
+
0xa213 => 'ImageHistory',
|
3411 |
+
0xa214 => 'SubjectLocation',
|
3412 |
+
0xa215 => 'ExposureIndex',
|
3413 |
+
0xa216 => 'TIFF-EPStandardID',
|
3414 |
+
0xa217 => 'SensingMethod',
|
3415 |
+
0xa300 => 'FileSource',
|
3416 |
+
0xa301 => 'SceneType',
|
3417 |
+
0xa302 => 'CFAPattern',
|
3418 |
+
0xa401 => 'CustomRendered',
|
3419 |
+
0xa402 => 'ExposureMode',
|
3420 |
+
0xa403 => 'WhiteBalance',
|
3421 |
+
0xa404 => 'DigitalZoomRatio',
|
3422 |
+
0xa405 => 'FocalLengthIn35mmFormat',
|
3423 |
+
0xa406 => 'SceneCaptureType',
|
3424 |
+
0xa407 => 'GainControl',
|
3425 |
+
0xa408 => 'Contrast',
|
3426 |
+
0xa409 => 'Saturation',
|
3427 |
+
0xa40a => 'Sharpness',
|
3428 |
+
0xa40b => 'DeviceSettingDescription',
|
3429 |
+
0xa40c => 'SubjectDistanceRange',
|
3430 |
+
0xa420 => 'ImageUniqueID',
|
3431 |
+
0xa430 => 'OwnerName',
|
3432 |
+
0xa431 => 'SerialNumber',
|
3433 |
+
0xa432 => 'LensInfo',
|
3434 |
+
0xa433 => 'LensMake',
|
3435 |
+
0xa434 => 'LensModel',
|
3436 |
+
0xa435 => 'LensSerialNumber',
|
3437 |
+
0xa480 => 'GDALMetadata',
|
3438 |
+
0xa481 => 'GDALNoData',
|
3439 |
+
0xa500 => 'Gamma',
|
3440 |
+
0xafc0 => 'ExpandSoftware',
|
3441 |
+
0xafc1 => 'ExpandLens',
|
3442 |
+
0xafc2 => 'ExpandFilm',
|
3443 |
+
0xafc3 => 'ExpandFilterLens',
|
3444 |
+
0xafc4 => 'ExpandScanner',
|
3445 |
+
0xafc5 => 'ExpandFlashLamp',
|
3446 |
+
0xbc01 => 'PixelFormat',
|
3447 |
+
0xbc03 => 'Uncompressed',
|
3448 |
+
0xbc04 => 'ImageType',
|
3449 |
+
0xbc80 => 'ImageWidth',
|
3450 |
+
0xbc81 => 'ImageHeight',
|
3451 |
+
0xbc82 => 'WidthResolution',
|
3452 |
+
0xbc83 => 'HeightResolution',
|
3453 |
+
0xbcc0 => 'ImageOffset',
|
3454 |
+
0xbcc1 => 'ImageByteCount',
|
3455 |
+
0xbcc2 => 'AlphaOffset',
|
3456 |
+
0xbcc3 => 'AlphaByteCount',
|
3457 |
+
0xbcc4 => 'ImageDataDiscard',
|
3458 |
+
0xbcc5 => 'AlphaDataDiscard',
|
3459 |
+
0xc427 => 'OceScanjobDesc',
|
3460 |
+
0xc428 => 'OceApplicationSelector',
|
3461 |
+
0xc429 => 'OceIDNumber',
|
3462 |
+
0xc42a => 'OceImageLogic',
|
3463 |
+
0xc44f => 'Annotations',
|
3464 |
+
0xc4a5 => 'PrintIM',
|
3465 |
+
0xc573 => 'OriginalFileName',
|
3466 |
+
0xc580 => 'USPTOOriginalContentType',
|
3467 |
+
0xc5e0 => 'CR2CFAPattern',
|
3468 |
+
0xc612 => 'DNGVersion',
|
3469 |
+
0xc613 => 'DNGBackwardVersion',
|
3470 |
+
0xc614 => 'UniqueCameraModel',
|
3471 |
+
0xc615 => 'LocalizedCameraModel',
|
3472 |
+
0xc616 => 'CFAPlaneColor',
|
3473 |
+
0xc617 => 'CFALayout',
|
3474 |
+
0xc618 => 'LinearizationTable',
|
3475 |
+
0xc619 => 'BlackLevelRepeatDim',
|
3476 |
+
0xc61a => 'BlackLevel',
|
3477 |
+
0xc61b => 'BlackLevelDeltaH',
|
3478 |
+
0xc61c => 'BlackLevelDeltaV',
|
3479 |
+
0xc61d => 'WhiteLevel',
|
3480 |
+
0xc61e => 'DefaultScale',
|
3481 |
+
0xc61f => 'DefaultCropOrigin',
|
3482 |
+
0xc620 => 'DefaultCropSize',
|
3483 |
+
0xc621 => 'ColorMatrix1',
|
3484 |
+
0xc622 => 'ColorMatrix2',
|
3485 |
+
0xc623 => 'CameraCalibration1',
|
3486 |
+
0xc624 => 'CameraCalibration2',
|
3487 |
+
0xc625 => 'ReductionMatrix1',
|
3488 |
+
0xc626 => 'ReductionMatrix2',
|
3489 |
+
0xc627 => 'AnalogBalance',
|
3490 |
+
0xc628 => 'AsShotNeutral',
|
3491 |
+
0xc629 => 'AsShotWhiteXY',
|
3492 |
+
0xc62a => 'BaselineExposure',
|
3493 |
+
0xc62b => 'BaselineNoise',
|
3494 |
+
0xc62c => 'BaselineSharpness',
|
3495 |
+
0xc62d => 'BayerGreenSplit',
|
3496 |
+
0xc62e => 'LinearResponseLimit',
|
3497 |
+
0xc62f => 'CameraSerialNumber',
|
3498 |
+
0xc630 => 'DNGLensInfo',
|
3499 |
+
0xc631 => 'ChromaBlurRadius',
|
3500 |
+
0xc632 => 'AntiAliasStrength',
|
3501 |
+
0xc633 => 'ShadowScale',
|
3502 |
+
0xc640 => 'RawImageSegmentation',
|
3503 |
+
0xc65a => 'CalibrationIlluminant1',
|
3504 |
+
0xc65b => 'CalibrationIlluminant2',
|
3505 |
+
0xc65c => 'BestQualityScale',
|
3506 |
+
0xc65d => 'RawDataUniqueID',
|
3507 |
+
0xc660 => 'AliasLayerMetadata',
|
3508 |
+
0xc68b => 'OriginalRawFileName',
|
3509 |
+
0xc68c => 'OriginalRawFileData',
|
3510 |
+
0xc68d => 'ActiveArea',
|
3511 |
+
0xc68e => 'MaskedAreas',
|
3512 |
+
0xc68f => 'AsShotICCProfile',
|
3513 |
+
0xc690 => 'AsShotPreProfileMatrix',
|
3514 |
+
0xc691 => 'CurrentICCProfile',
|
3515 |
+
0xc692 => 'CurrentPreProfileMatrix',
|
3516 |
+
0xc6bf => 'ColorimetricReference',
|
3517 |
+
0xc6c5 => 'SRawType',
|
3518 |
+
0xc6d2 => 'PanasonicTitle',
|
3519 |
+
0xc6d3 => 'PanasonicTitle2',
|
3520 |
+
0xc6f3 => 'CameraCalibrationSig',
|
3521 |
+
0xc6f4 => 'ProfileCalibrationSig',
|
3522 |
+
0xc6f5 => 'ProfileIFD',
|
3523 |
+
0xc6f6 => 'AsShotProfileName',
|
3524 |
+
0xc6f7 => 'NoiseReductionApplied',
|
3525 |
+
0xc6f8 => 'ProfileName',
|
3526 |
+
0xc6f9 => 'ProfileHueSatMapDims',
|
3527 |
+
0xc6fa => 'ProfileHueSatMapData1',
|
3528 |
+
0xc6fb => 'ProfileHueSatMapData2',
|
3529 |
+
0xc6fc => 'ProfileToneCurve',
|
3530 |
+
0xc6fd => 'ProfileEmbedPolicy',
|
3531 |
+
0xc6fe => 'ProfileCopyright',
|
3532 |
+
0xc714 => 'ForwardMatrix1',
|
3533 |
+
0xc715 => 'ForwardMatrix2',
|
3534 |
+
0xc716 => 'PreviewApplicationName',
|
3535 |
+
0xc717 => 'PreviewApplicationVersion',
|
3536 |
+
0xc718 => 'PreviewSettingsName',
|
3537 |
+
0xc719 => 'PreviewSettingsDigest',
|
3538 |
+
0xc71a => 'PreviewColorSpace',
|
3539 |
+
0xc71b => 'PreviewDateTime',
|
3540 |
+
0xc71c => 'RawImageDigest',
|
3541 |
+
0xc71d => 'OriginalRawFileDigest',
|
3542 |
+
0xc71e => 'SubTileBlockSize',
|
3543 |
+
0xc71f => 'RowInterleaveFactor',
|
3544 |
+
0xc725 => 'ProfileLookTableDims',
|
3545 |
+
0xc726 => 'ProfileLookTableData',
|
3546 |
+
0xc740 => 'OpcodeList1',
|
3547 |
+
0xc741 => 'OpcodeList2',
|
3548 |
+
0xc74e => 'OpcodeList3',
|
3549 |
+
0xc761 => 'NoiseProfile',
|
3550 |
+
0xc763 => 'TimeCodes',
|
3551 |
+
0xc764 => 'FrameRate',
|
3552 |
+
0xc772 => 'TStop',
|
3553 |
+
0xc789 => 'ReelName',
|
3554 |
+
0xc791 => 'OriginalDefaultFinalSize',
|
3555 |
+
0xc792 => 'OriginalBestQualitySize',
|
3556 |
+
0xc793 => 'OriginalDefaultCropSize',
|
3557 |
+
0xc7a1 => 'CameraLabel',
|
3558 |
+
0xc7a3 => 'ProfileHueSatMapEncoding',
|
3559 |
+
0xc7a4 => 'ProfileLookTableEncoding',
|
3560 |
+
0xc7a5 => 'BaselineExposureOffset',
|
3561 |
+
0xc7a6 => 'DefaultBlackRender',
|
3562 |
+
0xc7a7 => 'NewRawImageDigest',
|
3563 |
+
0xc7a8 => 'RawToPreviewGain',
|
3564 |
+
0xc7b5 => 'DefaultUserCrop',
|
3565 |
+
0xea1c => 'Padding',
|
3566 |
+
0xea1d => 'OffsetSchema',
|
3567 |
+
0xfde8 => 'OwnerName',
|
3568 |
+
0xfde9 => 'SerialNumber',
|
3569 |
+
0xfdea => 'Lens',
|
3570 |
+
0xfe00 => 'KDC_IFD',
|
3571 |
+
0xfe4c => 'RawFile',
|
3572 |
+
0xfe4d => 'Converter',
|
3573 |
+
0xfe4e => 'WhiteBalance',
|
3574 |
+
0xfe51 => 'Exposure',
|
3575 |
+
0xfe52 => 'Shadows',
|
3576 |
+
0xfe53 => 'Brightness',
|
3577 |
+
0xfe54 => 'Contrast',
|
3578 |
+
0xfe55 => 'Saturation',
|
3579 |
+
0xfe56 => 'Sharpness',
|
3580 |
+
0xfe57 => 'Smoothness',
|
3581 |
+
0xfe58 => 'MoireFilter',
|
3582 |
+
|
3583 |
+
);
|
3584 |
+
}
|
3585 |
+
|
3586 |
+
// Init
|
3587 |
+
$result = '';
|
3588 |
+
|
3589 |
+
// If brand given, try to find brand dependant tagname
|
3590 |
+
switch( $brand ) {
|
3591 |
+
|
3592 |
+
case 'CANON':
|
3593 |
+
if ( isset( $canontags[$tag] ) ) {
|
3594 |
+
$result = $canontags[$tag];
|
3595 |
+
}
|
3596 |
+
break;
|
3597 |
+
|
3598 |
+
case 'NIKON':
|
3599 |
+
if ( isset( $nikontags[$tag] ) ) {
|
3600 |
+
$result = $nikontags[$tag];
|
3601 |
+
}
|
3602 |
+
break;
|
3603 |
+
|
3604 |
+
case 'SAMSUNG':
|
3605 |
+
if ( isset( $samsungtags[$tag] ) ) {
|
3606 |
+
$result = $samsungtags[$tag];
|
3607 |
+
}
|
3608 |
+
|
3609 |
+
}
|
3610 |
+
|
3611 |
+
// If brand only requested, return result, even when blank
|
3612 |
+
if ( $brandonly ) {
|
3613 |
+
return $result;
|
3614 |
+
}
|
3615 |
+
|
3616 |
+
// Not found? Try editable tags
|
3617 |
+
if ( ! $result ) {
|
3618 |
+
if ( isset( $editabletags[$tag] ) ) {
|
3619 |
+
$result = $editabletags[$tag];
|
3620 |
+
}
|
3621 |
+
}
|
3622 |
+
|
3623 |
+
// Not found? Try common tags
|
3624 |
+
if ( ! $result ) {
|
3625 |
+
if ( isset( $commontags[$tag] ) ) {
|
3626 |
+
$result = $commontags[$tag];
|
3627 |
+
}
|
3628 |
+
}
|
3629 |
+
|
3630 |
+
// Not found? Find generic tag name
|
3631 |
+
if ( ! $result ) {
|
3632 |
+
$result = exif_tagname( $tag );
|
3633 |
+
if ( ! $result ) {
|
3634 |
+
wppa_log( 'dbg', 'exif_tagname found nothing for ' . sprintf( '0x%04X', $tag ) );
|
3635 |
+
$result = sprintf( 'UndefinedTag:0x%04X', $tag );
|
3636 |
}
|
3637 |
}
|
3638 |
+
|
3639 |
+
return $result;
|
3640 |
}
|
3641 |
|
3642 |
+
// Get gps data from photofile
|
3643 |
+
function wppa_get_coordinates( $picture_path, $photo_id ) {
|
3644 |
global $wpdb;
|
3645 |
|
3646 |
+
// Make sure we look at the original, not the -o1 file
|
3647 |
+
$picture_path = str_replace( '-o1.jpg', '.jpg', $picture_path );
|
3648 |
+
|
3649 |
+
// Exif on board?
|
3650 |
+
if ( ! function_exists( 'exif_read_data' ) ) return false;
|
3651 |
+
|
3652 |
+
// Check filetype
|
3653 |
+
if ( ! function_exists( 'exif_imagetype' ) ) return false;
|
3654 |
+
$image_type = @ exif_imagetype( $picture_path );
|
3655 |
+
if ( $image_type != IMAGETYPE_JPEG ) return false; // Not supported image type
|
3656 |
+
|
3657 |
+
// get exif data
|
3658 |
+
if ( $exif = @ exif_read_data( $picture_path, 0 , false ) ) {
|
3659 |
+
|
3660 |
+
// any coordinates available?
|
3661 |
+
if ( !isset ( $exif['GPSLatitude'][0] ) ) return false; // No GPS data
|
3662 |
+
if ( !isset ( $exif['GPSLongitude'][0] ) ) return false; // No GPS data
|
3663 |
+
|
3664 |
+
// north, east, south, west?
|
3665 |
+
if ( $exif['GPSLatitudeRef'] == "S" ) {
|
3666 |
+
$gps['latitude_string'] = -1;
|
3667 |
+
$gps['latitude_dicrection'] = "S";
|
3668 |
+
}
|
3669 |
+
else {
|
3670 |
+
$gps['latitude_string'] = 1;
|
3671 |
+
$gps['latitude_dicrection'] = "N";
|
3672 |
+
}
|
3673 |
+
if ( $exif['GPSLongitudeRef'] == "W" ) {
|
3674 |
+
$gps['longitude_string'] = -1;
|
3675 |
+
$gps['longitude_dicrection'] = "W";
|
3676 |
+
}
|
3677 |
+
else {
|
3678 |
+
$gps['longitude_string'] = 1;
|
3679 |
+
$gps['longitude_dicrection'] = "E";
|
3680 |
+
}
|
3681 |
+
// location
|
3682 |
+
$gps['latitude_hour'] = $exif["GPSLatitude"][0];
|
3683 |
+
$gps['latitude_minute'] = $exif["GPSLatitude"][1];
|
3684 |
+
$gps['latitude_second'] = $exif["GPSLatitude"][2];
|
3685 |
+
$gps['longitude_hour'] = $exif["GPSLongitude"][0];
|
3686 |
+
$gps['longitude_minute'] = $exif["GPSLongitude"][1];
|
3687 |
+
$gps['longitude_second'] = $exif["GPSLongitude"][2];
|
3688 |
+
|
3689 |
+
// calculating
|
3690 |
+
foreach( $gps as $key => $value ) {
|
3691 |
+
$pos = strpos( $value, '/' );
|
3692 |
+
if ( $pos !== false ) {
|
3693 |
+
$temp = explode( '/',$value );
|
3694 |
+
if ( $temp[1] ) $gps[$key] = $temp[0] / $temp[1];
|
3695 |
+
else $gps[$key] = 0;
|
3696 |
+
}
|
3697 |
+
}
|
3698 |
+
|
3699 |
+
$geo['latitude_format'] = $gps['latitude_dicrection']." ".$gps['latitude_hour']."°".$gps['latitude_minute']."'".round ( $gps['latitude_second'], 4 ).'"';
|
3700 |
+
$geo['longitude_format'] = $gps['longitude_dicrection']." ".$gps['longitude_hour']."°".$gps['longitude_minute']."'".round ( $gps['longitude_second'], 4 ).'"';
|
3701 |
|
3702 |
+
$geo['latitude'] = $gps['latitude_string'] * ( $gps['latitude_hour'] + ( $gps['latitude_minute'] / 60 ) + ( $gps['latitude_second'] / 3600 ) );
|
3703 |
+
$geo['longitude'] = $gps['longitude_string'] * ( $gps['longitude_hour'] + ( $gps['longitude_minute'] / 60 ) + ( $gps['longitude_second'] / 3600 ) );
|
3704 |
|
3705 |
+
}
|
3706 |
+
else { // No exif data
|
3707 |
+
return false;
|
3708 |
+
}
|
3709 |
+
|
3710 |
+
// Process result
|
3711 |
+
// print_r( $geo ); // debug
|
3712 |
+
$result = implode( '/', $geo );
|
3713 |
+
$wpdb->query( $wpdb->prepare( "UPDATE `".WPPA_PHOTOS."` SET `location` = %s WHERE `id` = %s", $result, $photo_id ) );
|
3714 |
+
return $geo;
|
3715 |
+
}
|
3716 |
+
|
3717 |
+
function wppa_get_camera_brand( $id ) {
|
3718 |
+
global $wpdb;
|
3719 |
+
|
3720 |
+
// Try stored exif data
|
3721 |
+
$E010F = $wpdb->get_var( $wpdb->prepare( "SELECT `description` FROM `" . WPPA_EXIF . "` WHERE `photo` = %s AND `tag` = 'E#010F' ", $id ) );
|
3722 |
+
if ( $E010F ) {
|
3723 |
+
$E010F = strtolower( $E010F );
|
3724 |
+
if ( strpos( $E010F, 'canon' ) !== false ) {
|
3725 |
+
return 'CANON';
|
3726 |
+
}
|
3727 |
+
if ( strpos( $E010F, 'nikon' ) !== false ) {
|
3728 |
+
return 'NIKON';
|
3729 |
+
}
|
3730 |
+
if ( strpos( $E010F, 'samsung' ) !== false ) {
|
3731 |
+
return 'SAMSUNG';
|
3732 |
+
}
|
3733 |
+
}
|
3734 |
|
3735 |
+
// Try source path
|
3736 |
+
$src = wppa_get_source_path( $id );
|
3737 |
+
if ( $src ) {
|
3738 |
+
$exifs = @ exif_read_data( $src, 'EXIF' );
|
3739 |
+
if ( $exifs ) {
|
3740 |
+
if ( isset( $exifs['Make'] ) ) {
|
3741 |
+
$E010F = strtolower( $exifs['Make'] );
|
3742 |
+
if ( strpos( $E010F, 'canon' ) !== false ) {
|
3743 |
+
return 'CANON';
|
3744 |
+
}
|
3745 |
+
if ( strpos( $E010F, 'nikon' ) !== false ) {
|
3746 |
+
return 'NIKON';
|
3747 |
+
}
|
3748 |
+
if ( strpos( $E010F, 'samsung' ) !== false ) {
|
3749 |
+
return 'SAMSUNG';
|
3750 |
}
|
3751 |
}
|
3752 |
}
|
3753 |
}
|
3754 |
+
|
3755 |
+
// Not found
|
3756 |
+
return '';
|
3757 |
+
|
3758 |
}
|
wppa-filter.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* get the albums via shortcode handler
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -508,14 +508,16 @@ function wppa_add_photo_shortcode() {
|
|
508 |
function wppa_photo_shortcodes( $xatts ) {
|
509 |
global $wppa;
|
510 |
global $wppa_postid;
|
|
|
|
|
511 |
|
512 |
// Init
|
513 |
wppa_reset_occurrance();
|
514 |
|
515 |
// Get and validate photo id
|
516 |
-
if ( isset( $xatts[0] )
|
517 |
$photo = $xatts[0];
|
518 |
-
if ( ! wppa_photo_exists( $photo ) ) {
|
519 |
return sprintf( __( 'Photo %d does not exist', 'wp-photo-album-plus' ), $photo );
|
520 |
}
|
521 |
}
|
@@ -530,6 +532,36 @@ global $wppa_postid;
|
|
530 |
$wppa_postid = get_the_ID(); // Remember the post id
|
531 |
}
|
532 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
533 |
// Get configuration settings
|
534 |
$type = wppa_opt( 'photo_shortcode_type' ); // 'xphoto';
|
535 |
$size = wppa_opt( 'photo_shortcode_size' ); // '350';
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* get the albums via shortcode handler
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
508 |
function wppa_photo_shortcodes( $xatts ) {
|
509 |
global $wppa;
|
510 |
global $wppa_postid;
|
511 |
+
global $wpdb;
|
512 |
+
static $seed;
|
513 |
|
514 |
// Init
|
515 |
wppa_reset_occurrance();
|
516 |
|
517 |
// Get and validate photo id
|
518 |
+
if ( isset( $xatts[0] ) ) {
|
519 |
$photo = $xatts[0];
|
520 |
+
if ( is_numeric( $photo ) && ! wppa_photo_exists( $photo ) ) {
|
521 |
return sprintf( __( 'Photo %d does not exist', 'wp-photo-album-plus' ), $photo );
|
522 |
}
|
523 |
}
|
532 |
$wppa_postid = get_the_ID(); // Remember the post id
|
533 |
}
|
534 |
|
535 |
+
// Random photo?
|
536 |
+
if ( $wppa_postid && $photo == 'random' ) {
|
537 |
+
|
538 |
+
if ( ! $seed ) {
|
539 |
+
$seed = time();
|
540 |
+
}
|
541 |
+
$seed = floor( $seed * 0.9 );
|
542 |
+
|
543 |
+
if ( wppa_opt( 'photo_shortcode_random_albums' ) != '-2' ) {
|
544 |
+
$albs = str_replace( '.', ',', wppa_expand_enum( wppa_opt( 'photo_shortcode_random_albums' ) ) );
|
545 |
+
$photo = $wpdb->get_var( $wpdb->prepare( "SELECT `id` FROM `" . WPPA_PHOTOS . "` " .
|
546 |
+
"WHERE `album` IN (" . $albs . ") " .
|
547 |
+
"ORDER BY RAND(%d) LIMIT 1", $seed ) );
|
548 |
+
}
|
549 |
+
else {
|
550 |
+
$photo = $wpdb->get_var( $wpdb->prepare( "SELECT `id` FROM `" . WPPA_PHOTOS . "` " .
|
551 |
+
"ORDER BY RAND(%d) LIMIT 1", $seed ) );
|
552 |
+
}
|
553 |
+
if ( $photo ) {
|
554 |
+
if ( wppa_switch( 'photo_shortcode_random_fixed' ) ) {
|
555 |
+
$post_content = $wpdb->get_var( $wpdb->prepare( "SELECT `post_content` FROM `" . $wpdb->posts . "` WHERE `ID` = %d", $wppa_postid ) );
|
556 |
+
$post_content = preg_replace( '/\[photo random\]/', '[photo '.$photo.']', $post_content, 1, $done );
|
557 |
+
$wpdb->query( $wpdb->prepare( "UPDATE `" . $wpdb->posts . "` SET `post_content` = %s WHERE `ID` = %d", $post_content, $wppa_postid ) );
|
558 |
+
}
|
559 |
+
}
|
560 |
+
else {
|
561 |
+
return __( 'No random photo found', 'wp-photo-album-plus' );
|
562 |
+
}
|
563 |
+
}
|
564 |
+
|
565 |
// Get configuration settings
|
566 |
$type = wppa_opt( 'photo_shortcode_type' ); // 'xphoto';
|
567 |
$size = wppa_opt( 'photo_shortcode_size' ); // '350';
|
wppa-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -826,7 +826,7 @@ global $wppa_session;
|
|
826 |
}
|
827 |
else wppa_out( '<span style="color:red">ERROR: Missing function wppa_theme(), check the installation of WPPA+. Remove customized wppa_theme.php</span>' );
|
828 |
global $wppa_version;
|
829 |
-
$expected_version = '6-
|
830 |
if ( $wppa_version != $expected_version ) {
|
831 |
wppa_dbg_msg( 'WARNING: customized wppa-theme.php is out of rev. Expected version: ' . $expected_version . ' found: ' . $wppa_version, 'red' );
|
832 |
}
|
@@ -1542,10 +1542,17 @@ global $wppa_session;
|
|
1542 |
|
1543 |
// Exif
|
1544 |
case 'e':
|
1545 |
-
$etag = str_replace( 'H', '#', $ss_data['2'] );
|
|
|
1546 |
$desc = $ss_data['3'];
|
1547 |
-
|
1548 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1549 |
$exiflines = $wpdb->get_results( $query, ARRAY_A );
|
1550 |
$ids = '0';
|
1551 |
if ( is_array( $exiflines ) ) foreach( $exiflines as $item ) {
|
@@ -2210,7 +2217,7 @@ static $user;
|
|
2210 |
$dellink = '';
|
2211 |
$choicelink = '';
|
2212 |
if ( ! wppa( 'is_filmonly' ) && ! wppa( 'is_slideonly' ) ) {
|
2213 |
-
if ( wppa_may_user_fe_edit( $id ) ) {
|
2214 |
$editlink = '
|
2215 |
<input' .
|
2216 |
' type="button"' .
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
826 |
}
|
827 |
else wppa_out( '<span style="color:red">ERROR: Missing function wppa_theme(), check the installation of WPPA+. Remove customized wppa_theme.php</span>' );
|
828 |
global $wppa_version;
|
829 |
+
$expected_version = '6-8-00-002';
|
830 |
if ( $wppa_version != $expected_version ) {
|
831 |
wppa_dbg_msg( 'WARNING: customized wppa-theme.php is out of rev. Expected version: ' . $expected_version . ' found: ' . $wppa_version, 'red' );
|
832 |
}
|
1542 |
|
1543 |
// Exif
|
1544 |
case 'e':
|
1545 |
+
$etag = substr( str_replace( 'H', '#', $ss_data['2'] ), 0, 6 );
|
1546 |
+
$brand = substr( $ss_data[2], 6 );
|
1547 |
$desc = $ss_data['3'];
|
1548 |
+
// if ( $brand ) {
|
1549 |
+
$query = $wpdb->prepare( "SELECT * FROM `" . WPPA_EXIF . "` " .
|
1550 |
+
"WHERE `tag` = %s AND `f_description` = %s AND `brand` = %s", $etag, $desc, $brand );
|
1551 |
+
// }
|
1552 |
+
// else {
|
1553 |
+
// $query = $wpdb->prepare( "SELECT * FROM `" . WPPA_EXIF . "` " .
|
1554 |
+
// "WHERE `tag` = %s AND `f_description` = %s", $etag, $desc );
|
1555 |
+
// }
|
1556 |
$exiflines = $wpdb->get_results( $query, ARRAY_A );
|
1557 |
$ids = '0';
|
1558 |
if ( is_array( $exiflines ) ) foreach( $exiflines as $item ) {
|
2217 |
$dellink = '';
|
2218 |
$choicelink = '';
|
2219 |
if ( ! wppa( 'is_filmonly' ) && ! wppa( 'is_slideonly' ) ) {
|
2220 |
+
if ( wppa_may_user_fe_edit( $id ) && wppa_opt( 'upload_edit' ) != '-none-' ) {
|
2221 |
$editlink = '
|
2222 |
<input' .
|
2223 |
' type="button"' .
|
wppa-import.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the import pages and functions
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -558,15 +558,20 @@ global $wppa_session;
|
|
558 |
echo
|
559 |
'<p class="hideifupdate" >' .
|
560 |
__( 'Default album for import:', 'wp-photo-album-plus') .
|
561 |
-
'<select name="wppa-photo-album" id="wppa-photo-album" >' .
|
562 |
wppa_album_select_a( array( 'path' => wppa_switch( 'hier_albsel' ),
|
563 |
'selected' => get_option( 'wppa-photo-album-import-'.wppa_get_user(), '0' ),
|
564 |
'addpleaseselect' => true,
|
565 |
'checkowner' => true,
|
566 |
'checkupload' => true,
|
567 |
'sort' => true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
568 |
) ) .
|
569 |
-
'</select>' .
|
570 |
__( 'Photos that have (<em>name</em>)[<em>album</em>] will be imported by that <em>name</em> in that <em>album</em>.', 'wp-photo-album-plus') .
|
571 |
'</p>';
|
572 |
|
@@ -850,15 +855,20 @@ global $wppa_session;
|
|
850 |
echo
|
851 |
'<p class="hideifupdate" >' .
|
852 |
__( 'Album to import to:', 'wp-photo-album-plus') .
|
853 |
-
'<select name="wppa-video-album" id="wppa-video-album">' .
|
854 |
wppa_album_select_a( array( 'path' => wppa_switch( 'hier_albsel' ),
|
855 |
'selected' => get_option( 'wppa-video-album-import-'.wppa_get_user(), '0' ),
|
856 |
'addpleaseselect' => true,
|
857 |
'checkowner' => true,
|
858 |
'checkupload' => true,
|
859 |
'sort' => true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
860 |
) ) .
|
861 |
-
'</select>' .
|
862 |
'</p>';
|
863 |
|
864 |
// Header of video list
|
@@ -958,15 +968,20 @@ global $wppa_session;
|
|
958 |
echo
|
959 |
'<p class="hideifupdate" >' .
|
960 |
__( 'Album to import to:', 'wp-photo-album-plus') .
|
961 |
-
'<select name="wppa-audio-album" id="wppa-audio-album" >' .
|
962 |
wppa_album_select_a( array( 'path' => wppa_switch( 'hier_albsel' ),
|
963 |
'selected' => get_option( 'wppa-audio-album-import-'.wppa_get_user(), '0' ),
|
964 |
'addpleaseselect' => true,
|
965 |
'checkowner' => true,
|
966 |
'checkupload' => true,
|
967 |
'sort' => true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
968 |
) ) .
|
969 |
-
'</select>' .
|
970 |
'</p>';
|
971 |
|
972 |
// Header of audio list
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the import pages and functions
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
558 |
echo
|
559 |
'<p class="hideifupdate" >' .
|
560 |
__( 'Default album for import:', 'wp-photo-album-plus') .
|
|
|
561 |
wppa_album_select_a( array( 'path' => wppa_switch( 'hier_albsel' ),
|
562 |
'selected' => get_option( 'wppa-photo-album-import-'.wppa_get_user(), '0' ),
|
563 |
'addpleaseselect' => true,
|
564 |
'checkowner' => true,
|
565 |
'checkupload' => true,
|
566 |
'sort' => true,
|
567 |
+
'optionclass' => '',
|
568 |
+
'tagopen' => '<select name="wppa-photo-album" id="wppa-photo-album" >',
|
569 |
+
'tagname' => 'wppa-photo-album',
|
570 |
+
'tagid' => 'wppa-photo-album',
|
571 |
+
'tagonchange' => '',
|
572 |
+
'multiple' => false,
|
573 |
+
'tagstyle' => '',
|
574 |
) ) .
|
|
|
575 |
__( 'Photos that have (<em>name</em>)[<em>album</em>] will be imported by that <em>name</em> in that <em>album</em>.', 'wp-photo-album-plus') .
|
576 |
'</p>';
|
577 |
|
855 |
echo
|
856 |
'<p class="hideifupdate" >' .
|
857 |
__( 'Album to import to:', 'wp-photo-album-plus') .
|
|
|
858 |
wppa_album_select_a( array( 'path' => wppa_switch( 'hier_albsel' ),
|
859 |
'selected' => get_option( 'wppa-video-album-import-'.wppa_get_user(), '0' ),
|
860 |
'addpleaseselect' => true,
|
861 |
'checkowner' => true,
|
862 |
'checkupload' => true,
|
863 |
'sort' => true,
|
864 |
+
'optionclass' => '',
|
865 |
+
'tagopen' => '<select name="wppa-video-album" id="wppa-video-album" >',
|
866 |
+
'tagname' => 'wppa-video-album',
|
867 |
+
'tagid' => 'wppa-video-album',
|
868 |
+
'tagonchange' => '',
|
869 |
+
'multiple' => false,
|
870 |
+
'tagstyle' => '',
|
871 |
) ) .
|
|
|
872 |
'</p>';
|
873 |
|
874 |
// Header of video list
|
968 |
echo
|
969 |
'<p class="hideifupdate" >' .
|
970 |
__( 'Album to import to:', 'wp-photo-album-plus') .
|
|
|
971 |
wppa_album_select_a( array( 'path' => wppa_switch( 'hier_albsel' ),
|
972 |
'selected' => get_option( 'wppa-audio-album-import-'.wppa_get_user(), '0' ),
|
973 |
'addpleaseselect' => true,
|
974 |
'checkowner' => true,
|
975 |
'checkupload' => true,
|
976 |
'sort' => true,
|
977 |
+
'optionclass' => '',
|
978 |
+
'tagopen' => '<select name="wppa-audio-album" id="wppa-audio-album" >',
|
979 |
+
'tagname' => 'wppa-audio-album',
|
980 |
+
'tagid' => 'wppa-audio-album',
|
981 |
+
'tagonchange' => '',
|
982 |
+
'multiple' => false,
|
983 |
+
'tagstyle' => '',
|
984 |
) ) .
|
|
|
985 |
'</p>';
|
986 |
|
987 |
// Header of audio list
|
wppa-index.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all indexing functions
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*
|
9 |
*/
|
@@ -289,17 +289,20 @@ function wppa_index_raw_to_words( $xtext, $no_skips = false, $minlen = '3', $no_
|
|
289 |
}
|
290 |
|
291 |
// Expand compressed string
|
292 |
-
function wppa_index_string_to_array($string) {
|
|
|
293 |
// Anything?
|
294 |
if ( ! $string ) return array();
|
|
|
295 |
// Any ranges?
|
296 |
if ( ! strstr($string, '..') ) {
|
297 |
$result = explode(',', $string);
|
298 |
-
foreach( array_keys($result) as $key ) {
|
299 |
$result[$key] = strval($result[$key]);
|
300 |
}
|
301 |
return $result;
|
302 |
}
|
|
|
303 |
// Yes
|
304 |
$temp = explode(',', $string);
|
305 |
$result = array();
|
@@ -316,26 +319,14 @@ function wppa_index_string_to_array($string) {
|
|
316 |
}
|
317 |
}
|
318 |
|
319 |
-
|
320 |
-
|
321 |
-
}
|
322 |
|
323 |
-
|
324 |
-
|
|
|
325 |
|
326 |
-
|
327 |
-
function wppa_index_array_remove_dups( $array ) {
|
328 |
-
$temp = $array;
|
329 |
-
sort( $temp, SORT_NUMERIC );
|
330 |
-
$array = array();
|
331 |
-
$oldval = false;
|
332 |
-
foreach ( array_keys( $temp ) as $key ) {
|
333 |
-
if ( $temp[$key] != $oldval ) {
|
334 |
-
$array[] = $temp[$key];
|
335 |
-
$oldval = $temp[$key];
|
336 |
-
}
|
337 |
-
}
|
338 |
-
return $array;
|
339 |
}
|
340 |
|
341 |
// Compress array ranges and convert to string
|
@@ -348,7 +339,10 @@ function wppa_index_array_to_string( $array ) {
|
|
348 |
}
|
349 |
}
|
350 |
|
351 |
-
|
|
|
|
|
|
|
352 |
$result = '';
|
353 |
$lastitem = '-1';
|
354 |
$isrange = false;
|
@@ -478,6 +472,10 @@ function wppa_index_get_raw_album( $id ) {
|
|
478 |
$words .= ' '.$album['cats'];
|
479 |
}
|
480 |
|
|
|
|
|
|
|
|
|
481 |
// Done!
|
482 |
return $words;
|
483 |
}
|
@@ -499,5 +497,10 @@ global $wpdb;
|
|
499 |
}
|
500 |
}
|
501 |
|
|
|
|
|
|
|
|
|
|
|
502 |
return $words;
|
503 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all indexing functions
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*
|
9 |
*/
|
289 |
}
|
290 |
|
291 |
// Expand compressed string
|
292 |
+
function wppa_index_string_to_array( $string ) {
|
293 |
+
|
294 |
// Anything?
|
295 |
if ( ! $string ) return array();
|
296 |
+
|
297 |
// Any ranges?
|
298 |
if ( ! strstr($string, '..') ) {
|
299 |
$result = explode(',', $string);
|
300 |
+
foreach( array_keys( $result ) as $key ) {
|
301 |
$result[$key] = strval($result[$key]);
|
302 |
}
|
303 |
return $result;
|
304 |
}
|
305 |
+
|
306 |
// Yes
|
307 |
$temp = explode(',', $string);
|
308 |
$result = array();
|
319 |
}
|
320 |
}
|
321 |
|
322 |
+
// Remove dups
|
323 |
+
$result = array_unique( $result );
|
|
|
324 |
|
325 |
+
// foreach( array_keys($result) as $key ) {
|
326 |
+
// $result[$key] = strval($result[$key]);
|
327 |
+
// }
|
328 |
|
329 |
+
return $result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
}
|
331 |
|
332 |
// Compress array ranges and convert to string
|
339 |
}
|
340 |
}
|
341 |
|
342 |
+
// Remove dups and sort
|
343 |
+
$array = array_unique( $array, SORT_NUMERIC );
|
344 |
+
|
345 |
+
// Build string
|
346 |
$result = '';
|
347 |
$lastitem = '-1';
|
348 |
$isrange = false;
|
472 |
$words .= ' '.$album['cats'];
|
473 |
}
|
474 |
|
475 |
+
// Strip tags, but prevent cluttering
|
476 |
+
$words = str_replace( '<', ' <', $words );
|
477 |
+
$words = strip_tags( $words );
|
478 |
+
|
479 |
// Done!
|
480 |
return $words;
|
481 |
}
|
497 |
}
|
498 |
}
|
499 |
|
500 |
+
// Strip tags, but prevent cluttering
|
501 |
+
$words = str_replace( '<', ' <', $words );
|
502 |
+
$words = strip_tags( $words );
|
503 |
+
|
504 |
+
// Done!
|
505 |
return $words;
|
506 |
}
|
wppa-links.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Frontend links
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -312,7 +312,7 @@ function wppa_convert_from_pretty( $uri ) {
|
|
312 |
$args = explode( '/', substr( $uri, $wppapos + 10 ) );
|
313 |
|
314 |
// process 'arguments'
|
315 |
-
if ( count($args > 0
|
316 |
$first = true;
|
317 |
$possible_conflicts = array( 'wppa-page=' );
|
318 |
|
@@ -465,6 +465,11 @@ function wppa_convert_to_pretty( $xuri, $no_names = false, $overrule = false ) {
|
|
465 |
return $uri;
|
466 |
}
|
467 |
|
|
|
|
|
|
|
|
|
|
|
468 |
// Re-order
|
469 |
if ( strpos( $uri, '&' ) !== false ) {
|
470 |
$amps = true;
|
@@ -1018,7 +1023,7 @@ function wppa_page_links( $npages = '1', $curpage = '1', $slide = false ) {
|
|
1018 |
if ( wppa( 'src' ) && ! wppa( 'is_related' ) ) $extra_url .= '&wppa-searchstring='.urlencode( wppa( 'searchstring' ) );
|
1019 |
|
1020 |
// Supersearch?
|
1021 |
-
if ( wppa( 'supersearch' ) ) $extra_url .= '&wppa-supersearch=' . urlencode( wppa( 'supersearch' ) );
|
1022 |
|
1023 |
// Related
|
1024 |
if ( wppa( 'is_related' ) ) $extra_url .= '&wppa-rel='.wppa( 'is_related' ).'&wppa-relcount='.wppa( 'related_count' );
|
@@ -1762,7 +1767,7 @@ global $wpdb;
|
|
1762 |
}
|
1763 |
|
1764 |
if ( wppa( 'supersearch' ) ) {
|
1765 |
-
$result['url'] .= '&wppa-supersearch=' . urlencode( wppa( 'supersearch' ) );
|
1766 |
}
|
1767 |
|
1768 |
if ( wppa( 'src' ) && ! wppa( 'is_related' ) && ! wppa_in_widget() ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Frontend links
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
312 |
$args = explode( '/', substr( $uri, $wppapos + 10 ) );
|
313 |
|
314 |
// process 'arguments'
|
315 |
+
if ( is_array( $args ) && count( $args ) > 0 ) {
|
316 |
$first = true;
|
317 |
$possible_conflicts = array( 'wppa-page=' );
|
318 |
|
465 |
return $uri;
|
466 |
}
|
467 |
|
468 |
+
// Not in supersearch: FNumber: f/nn. Replaceing '/' by '%2F' does not work
|
469 |
+
if ( wppa( 'supersearch' ) ) {
|
470 |
+
return $uri;
|
471 |
+
}
|
472 |
+
|
473 |
// Re-order
|
474 |
if ( strpos( $uri, '&' ) !== false ) {
|
475 |
$amps = true;
|
1023 |
if ( wppa( 'src' ) && ! wppa( 'is_related' ) ) $extra_url .= '&wppa-searchstring='.urlencode( wppa( 'searchstring' ) );
|
1024 |
|
1025 |
// Supersearch?
|
1026 |
+
if ( wppa( 'supersearch' ) ) $extra_url .= '&wppa-supersearch=' . str_replace( '/', '%2F', urlencode( wppa( 'supersearch' ) ) );
|
1027 |
|
1028 |
// Related
|
1029 |
if ( wppa( 'is_related' ) ) $extra_url .= '&wppa-rel='.wppa( 'is_related' ).'&wppa-relcount='.wppa( 'related_count' );
|
1767 |
}
|
1768 |
|
1769 |
if ( wppa( 'supersearch' ) ) {
|
1770 |
+
$result['url'] .= '&wppa-supersearch=' . str_replace( '/', '%2F', urlencode( wppa( 'supersearch' ) ) );
|
1771 |
}
|
1772 |
|
1773 |
if ( wppa( 'src' ) && ! wppa( 'is_related' ) && ! wppa_in_widget() ) {
|
wppa-maintenance.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains (not yet, but in the future maybe) all the maintenance routines
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -26,6 +26,7 @@ $wppa_all_maintenance_slugs = array( 'wppa_remake_index_albums',
|
|
26 |
'wppa_regen_thumbs',
|
27 |
'wppa_rerate',
|
28 |
'wppa_recup',
|
|
|
29 |
'wppa_file_system',
|
30 |
'wppa_cleanup',
|
31 |
'wppa_remake',
|
@@ -64,6 +65,7 @@ $wppa_cron_maintenance_slugs = array( 'wppa_remake_index_albums',
|
|
64 |
'wppa_regen_thumbs',
|
65 |
'wppa_rerate',
|
66 |
'wppa_recup',
|
|
|
67 |
'wppa_cleanup_index',
|
68 |
'wppa_remake',
|
69 |
'wppa_rerate',
|
@@ -190,8 +192,8 @@ global $wppa_timestamp_start;
|
|
190 |
|
191 |
// Pre-Clear exif and iptc tables only if not cron
|
192 |
if ( ! wppa_is_cron() ) {
|
193 |
-
$wpdb->query( "
|
194 |
-
$wpdb->query( "
|
195 |
}
|
196 |
break;
|
197 |
case 'wppa_file_system':
|
@@ -258,7 +260,7 @@ global $wppa_timestamp_start;
|
|
258 |
|
259 |
if ( $lastid != '0' ) {
|
260 |
if ( wppa_is_cron() ) {
|
261 |
-
wppa_log( 'Cron', '{b}' . $slug . '{/b} continued. Allowed runtime: ' . ( $endtime - time() ) . 's. Cron id = ' . wppa_is_cron() );
|
262 |
}
|
263 |
}
|
264 |
|
@@ -358,6 +360,7 @@ global $wppa_timestamp_start;
|
|
358 |
case 'wppa_regen_thumbs':
|
359 |
case 'wppa_rerate':
|
360 |
case 'wppa_recup':
|
|
|
361 |
case 'wppa_file_system':
|
362 |
case 'wppa_cleanup':
|
363 |
case 'wppa_remake':
|
@@ -545,6 +548,10 @@ global $wppa_timestamp_start;
|
|
545 |
if ( $a_ret['exiffix'] ) $wppa_session[$slug.'_fixed']++;
|
546 |
break;
|
547 |
|
|
|
|
|
|
|
|
|
548 |
case 'wppa_file_system':
|
549 |
$fs = get_option('wppa_file_system');
|
550 |
if ( $fs == 'to-tree' || $fs == 'to-flat' ) {
|
@@ -1467,7 +1474,7 @@ global $wpdb;
|
|
1467 |
if ( $image_type == IMAGETYPE_JPEG ) {
|
1468 |
|
1469 |
// Get exif data
|
1470 |
-
$exif = exif_read_data( $file, '
|
1471 |
|
1472 |
// Exif data found
|
1473 |
if ( $exif ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains (not yet, but in the future maybe) all the maintenance routines
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
26 |
'wppa_regen_thumbs',
|
27 |
'wppa_rerate',
|
28 |
'wppa_recup',
|
29 |
+
'wppa_format_exif',
|
30 |
'wppa_file_system',
|
31 |
'wppa_cleanup',
|
32 |
'wppa_remake',
|
65 |
'wppa_regen_thumbs',
|
66 |
'wppa_rerate',
|
67 |
'wppa_recup',
|
68 |
+
'wppa_format_exif',
|
69 |
'wppa_cleanup_index',
|
70 |
'wppa_remake',
|
71 |
'wppa_rerate',
|
192 |
|
193 |
// Pre-Clear exif and iptc tables only if not cron
|
194 |
if ( ! wppa_is_cron() ) {
|
195 |
+
$wpdb->query( "TRUNCATE TABLE `" . WPPA_IPTC . "`" );
|
196 |
+
$wpdb->query( "TRUNCATE TABLE `" . WPPA_EXIF . "`" );
|
197 |
}
|
198 |
break;
|
199 |
case 'wppa_file_system':
|
260 |
|
261 |
if ( $lastid != '0' ) {
|
262 |
if ( wppa_is_cron() ) {
|
263 |
+
wppa_log( 'Cron', '{b}' . $slug . '{/b} continued at item # ' . ( $lastid + 1 ) . '. Allowed runtime: ' . ( $endtime - time() ) . 's. Cron id = ' . wppa_is_cron() );
|
264 |
}
|
265 |
}
|
266 |
|
360 |
case 'wppa_regen_thumbs':
|
361 |
case 'wppa_rerate':
|
362 |
case 'wppa_recup':
|
363 |
+
case 'wppa_format_exif':
|
364 |
case 'wppa_file_system':
|
365 |
case 'wppa_cleanup':
|
366 |
case 'wppa_remake':
|
548 |
if ( $a_ret['exiffix'] ) $wppa_session[$slug.'_fixed']++;
|
549 |
break;
|
550 |
|
551 |
+
case 'wppa_format_exif':
|
552 |
+
wppa_fix_exif_format( $id );
|
553 |
+
break;
|
554 |
+
|
555 |
case 'wppa_file_system':
|
556 |
$fs = get_option('wppa_file_system');
|
557 |
if ( $fs == 'to-tree' || $fs == 'to-flat' ) {
|
1474 |
if ( $image_type == IMAGETYPE_JPEG ) {
|
1475 |
|
1476 |
// Get exif data
|
1477 |
+
$exif = @ exif_read_data( $file, 'ANY_TAG' );
|
1478 |
|
1479 |
// Exif data found
|
1480 |
if ( $exif ) {
|
wppa-photo-admin-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* edit and delete photos
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -470,6 +470,18 @@ function wppaTryScheduledel( id ) {
|
|
470 |
}
|
471 |
}
|
472 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
473 |
</script>
|
474 |
<?php
|
475 |
|
@@ -1016,7 +1028,7 @@ function wppaTryScheduledel( id ) {
|
|
1016 |
__( 'Filesize:', 'wp-photo-album-plus' ) . ' ' .
|
1017 |
wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) );
|
1018 |
$c++;
|
1019 |
-
if ( $c == count( $is_video ) ) {
|
1020 |
echo '. ';
|
1021 |
}
|
1022 |
else {
|
@@ -1036,7 +1048,7 @@ function wppaTryScheduledel( id ) {
|
|
1036 |
__( 'Filesize:', 'wp-photo-album-plus' ) . ' ' .
|
1037 |
wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) );
|
1038 |
$c++;
|
1039 |
-
if ( $c == count( $is_video ) ) {
|
1040 |
echo '. ';
|
1041 |
}
|
1042 |
else {
|
@@ -2021,69 +2033,140 @@ function wppaTryScheduledel( id ) {
|
|
2021 |
'</tbody>' .
|
2022 |
'</table>';
|
2023 |
|
2024 |
-
echo
|
2025 |
"\n" . '<!-- Section 5 -->';
|
2026 |
|
2027 |
-
//
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
2035 |
-
'<
|
2036 |
-
'
|
2037 |
-
|
2038 |
-
|
2039 |
-
|
2040 |
-
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
|
2046 |
-
|
2047 |
-
|
2048 |
-
<tr
|
2049 |
-
<td style="padding:0 4px;" >
|
2050 |
-
<td style="padding:0 4px;" >
|
2051 |
-
<td style="padding:0 4px;" >
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
|
2061 |
-
|
2062 |
-
|
2063 |
-
|
2064 |
-
|
2065 |
-
|
2066 |
-
|
2067 |
-
|
2068 |
-
|
2069 |
-
|
2070 |
-
|
2071 |
-
|
2072 |
-
|
2073 |
-
if ( $comment['status'] == 'pending' ) _e( 'Pending' , 'wp-photo-album-plus');
|
2074 |
-
elseif ( $comment['status'] == 'approved' ) _e( 'Approved' , 'wp-photo-album-plus');
|
2075 |
-
elseif ( $comment['status'] == 'spam' ) _e( 'Spam' , 'wp-photo-album-plus');
|
2076 |
-
elseif ( $comment['status'] == 'trash' ) _e( 'Trash' , 'wp-photo-album-plus');
|
2077 |
-
echo '</td>';
|
2078 |
-
}
|
2079 |
-
echo '<td style="padding:0 4px;" >'.$comment['comment'].'</td>
|
2080 |
-
</tr>' .
|
2081 |
-
'<script>wppaSetComBgCol(' . $comment['id'] . ')</script>';
|
2082 |
-
}
|
2083 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2084 |
echo
|
2085 |
-
'
|
2086 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2087 |
}
|
2088 |
|
2089 |
echo
|
@@ -2968,7 +3051,7 @@ global $wppa_search_stats;
|
|
2968 |
$doit = false;
|
2969 |
|
2970 |
if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) $doit = true;
|
2971 |
-
if ( wppa_opt( 'upload_edit' ) != 'none' ) $doit = true;
|
2972 |
if ( ! $doit ) { // Should never get here. Only when url is manipulted manually.
|
2973 |
die('Security check failure #309');
|
2974 |
}
|
@@ -3010,7 +3093,7 @@ global $wppa_search_stats;
|
|
3010 |
}
|
3011 |
|
3012 |
if ( $first ) {
|
3013 |
-
$photo_array =
|
3014 |
$count = empty( $photo_array ) ? '0' : count( $photo_array );
|
3015 |
$list = implode( ',', $photo_array );
|
3016 |
if ( ! $list ) {
|
@@ -3031,7 +3114,7 @@ global $wppa_search_stats;
|
|
3031 |
$first = false;
|
3032 |
}
|
3033 |
else {
|
3034 |
-
$temp_array =
|
3035 |
$count = empty( $temp_array ) ? '0' : count( $temp_array );
|
3036 |
$list = implode( ',', $temp_array );
|
3037 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* edit and delete photos
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
470 |
}
|
471 |
}
|
472 |
|
473 |
+
function wppaToggleExif( id, count ) {
|
474 |
+
|
475 |
+
if ( jQuery( '#wppa-exif-' + id ).css( 'display' ) == 'none' ) {
|
476 |
+
jQuery( '#wppa-exif-' + id ).show();
|
477 |
+
jQuery( '#wppa-exif-button-' + id ).attr( 'value', '<?php _e( 'Hide', 'wp-photo-album-plus' ) ?> ' + count + ' <?php _e( 'EXIF items', 'wp-photo-album-plus' ) ?>' );
|
478 |
+
}
|
479 |
+
else {
|
480 |
+
jQuery( '#wppa-exif-' + id ).hide();
|
481 |
+
jQuery( '#wppa-exif-button-' + id ).attr( 'value', '<?php _e( 'Show', 'wp-photo-album-plus' ) ?> ' + count + ' <?php _e( 'EXIF items', 'wp-photo-album-plus' ) ?>' );
|
482 |
+
}
|
483 |
+
}
|
484 |
+
|
485 |
</script>
|
486 |
<?php
|
487 |
|
1028 |
__( 'Filesize:', 'wp-photo-album-plus' ) . ' ' .
|
1029 |
wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) );
|
1030 |
$c++;
|
1031 |
+
if ( is_array( $is_video ) && $c == count( $is_video ) ) {
|
1032 |
echo '. ';
|
1033 |
}
|
1034 |
else {
|
1048 |
__( 'Filesize:', 'wp-photo-album-plus' ) . ' ' .
|
1049 |
wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) );
|
1050 |
$c++;
|
1051 |
+
if ( is_array( $is_video ) && $c == count( $is_video ) ) {
|
1052 |
echo '. ';
|
1053 |
}
|
1054 |
else {
|
2033 |
'</tbody>' .
|
2034 |
'</table>';
|
2035 |
|
2036 |
+
echo // Section 5
|
2037 |
"\n" . '<!-- Section 5 -->';
|
2038 |
|
2039 |
+
// Exif
|
2040 |
+
if ( ! $quick ) {
|
2041 |
+
$exifs = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `" . WPPA_EXIF . "` " .
|
2042 |
+
"WHERE `photo` = %s " .
|
2043 |
+
"ORDER BY `tag`, `id` ", $id ), ARRAY_A );
|
2044 |
+
if ( ! empty( $exifs ) ) {
|
2045 |
+
$brand = wppa_get_camera_brand( $id );
|
2046 |
+
echo
|
2047 |
+
'<table><tbody><tr><td><input' .
|
2048 |
+
' type="button"' .
|
2049 |
+
' id="wppa-exif-button-' . $id . '"' .
|
2050 |
+
' class="button-secundary"' .
|
2051 |
+
' value="' . esc_attr( sprintf( __( 'Show %d EXIF items', 'wp-photo-album-plus' ), count( $exifs ) ) ) . '"' .
|
2052 |
+
' onclick="wppaToggleExif( ' . $id . ', ' . count( $exifs ) . ' );"' .
|
2053 |
+
' /></td></tr></tbody></table>' .
|
2054 |
+
'<table' .
|
2055 |
+
' id="wppa-exif-' . $id . '"' .
|
2056 |
+
' class="wppa-table wppa-photo-table"' .
|
2057 |
+
' style="clear:both;width:100%;display:none;"' .
|
2058 |
+
' >' .
|
2059 |
+
'<thead>' .
|
2060 |
+
'<tr style="font-weight:bold;" >' .
|
2061 |
+
'<td style="padding:0 4px;" >Exif tag</td>' .
|
2062 |
+
'<td style="padding:0 4px;" >Brand</td>' .
|
2063 |
+
'<td style="padding:0 4px;" >Description</td>' .
|
2064 |
+
'<td style="padding:0 4px;max-width:30%;" >Raw value</td>' .
|
2065 |
+
'<td style="padding:0 4px;max-width:30%;" >Formatted value</td>' .
|
2066 |
+
'</tr>' .
|
2067 |
+
'</thead>' .
|
2068 |
+
'<tbody>';
|
2069 |
+
|
2070 |
+
foreach ( $exifs as $exif ) {
|
2071 |
+
echo '
|
2072 |
+
<tr id="exif-tr-' . $exif['id'] . '" >
|
2073 |
+
<td style="padding:0 4px;" >'.$exif['tag'].'</td>';
|
2074 |
+
|
2075 |
+
if ( $brand && $exif['brand'] ) { // * wppa_exif_tagname( hexdec( substr( $exif['tag'], 2, 4 ) ), $brand, 'brandonly' ) ) {
|
2076 |
+
echo '
|
2077 |
+
<td style="padding:0 4px;" >' . $brand . '</td>
|
2078 |
+
<td style="padding:0 4px;" >' . wppa_exif_tagname( hexdec( substr( $exif['tag'], 2, 4 ) ), $brand, 'brandonly' ) . ':</td>';
|
2079 |
+
}
|
2080 |
+
else {
|
2081 |
+
echo '
|
2082 |
+
<td style="padding:0 4px;" ></td>
|
2083 |
+
<td style="padding:0 4px;" >' . wppa_exif_tagname( hexdec( substr( $exif['tag'], 2, 4 ) ) ) . ':</td>';
|
2084 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2085 |
|
2086 |
+
echo '
|
2087 |
+
<td style="padding:0 4px;" >'.$exif['description'].'</td>
|
2088 |
+
<td style="padding:0 4px;" >' .
|
2089 |
+
( $exif['f_description'] == __( 'n.a.', 'wp-photo-album-plus' ) ? wppa_format_exif( $exif['tag'], $exif['description'] ) : $exif['f_description'] ) .
|
2090 |
+
'</td>
|
2091 |
+
</tr>';
|
2092 |
+
|
2093 |
+
}
|
2094 |
+
|
2095 |
+
echo
|
2096 |
+
'</tbody>' .
|
2097 |
+
'</table>';
|
2098 |
+
|
2099 |
+
|
2100 |
+
}
|
2101 |
+
}
|
2102 |
+
|
2103 |
+
echo // Section 6
|
2104 |
+
"\n" . '<!-- Section 6 -->';
|
2105 |
+
|
2106 |
+
// Comments
|
2107 |
+
if ( ! $quick ) {
|
2108 |
+
$comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `" . WPPA_COMMENTS."` " .
|
2109 |
+
"WHERE `photo` = %s " .
|
2110 |
+
"ORDER BY `timestamp` DESC ", $id ), ARRAY_A );
|
2111 |
+
if ( ! empty( $comments ) ) {
|
2112 |
echo
|
2113 |
+
'<table' .
|
2114 |
+
' class="wppa-table wppa-photo-table"' .
|
2115 |
+
' style="width:100%;"' .
|
2116 |
+
' >' .
|
2117 |
+
'<thead>' .
|
2118 |
+
'<tr style="font-weight:bold;" >' .
|
2119 |
+
'<td style="padding:0 4px;" >#</td>' .
|
2120 |
+
'<td style="padding:0 4px;" >User</td>' .
|
2121 |
+
'<td style="padding:0 4px;" >Time since</td>' .
|
2122 |
+
'<td style="padding:0 4px;" >Status</td>' .
|
2123 |
+
'<td style="padding:0 4px;" >Comment</td>' .
|
2124 |
+
'</tr>' .
|
2125 |
+
'</thead>' .
|
2126 |
+
'<tbody>';
|
2127 |
+
|
2128 |
+
foreach ( $comments as $comment ) {
|
2129 |
+
echo '
|
2130 |
+
<tr id="com-tr-' . $comment['id'] . '" >
|
2131 |
+
<td style="padding:0 4px;" >'.$comment['id'].'</td>
|
2132 |
+
<td style="padding:0 4px;" >'.$comment['user'].'</td>
|
2133 |
+
<td style="padding:0 4px;" >'.wppa_get_time_since( $comment['timestamp'] ).'</td>';
|
2134 |
+
if ( current_user_can( 'wppa_comments' ) || current_user_can( 'wppa_moderate' ) || ( wppa_get_user() == $photo['owner'] && wppa_switch( 'owner_moderate_comment' ) ) ) {
|
2135 |
+
$p = ( $comment['status'] == 'pending' ) ? 'selected="selected" ' : '';
|
2136 |
+
$a = ( $comment['status'] == 'approved' ) ? 'selected="selected" ' : '';
|
2137 |
+
$s = ( $comment['status'] == 'spam' ) ? 'selected="selected" ' : '';
|
2138 |
+
$t = ( $comment['status'] == 'trash' ) ? 'selected="selected" ' : '';
|
2139 |
+
echo
|
2140 |
+
'<td style="padding:0 4px;" >' .
|
2141 |
+
'<select' .
|
2142 |
+
' id="com-stat-' . $comment['id'] . '"' .
|
2143 |
+
' style=""' .
|
2144 |
+
' onchange="wppaAjaxUpdateCommentStatus( '.$id.', '.$comment['id'].', this.value );wppaSetComBgCol(' . $comment['id'] . ');"' .
|
2145 |
+
' >' .
|
2146 |
+
'<option value="pending" '.$p.'>'.__( 'Pending' , 'wp-photo-album-plus').'</option>' .
|
2147 |
+
'<option value="approved" '.$a.'>'.__( 'Approved' , 'wp-photo-album-plus').'</option>' .
|
2148 |
+
'<option value="spam" '.$s.'>'.__( 'Spam' , 'wp-photo-album-plus').'</option>' .
|
2149 |
+
'<option value="trash" '.$t.'>'.__( 'Trash' , 'wp-photo-album-plus').'</option>' .
|
2150 |
+
'</select >' .
|
2151 |
+
'</td>';
|
2152 |
+
}
|
2153 |
+
else {
|
2154 |
+
echo '<td style="padding:0 4px;" >';
|
2155 |
+
if ( $comment['status'] == 'pending' ) _e( 'Pending' , 'wp-photo-album-plus');
|
2156 |
+
elseif ( $comment['status'] == 'approved' ) _e( 'Approved' , 'wp-photo-album-plus');
|
2157 |
+
elseif ( $comment['status'] == 'spam' ) _e( 'Spam' , 'wp-photo-album-plus');
|
2158 |
+
elseif ( $comment['status'] == 'trash' ) _e( 'Trash' , 'wp-photo-album-plus');
|
2159 |
+
echo '</td>';
|
2160 |
+
}
|
2161 |
+
echo '<td style="padding:0 4px;" >'.$comment['comment'].'</td>
|
2162 |
+
</tr>' .
|
2163 |
+
'<script>wppaSetComBgCol(' . $comment['id'] . ')</script>';
|
2164 |
+
}
|
2165 |
+
|
2166 |
+
echo
|
2167 |
+
'</tbody>' .
|
2168 |
+
'</table>';
|
2169 |
+
}
|
2170 |
}
|
2171 |
|
2172 |
echo
|
3051 |
$doit = false;
|
3052 |
|
3053 |
if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) $doit = true;
|
3054 |
+
if ( wppa_opt( 'upload_edit' ) != '-none-' ) $doit = true;
|
3055 |
if ( ! $doit ) { // Should never get here. Only when url is manipulted manually.
|
3056 |
die('Security check failure #309');
|
3057 |
}
|
3093 |
}
|
3094 |
|
3095 |
if ( $first ) {
|
3096 |
+
$photo_array = wppa_index_string_to_array( trim( $photos, ',' ) );
|
3097 |
$count = empty( $photo_array ) ? '0' : count( $photo_array );
|
3098 |
$list = implode( ',', $photo_array );
|
3099 |
if ( ! $list ) {
|
3114 |
$first = false;
|
3115 |
}
|
3116 |
else {
|
3117 |
+
$temp_array = wppa_index_string_to_array( trim( $photos, ',' ) );
|
3118 |
$count = empty( $temp_array ) ? '0' : count( $temp_array );
|
3119 |
$list = implode( ',', $temp_array );
|
3120 |
|
wppa-qr-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display qr code
|
6 |
-
* Version 6.
|
7 |
*/
|
8 |
|
9 |
|
@@ -102,5 +102,8 @@ class wppaQRWidget extends WP_Widget {
|
|
102 |
} // class wppaQRWidget
|
103 |
|
104 |
// register wppaQRWidget widget
|
105 |
-
add_action('widgets_init',
|
106 |
-
|
|
|
|
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display qr code
|
6 |
+
* Version 6.8.00
|
7 |
*/
|
8 |
|
9 |
|
102 |
} // class wppaQRWidget
|
103 |
|
104 |
// register wppaQRWidget widget
|
105 |
+
add_action('widgets_init', 'wppa_register_QRWidget' );
|
106 |
+
|
107 |
+
function wppa_register_QRWidget() {
|
108 |
+
register_widget( "wppaQRWidget" );
|
109 |
+
}
|
wppa-session.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
@@ -49,6 +49,9 @@ global $wppa_session;
|
|
49 |
|
50 |
// Get data if valid session exists
|
51 |
$data = $session ? $session['data'] : false;
|
|
|
|
|
|
|
52 |
|
53 |
// No valid session exists, start new
|
54 |
if ( $data === false ) {
|
@@ -80,14 +83,8 @@ global $wppa_session;
|
|
80 |
|
81 |
// Session exists, Update counter
|
82 |
else {
|
|
|
83 |
$wpdb->query( $wpdb->prepare( "UPDATE `" . WPPA_SESSION . "` SET `count` = %s WHERE `id` = %s", $session['count'] + '1', $session['id'] ) );
|
84 |
-
$data_arr = unserialize( $data );
|
85 |
-
if ( is_array( $data_arr ) ) {
|
86 |
-
$wppa_session = $data_arr;
|
87 |
-
}
|
88 |
-
else {
|
89 |
-
$wppa_session = array();
|
90 |
-
}
|
91 |
}
|
92 |
|
93 |
// Get info for root and sub search
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
49 |
|
50 |
// Get data if valid session exists
|
51 |
$data = $session ? $session['data'] : false;
|
52 |
+
if ( strlen( $data ) > 65000 ) { // data overflow, reset
|
53 |
+
$data = false;
|
54 |
+
}
|
55 |
|
56 |
// No valid session exists, start new
|
57 |
if ( $data === false ) {
|
83 |
|
84 |
// Session exists, Update counter
|
85 |
else {
|
86 |
+
$wppa_session = unserialize( $data );
|
87 |
$wpdb->query( $wpdb->prepare( "UPDATE `" . WPPA_SESSION . "` SET `count` = %s WHERE `id` = %s", $session['count'] + '1', $session['id'] ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
|
90 |
// Get info for root and sub search
|
wppa-settings-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -24,13 +24,28 @@ global $wppa_revno;
|
|
24 |
global $no_default;
|
25 |
global $wppa_tags;
|
26 |
global $wp_version;
|
|
|
27 |
|
28 |
// Start test area
|
29 |
-
//$
|
30 |
-
|
31 |
-
//
|
32 |
-
//
|
|
|
|
|
|
|
|
|
|
|
33 |
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
// End test area
|
35 |
|
36 |
// Initialize
|
@@ -7205,6 +7220,19 @@ global $wp_version;
|
|
7205 |
$tags = 'system,meta';
|
7206 |
wppa_setting(false, '7', $name, $desc, $html, $help, $clas, $tags);
|
7207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7208 |
$name = __('Remake Index Albums', 'wp-photo-album-plus');
|
7209 |
$desc = __('Remakes the index database table for albums.', 'wp-photo-album-plus');
|
7210 |
$help = '';
|
@@ -8191,8 +8219,8 @@ global $wp_version;
|
|
8191 |
$desc = __('Max albums to show in album selectionbox.', 'wp-photo-album-plus');
|
8192 |
$help = esc_js(__('If there are more albums in the system, display an input box asking for album id#', 'wp-photo-album-plus'));
|
8193 |
$slug = 'wppa_photo_admin_max_albums';
|
8194 |
-
$options = array( __('--- off ---', 'wp-photo-album-plus'), '10', '20', '50', '100', '200', '500', '1000');
|
8195 |
-
$values = array('0', '10', '20', '50', '100', '200', '500', '1000');
|
8196 |
$html = wppa_select($slug, $options, $values);
|
8197 |
$clas = '';
|
8198 |
$tags = 'system';
|
@@ -9667,7 +9695,7 @@ global $wp_version;
|
|
9667 |
$clas = '';
|
9668 |
$tags = 'system';
|
9669 |
wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags);
|
9670 |
-
|
9671 |
$name = __('Shortcode [photo nnn] on bbPress', 'wp-photo-album-plus');
|
9672 |
$desc = __('Enable the [photo] shortcode generator on bbPress frontend editors', 'wp-photo-album-plus');
|
9673 |
$help = '';
|
@@ -10050,7 +10078,41 @@ global $wp_version;
|
|
10050 |
$clas = '';
|
10051 |
$tags = 'system';
|
10052 |
wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
|
10053 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10054 |
}
|
10055 |
?>
|
10056 |
|
@@ -10144,7 +10206,7 @@ global $wp_version;
|
|
10144 |
<tr>
|
10145 |
<td><?php _e('#', 'wp-photo-album-plus') ?></td>
|
10146 |
<td><?php _e('Tag', 'wp-photo-album-plus') ?></td>
|
10147 |
-
<td
|
10148 |
<td><?php _e('Description', 'wp-photo-album-plus') ?></td>
|
10149 |
<td><?php _e('Status', 'wp-photo-album-plus') ?></td>
|
10150 |
<td><?php _e('Help', 'wp-photo-album-plus') ?></td>
|
@@ -10167,11 +10229,27 @@ global $wp_version;
|
|
10167 |
$i = '1';
|
10168 |
foreach ( $labels as $label ) {
|
10169 |
$name = $label['tag'];
|
|
|
10170 |
$desc = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10171 |
$help = '';
|
10172 |
$slug1 = 'wppa_exif_label_'.$name;
|
10173 |
$slug2 = 'wppa_exif_status_'.$name;
|
|
|
10174 |
$html1 = wppa_edit($slug1, $label['description']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10175 |
$options = array(__('Display', 'wp-photo-album-plus'), __('Hide', 'wp-photo-album-plus'), __('Optional', 'wp-photo-album-plus'));
|
10176 |
$values = array('display', 'hide', 'option');
|
10177 |
$html2 = wppa_select_e($slug2, $label['status'], $options, $values);
|
@@ -10785,7 +10863,7 @@ global $wppa_opt;
|
|
10785 |
$slug = substr( $xslug, 5 );
|
10786 |
|
10787 |
if ( ! is_array( $options ) ) {
|
10788 |
-
$html = __('There
|
10789 |
return $html;
|
10790 |
}
|
10791 |
|
@@ -10827,7 +10905,7 @@ global $wppa_opt;
|
|
10827 |
$slug = substr( $xslug, 5 );
|
10828 |
|
10829 |
if ( ! is_array( $options ) ) {
|
10830 |
-
$html = __('There
|
10831 |
return $html;
|
10832 |
}
|
10833 |
|
@@ -10846,7 +10924,8 @@ global $wppa_opt;
|
|
10846 |
$idx = 0;
|
10847 |
$cnt = count( $options );
|
10848 |
|
10849 |
-
$pages =
|
|
|
10850 |
|
10851 |
while ( $idx < $cnt ) {
|
10852 |
|
@@ -10879,7 +10958,7 @@ function wppa_select_e( $xslug, $curval, $options, $values, $onchange = '', $cla
|
|
10879 |
$slug = substr( $xslug, 5 );
|
10880 |
|
10881 |
if ( ! is_array( $options ) ) {
|
10882 |
-
$html = __('There
|
10883 |
return $html;
|
10884 |
}
|
10885 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
24 |
global $no_default;
|
25 |
global $wppa_tags;
|
26 |
global $wp_version;
|
27 |
+
global $wppa_supported_camara_brands;
|
28 |
|
29 |
// Start test area
|
30 |
+
//$photo = 254;
|
31 |
+
//$exif = exif_read_data(wppa_get_source_path($photo),'ANY_TAG',true);
|
32 |
+
//var_export($exif);
|
33 |
+
//echo '<br />';
|
34 |
+
//$t = 0x0000;
|
35 |
+
//while ( $t < 0x10000 ) {
|
36 |
+
// $n = exif_tagname( $t );
|
37 |
+
// if ( $n ) echo sprintf( '%04x: %s<br />', $t, $n );
|
38 |
+
// $t++;
|
39 |
//}
|
40 |
+
//$exif = exif_read_data(wppa_get_source_path($photo));
|
41 |
+
//var_export($exif);
|
42 |
+
//if (is_file(wppa_get_source_path( 1632 ))) {
|
43 |
+
//wppa_import_exif( 1632, wppa_get_source_path( 1632 ) );
|
44 |
+
//wppa_fix_exif_format( 1632 );
|
45 |
+
//echo 'done';
|
46 |
+
//}
|
47 |
+
//else {echo 'not found';}
|
48 |
+
|
49 |
// End test area
|
50 |
|
51 |
// Initialize
|
7220 |
$tags = 'system,meta';
|
7221 |
wppa_setting(false, '7', $name, $desc, $html, $help, $clas, $tags);
|
7222 |
|
7223 |
+
$name = __('Format exif', 'wp-photo-album-plus');
|
7224 |
+
$desc = __('Format EXIF data', 'wp-photo-album-plus');
|
7225 |
+
$help = '';
|
7226 |
+
$slug2 = 'wppa_format_exif';
|
7227 |
+
$html1 = wppa_cronjob_button( $slug2 );
|
7228 |
+
$html2 = wppa_maintenance_button( $slug2 );
|
7229 |
+
$html3 = wppa_status_field( $slug2 );
|
7230 |
+
$html4 = wppa_togo_field( $slug2 );
|
7231 |
+
$html = array($html1, $html2, $html3, $html4);
|
7232 |
+
$clas = '';
|
7233 |
+
$tags = 'system,meta';
|
7234 |
+
wppa_setting(false, '7.1', $name, $desc, $html, $help, $clas, $tags);
|
7235 |
+
|
7236 |
$name = __('Remake Index Albums', 'wp-photo-album-plus');
|
7237 |
$desc = __('Remakes the index database table for albums.', 'wp-photo-album-plus');
|
7238 |
$help = '';
|
8219 |
$desc = __('Max albums to show in album selectionbox.', 'wp-photo-album-plus');
|
8220 |
$help = esc_js(__('If there are more albums in the system, display an input box asking for album id#', 'wp-photo-album-plus'));
|
8221 |
$slug = 'wppa_photo_admin_max_albums';
|
8222 |
+
$options = array( __( '--- off ---', 'wp-photo-album-plus'), '10', '20', '50', '100', '200', '500', '1000', '2000', '3000', '4000', '5000' );
|
8223 |
+
$values = array( '0', '10', '20', '50', '100', '200', '500', '1000', '2000', '3000', '4000', '5000' );
|
8224 |
$html = wppa_select($slug, $options, $values);
|
8225 |
$clas = '';
|
8226 |
$tags = 'system';
|
9695 |
$clas = '';
|
9696 |
$tags = 'system';
|
9697 |
wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags);
|
9698 |
+
|
9699 |
$name = __('Shortcode [photo nnn] on bbPress', 'wp-photo-album-plus');
|
9700 |
$desc = __('Enable the [photo] shortcode generator on bbPress frontend editors', 'wp-photo-album-plus');
|
9701 |
$help = '';
|
10078 |
$clas = '';
|
10079 |
$tags = 'system';
|
10080 |
wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
|
10081 |
+
|
10082 |
+
$name = __('Albums', 'wp-photo-album-plus');
|
10083 |
+
$desc = __('Select album(s) for random photo', 'wp-photo-album-plus');
|
10084 |
+
$help = esc_js( __( 'The albums to be used for the selection of a random photo for shortcode: [photo random]', 'wp-photo-album-plus'));
|
10085 |
+
$slug = 'wppa_photo_shortcode_random_albums';
|
10086 |
+
if ( wppa_has_many_albums() ) {
|
10087 |
+
$html = wppa_input( $slug, '220', __('Enter album ids separated by commas','wp-photo-album-plus' ) );
|
10088 |
+
}
|
10089 |
+
else {
|
10090 |
+
$albums = $wpdb->get_results( "SELECT `id`, `name` FROM `" . WPPA_ALBUMS . "`", ARRAY_A );
|
10091 |
+
$albums = wppa_add_paths( $albums );
|
10092 |
+
$albums = wppa_array_sort( $albums, 'name' );
|
10093 |
+
$opts = array();
|
10094 |
+
$vals = array();
|
10095 |
+
$opts[] = __( '--- all ---', 'wp-photo-album-plus' );
|
10096 |
+
$vals[] = '-2';
|
10097 |
+
foreach( $albums as $album ) {
|
10098 |
+
$opts[] = $album['name'];
|
10099 |
+
$vals[] = $album['id'];
|
10100 |
+
}
|
10101 |
+
$html = wppa_select_m($slug, $opts, $vals, '', '', false, '', $max_width = '400' );
|
10102 |
+
}
|
10103 |
+
$clas = '';
|
10104 |
+
$tags = 'system';
|
10105 |
+
wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags);
|
10106 |
+
|
10107 |
+
$name = __('Select photo once', 'wp-photo-album-plus');
|
10108 |
+
$desc = __('The same random photo on every pageload', 'wp-photo-album-plus');
|
10109 |
+
$help = esc_js(__('If ticked: the random photo is determined once at page/post creation time', 'wp-photo-album-plus'));
|
10110 |
+
$help .= '\n\n'.esc_js(__('If unticked: every pageload a different photo', 'wp-photo-album-plus'));
|
10111 |
+
$slug = 'wppa_photo_shortcode_random_fixed';
|
10112 |
+
$html = wppa_checkbox($slug);
|
10113 |
+
$clas = '';
|
10114 |
+
$tags = 'system';
|
10115 |
+
wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags);
|
10116 |
}
|
10117 |
?>
|
10118 |
|
10206 |
<tr>
|
10207 |
<td><?php _e('#', 'wp-photo-album-plus') ?></td>
|
10208 |
<td><?php _e('Tag', 'wp-photo-album-plus') ?></td>
|
10209 |
+
<td><?php _e('Brand', 'wp-photo-album-plus') ?></td>
|
10210 |
<td><?php _e('Description', 'wp-photo-album-plus') ?></td>
|
10211 |
<td><?php _e('Status', 'wp-photo-album-plus') ?></td>
|
10212 |
<td><?php _e('Help', 'wp-photo-album-plus') ?></td>
|
10229 |
$i = '1';
|
10230 |
foreach ( $labels as $label ) {
|
10231 |
$name = $label['tag'];
|
10232 |
+
|
10233 |
$desc = '';
|
10234 |
+
foreach ( $wppa_supported_camara_brands as $brand ) {
|
10235 |
+
$lbl = wppa_exif_tagname( hexdec( '0x' . substr( $label['tag'], 2, 4 ) ), $brand, 'brandonly' );
|
10236 |
+
if ( $lbl ) {
|
10237 |
+
$desc .= '<br />' . $brand;
|
10238 |
+
}
|
10239 |
+
}
|
10240 |
+
|
10241 |
$help = '';
|
10242 |
$slug1 = 'wppa_exif_label_'.$name;
|
10243 |
$slug2 = 'wppa_exif_status_'.$name;
|
10244 |
+
|
10245 |
$html1 = wppa_edit($slug1, $label['description']);
|
10246 |
+
foreach ( $wppa_supported_camara_brands as $brand ) {
|
10247 |
+
$lbl = wppa_exif_tagname( hexdec( '0x' . substr( $label['tag'], 2, 4 ) ), $brand, 'brandonly' );
|
10248 |
+
if ( $lbl ) {
|
10249 |
+
$html1 .= '<br /><span style="clear:left;float:left;" >' . $lbl . ':</span>';
|
10250 |
+
}
|
10251 |
+
}
|
10252 |
+
|
10253 |
$options = array(__('Display', 'wp-photo-album-plus'), __('Hide', 'wp-photo-album-plus'), __('Optional', 'wp-photo-album-plus'));
|
10254 |
$values = array('display', 'hide', 'option');
|
10255 |
$html2 = wppa_select_e($slug2, $label['status'], $options, $values);
|
10863 |
$slug = substr( $xslug, 5 );
|
10864 |
|
10865 |
if ( ! is_array( $options ) ) {
|
10866 |
+
$html = __('There is nothing to select.', 'wp-photo-album-plus');
|
10867 |
return $html;
|
10868 |
}
|
10869 |
|
10905 |
$slug = substr( $xslug, 5 );
|
10906 |
|
10907 |
if ( ! is_array( $options ) ) {
|
10908 |
+
$html = __('There is nothing to select.', 'wp-photo-album-plus');
|
10909 |
return $html;
|
10910 |
}
|
10911 |
|
10924 |
$idx = 0;
|
10925 |
$cnt = count( $options );
|
10926 |
|
10927 |
+
$pages = wppa_expand_enum( wppa_opt( $slug ) );
|
10928 |
+
$pages = explode( '.', $pages );
|
10929 |
|
10930 |
while ( $idx < $cnt ) {
|
10931 |
|
10958 |
$slug = substr( $xslug, 5 );
|
10959 |
|
10960 |
if ( ! is_array( $options ) ) {
|
10961 |
+
$html = __('There is nothing to select.', 'wp-photo-album-plus');
|
10962 |
return $html;
|
10963 |
}
|
10964 |
|
wppa-setup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -145,7 +145,7 @@ global $silent;
|
|
145 |
) DEFAULT CHARACTER SET utf8;";
|
146 |
|
147 |
$create_iptc = "CREATE TABLE " . WPPA_IPTC . " (
|
148 |
-
id bigint(20) NOT NULL,
|
149 |
photo bigint(20) NOT NULL,
|
150 |
tag tinytext NOT NULL,
|
151 |
description text NOT NULL,
|
@@ -155,17 +155,19 @@ global $silent;
|
|
155 |
) DEFAULT CHARACTER SET utf8;";
|
156 |
|
157 |
$create_exif = "CREATE TABLE " . WPPA_EXIF . " (
|
158 |
-
id bigint(20) NOT NULL,
|
159 |
photo bigint(20) NOT NULL,
|
160 |
tag tinytext NOT NULL,
|
161 |
description text NOT NULL,
|
162 |
status tinytext NOT NULL,
|
|
|
|
|
163 |
PRIMARY KEY (id),
|
164 |
KEY photokey (photo)
|
165 |
) DEFAULT CHARACTER SET utf8;";
|
166 |
|
167 |
$create_index = "CREATE TABLE " . WPPA_INDEX . " (
|
168 |
-
id bigint(20) NOT NULL,
|
169 |
slug tinytext NOT NULL,
|
170 |
albums text NOT NULL,
|
171 |
photos text NOT NULL,
|
@@ -550,6 +552,17 @@ global $silent;
|
|
550 |
update_option( 'wppa_upload_edit', '-none-' );
|
551 |
}
|
552 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
553 |
}
|
554 |
|
555 |
// Set Defaults
|
@@ -1475,6 +1488,7 @@ Hide Camera info
|
|
1475 |
'wppa_rerate' => '',
|
1476 |
'wppa_cleanup' => '',
|
1477 |
'wppa_recup' => '',
|
|
|
1478 |
'wppa_file_system' => 'flat',
|
1479 |
'wppa_remake' => '',
|
1480 |
'wppa_remake_orientation_only' => 'no',
|
@@ -1750,7 +1764,9 @@ Hide Camera info
|
|
1750 |
'wppa_photo_shortcode_type' => 'mphoto',
|
1751 |
'wppa_photo_shortcode_size' => '350',
|
1752 |
'wppa_photo_shortcode_align' => 'center',
|
1753 |
-
'wppa_photo_shortcode_fe_type' => '-none-',
|
|
|
|
|
1754 |
|
1755 |
// Photo of the day widget
|
1756 |
'wppa_potd_title' => __('Photo of the day', 'wp-photo-album-plus'),
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
145 |
) DEFAULT CHARACTER SET utf8;";
|
146 |
|
147 |
$create_iptc = "CREATE TABLE " . WPPA_IPTC . " (
|
148 |
+
id bigint(20) NOT NULL AUTO_INCREMENT,
|
149 |
photo bigint(20) NOT NULL,
|
150 |
tag tinytext NOT NULL,
|
151 |
description text NOT NULL,
|
155 |
) DEFAULT CHARACTER SET utf8;";
|
156 |
|
157 |
$create_exif = "CREATE TABLE " . WPPA_EXIF . " (
|
158 |
+
id bigint(20) NOT NULL AUTO_INCREMENT,
|
159 |
photo bigint(20) NOT NULL,
|
160 |
tag tinytext NOT NULL,
|
161 |
description text NOT NULL,
|
162 |
status tinytext NOT NULL,
|
163 |
+
f_description text NOT NULL,
|
164 |
+
brand tinytext NOT NULL,
|
165 |
PRIMARY KEY (id),
|
166 |
KEY photokey (photo)
|
167 |
) DEFAULT CHARACTER SET utf8;";
|
168 |
|
169 |
$create_index = "CREATE TABLE " . WPPA_INDEX . " (
|
170 |
+
id bigint(20) NOT NULL AUTO_INCREMENT,
|
171 |
slug tinytext NOT NULL,
|
172 |
albums text NOT NULL,
|
173 |
photos text NOT NULL,
|
552 |
update_option( 'wppa_upload_edit', '-none-' );
|
553 |
}
|
554 |
}
|
555 |
+
|
556 |
+
if ( $old_rev <= '6800' ) {
|
557 |
+
$wpdb->query( "ALTER TABLE `" . WPPA_IPTC . "` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT" );
|
558 |
+
$wpdb->query( "ALTER TABLE `" . WPPA_EXIF . "` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT" );
|
559 |
+
$wpdb->query( "ALTER TABLE `" . WPPA_INDEX . "` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT" );
|
560 |
+
delete_option( 'wppa_' . WPPA_IPTC . '_lastkey' );
|
561 |
+
delete_option( 'wppa_' . WPPA_EXIF . '_lastkey' );
|
562 |
+
delete_option( 'wppa_' . WPPA_INDEX . '_lastkey' );
|
563 |
+
|
564 |
+
wppa_schedule_maintenance_proc( 'wppa_format_exif' );
|
565 |
+
}
|
566 |
}
|
567 |
|
568 |
// Set Defaults
|
1488 |
'wppa_rerate' => '',
|
1489 |
'wppa_cleanup' => '',
|
1490 |
'wppa_recup' => '',
|
1491 |
+
'wppa_format_exif' => '',
|
1492 |
'wppa_file_system' => 'flat',
|
1493 |
'wppa_remake' => '',
|
1494 |
'wppa_remake_orientation_only' => 'no',
|
1764 |
'wppa_photo_shortcode_type' => 'mphoto',
|
1765 |
'wppa_photo_shortcode_size' => '350',
|
1766 |
'wppa_photo_shortcode_align' => 'center',
|
1767 |
+
'wppa_photo_shortcode_fe_type' => '-none-',
|
1768 |
+
'wppa_photo_shortcode_random_albums' => '-2',
|
1769 |
+
'wppa_photo_shortcode_random_fixed' => 'no',
|
1770 |
|
1771 |
// Photo of the day widget
|
1772 |
'wppa_potd_title' => __('Photo of the day', 'wp-photo-album-plus'),
|
wppa-tinymce-photo-front.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-tinymce-photo-front.php
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
-
* Version 6.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -52,6 +52,9 @@ global $wpdb;
|
|
52 |
// Find an existing photo
|
53 |
$id = $wpdb->get_var( "SELECT `id` FROM " . WPPA_PHOTOS . " WHERE `ext` <> 'xxx' ORDER BY `timestamp` DESC LIMIT 1" );
|
54 |
|
|
|
|
|
|
|
55 |
// Things that wppa-tinymce.js AND OTHER MODULES!!! need to know
|
56 |
echo
|
57 |
'<script type="text/javascript">
|
@@ -69,6 +72,9 @@ global $wpdb;
|
|
69 |
/* ]]> */
|
70 |
</script>';
|
71 |
|
|
|
|
|
|
|
72 |
$done = true;
|
73 |
|
74 |
}
|
2 |
/* wppa-tinymce-photo-front.php
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
+
* Version 6.8.00
|
6 |
*
|
7 |
*/
|
8 |
|
52 |
// Find an existing photo
|
53 |
$id = $wpdb->get_var( "SELECT `id` FROM " . WPPA_PHOTOS . " WHERE `ext` <> 'xxx' ORDER BY `timestamp` DESC LIMIT 1" );
|
54 |
|
55 |
+
// Fake we are in a widget, to prevent wppa_get_picture_html() from bumping viewcount
|
56 |
+
wppa( 'in_widget', true );
|
57 |
+
|
58 |
// Things that wppa-tinymce.js AND OTHER MODULES!!! need to know
|
59 |
echo
|
60 |
'<script type="text/javascript">
|
72 |
/* ]]> */
|
73 |
</script>';
|
74 |
|
75 |
+
// Reset faked widget
|
76 |
+
wppa( 'in_widget', false );
|
77 |
+
|
78 |
$done = true;
|
79 |
|
80 |
}
|
wppa-tinymce-shortcodes.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
*
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -495,7 +495,7 @@ global $wpdb;
|
|
495 |
}
|
496 |
|
497 |
if ( wppa_has_audio( $photo['id'] ) && is_file( WPPA_UPLOAD_PATH . '/' . wppa_fix_poster_ext( $val, $photo['id'] ) ) ) {
|
498 |
-
$value = wppa_fix_poster_ext( $val );
|
499 |
}
|
500 |
else {
|
501 |
$value = $val;
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
*
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
495 |
}
|
496 |
|
497 |
if ( wppa_has_audio( $photo['id'] ) && is_file( WPPA_UPLOAD_PATH . '/' . wppa_fix_poster_ext( $val, $photo['id'] ) ) ) {
|
498 |
+
$value = wppa_fix_poster_ext( $val, $photo['id'] );
|
499 |
}
|
500 |
else {
|
501 |
$value = $val;
|
wppa-upload.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the upload pages and functions
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -82,7 +82,7 @@ global $upload_album;
|
|
82 |
document.location = '<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit_id=' . $upload_album . '&wppa_nonce=' . wp_create_nonce( 'wppa_nonce', 'wppa_nonce' ), 'js' ) ) ?>';
|
83 |
</script>
|
84 |
<?php }
|
85 |
-
elseif ( wppa_opt( 'upload_edit' ) != 'none' ) {
|
86 |
wppa_ok_message( __( 'Connecting to edit photos...' , 'wp-photo-album-plus' ) ); ?>
|
87 |
<script type="text/javascript">document.location = '<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_edit_photo', 'js' ) ) ?>';</script>
|
88 |
<?php }
|
@@ -99,7 +99,7 @@ global $upload_album;
|
|
99 |
document.location = '<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit_id=' . $upload_album . '&wppa_nonce=' . wp_create_nonce( 'wppa_nonce', 'wppa_nonce' ), 'js' ) ) ?>';
|
100 |
</script>
|
101 |
<?php }
|
102 |
-
elseif ( wppa_opt( 'upload_edit' ) != 'none' ) {
|
103 |
wppa_ok_message( __( 'Connecting to edit photos...' , 'wp-photo-album-plus' ) ); ?>
|
104 |
<script type="text/javascript">document.location = '<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_edit_photo', 'js' ) ) ?>';</script>
|
105 |
<?php }
|
@@ -186,9 +186,16 @@ global $upload_album;
|
|
186 |
'<label for="wppa-album">' .
|
187 |
__( 'Album:' , 'wp-photo-album-plus') .
|
188 |
'</label>' .
|
189 |
-
|
190 |
-
|
191 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
'</p>';
|
193 |
if ( wppa_switch( 'watermark_on' ) && ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) ) {
|
194 |
echo
|
@@ -328,9 +335,16 @@ global $upload_album;
|
|
328 |
'</script>' .
|
329 |
'<p>' .
|
330 |
'<label for="wppa-album">' . __( 'Album:' , 'wp-photo-album-plus' ) . '</label>' .
|
331 |
-
|
332 |
-
|
333 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
334 |
'</p>';
|
335 |
|
336 |
// Watermark?
|
@@ -405,9 +419,16 @@ global $upload_album;
|
|
405 |
'</div>' .
|
406 |
'<p>' .
|
407 |
'<label for="wppa-album">' . __( 'Album:' , 'wp-photo-album-plus') . '</label>' .
|
408 |
-
|
409 |
-
|
410 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
411 |
'</p>';
|
412 |
|
413 |
// Watermark?
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the upload pages and functions
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
82 |
document.location = '<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit_id=' . $upload_album . '&wppa_nonce=' . wp_create_nonce( 'wppa_nonce', 'wppa_nonce' ), 'js' ) ) ?>';
|
83 |
</script>
|
84 |
<?php }
|
85 |
+
elseif ( wppa_opt( 'upload_edit' ) != '-none-' ) {
|
86 |
wppa_ok_message( __( 'Connecting to edit photos...' , 'wp-photo-album-plus' ) ); ?>
|
87 |
<script type="text/javascript">document.location = '<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_edit_photo', 'js' ) ) ?>';</script>
|
88 |
<?php }
|
99 |
document.location = '<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit_id=' . $upload_album . '&wppa_nonce=' . wp_create_nonce( 'wppa_nonce', 'wppa_nonce' ), 'js' ) ) ?>';
|
100 |
</script>
|
101 |
<?php }
|
102 |
+
elseif ( wppa_opt( 'upload_edit' ) != '-none-' ) {
|
103 |
wppa_ok_message( __( 'Connecting to edit photos...' , 'wp-photo-album-plus' ) ); ?>
|
104 |
<script type="text/javascript">document.location = '<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_edit_photo', 'js' ) ) ?>';</script>
|
105 |
<?php }
|
186 |
'<label for="wppa-album">' .
|
187 |
__( 'Album:' , 'wp-photo-album-plus') .
|
188 |
'</label>' .
|
189 |
+
wppa_album_select_a( array( 'path' => wppa_switch( 'hier_albsel' ),
|
190 |
+
'addpleaseselect' => true,
|
191 |
+
'checkowner' => true,
|
192 |
+
'checkupload' => true,
|
193 |
+
'sort' => true,
|
194 |
+
'tagopen' => '<select name="wppa-album" id="wppa-album-s" style="max-width:100%;" >',
|
195 |
+
'tagid' => 'wppa-album-s',
|
196 |
+
'tagname' => 'wppa-album',
|
197 |
+
'tagstyle' => 'max-width:100%;',
|
198 |
+
) ) .
|
199 |
'</p>';
|
200 |
if ( wppa_switch( 'watermark_on' ) && ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) ) {
|
201 |
echo
|
335 |
'</script>' .
|
336 |
'<p>' .
|
337 |
'<label for="wppa-album">' . __( 'Album:' , 'wp-photo-album-plus' ) . '</label>' .
|
338 |
+
wppa_album_select_a( array( 'path' => wppa_switch( 'hier_albsel' ),
|
339 |
+
'addpleaseselect' => true,
|
340 |
+
'checkowner' => true,
|
341 |
+
'checkupload' => true,
|
342 |
+
'sort' => true,
|
343 |
+
'tagopen' => '<select name="wppa-album" id="wppa-album-s" style="max-width:100%;" >',
|
344 |
+
'tagid' => 'wppa-album-s',
|
345 |
+
'tagname' => 'wppa-album',
|
346 |
+
'tagstyle' => 'max-width:100%;',
|
347 |
+
) ) .
|
348 |
'</p>';
|
349 |
|
350 |
// Watermark?
|
419 |
'</div>' .
|
420 |
'<p>' .
|
421 |
'<label for="wppa-album">' . __( 'Album:' , 'wp-photo-album-plus') . '</label>' .
|
422 |
+
wppa_album_select_a( array( 'path' => wppa_switch( 'hier_albsel' ),
|
423 |
+
'addpleaseselect' => true,
|
424 |
+
'checkowner' => true,
|
425 |
+
'checkupload' => true,
|
426 |
+
'sort' => true,
|
427 |
+
'tagopen' => '<select name="wppa-album" id="wppa-album-m" style="max-width:100%;" >',
|
428 |
+
'tagid' => 'wppa-album-m',
|
429 |
+
'tagname' => 'wppa-album',
|
430 |
+
'tagstyle' => 'max-width:100%;',
|
431 |
+
) ) .
|
432 |
'</p>';
|
433 |
|
434 |
// Watermark?
|
wppa-users.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains user and capabilities related routines
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -48,7 +48,7 @@ static $usercache;
|
|
48 |
// wppa_log( 'Obs', 'wppa_get_user_by cache used for ' . $key . ', ' . $user );
|
49 |
return $usercache[$key][$user];
|
50 |
}
|
51 |
-
|
52 |
$result = get_user_by( $key, $user );
|
53 |
$usercache[$key][$user] = $result;
|
54 |
// wppa_log( 'Obs', 'wppa_get_user_by new cache entry for ' . $key . ', ' . $user );
|
@@ -277,7 +277,7 @@ function wppa_is_user_superuser() {
|
|
277 |
function wppa_may_user_fe_edit( $id ) {
|
278 |
|
279 |
// Feature enabled?
|
280 |
-
if ( wppa_opt( 'upload_edit' ) == 'none' ) return false;
|
281 |
|
282 |
// Blacklisted?
|
283 |
if ( wppa_is_user_blacklisted() ) return false;
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains user and capabilities related routines
|
6 |
+
* Version 6.8.0
|
7 |
*
|
8 |
*/
|
9 |
|
48 |
// wppa_log( 'Obs', 'wppa_get_user_by cache used for ' . $key . ', ' . $user );
|
49 |
return $usercache[$key][$user];
|
50 |
}
|
51 |
+
|
52 |
$result = get_user_by( $key, $user );
|
53 |
$usercache[$key][$user] = $result;
|
54 |
// wppa_log( 'Obs', 'wppa_get_user_by new cache entry for ' . $key . ', ' . $user );
|
277 |
function wppa_may_user_fe_edit( $id ) {
|
278 |
|
279 |
// Feature enabled?
|
280 |
+
if ( wppa_opt( 'upload_edit' ) == '-none-' ) return false;
|
281 |
|
282 |
// Blacklisted?
|
283 |
if ( wppa_is_user_blacklisted() ) return false;
|
wppa-utils.php
CHANGED
@@ -4145,4 +4145,8 @@ function wppa_parse_args( $args, $defaults ) {
|
|
4145 |
}
|
4146 |
|
4147 |
return $r;
|
|
|
|
|
|
|
|
|
4148 |
}
|
4145 |
}
|
4146 |
|
4147 |
return $r;
|
4148 |
+
}
|
4149 |
+
|
4150 |
+
function wppa_is_divisible( $t, $n ) {
|
4151 |
+
return ( round( $t / $n ) == ( $t / $n ) );
|
4152 |
}
|
wppa-wpdb-insert.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level wpdb routines that add new records
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -61,29 +61,28 @@ function wppa_create_index_entry( $args ) {
|
|
61 |
global $wpdb;
|
62 |
|
63 |
$args = wp_parse_args( (array) $args, array (
|
64 |
-
|
65 |
'slug' => '',
|
66 |
'albums' => '',
|
67 |
'photos' => ''
|
68 |
) );
|
69 |
|
70 |
-
|
71 |
|
72 |
-
$query = $wpdb->prepare("INSERT INTO `" . WPPA_INDEX . "` (
|
73 |
`slug`,
|
74 |
`albums`,
|
75 |
`photos`
|
76 |
)
|
77 |
-
VALUES ( %s, %s, %s
|
78 |
-
|
79 |
$args['slug'],
|
80 |
$args['albums'],
|
81 |
$args['photos']
|
82 |
);
|
83 |
-
$
|
84 |
|
85 |
-
|
86 |
-
else return false;
|
87 |
}
|
88 |
|
89 |
// EXIF
|
@@ -91,35 +90,40 @@ function wppa_create_exif_entry( $args ) {
|
|
91 |
global $wpdb;
|
92 |
|
93 |
$args = wp_parse_args( (array) $args, array (
|
94 |
-
|
95 |
'photo' => '0',
|
96 |
'tag' => '',
|
97 |
'description' => '',
|
98 |
-
'
|
|
|
|
|
99 |
) );
|
100 |
|
101 |
-
|
102 |
|
103 |
$args['description'] = sanitize_text_field( $args['description'] );
|
104 |
$args['description'] = str_replace( array(chr(0),chr(1),chr(2),chr(3),chr(4),chr(5),chr(6),chr(7)), '', $args['description'] );
|
105 |
|
106 |
-
$query = $wpdb->prepare("INSERT INTO `" . WPPA_EXIF . "` (
|
107 |
`photo`,
|
108 |
`tag`,
|
109 |
`description`,
|
110 |
-
`
|
|
|
|
|
111 |
)
|
112 |
-
VALUES ( %s, %s, %s, %s, %s )",
|
113 |
-
|
114 |
$args['photo'],
|
115 |
$args['tag'],
|
116 |
$args['description'],
|
117 |
-
$args['
|
|
|
|
|
118 |
);
|
119 |
-
$
|
120 |
|
121 |
-
|
122 |
-
else return false;
|
123 |
}
|
124 |
|
125 |
// IPTC
|
@@ -127,35 +131,34 @@ function wppa_create_iptc_entry( $args ) {
|
|
127 |
global $wpdb;
|
128 |
|
129 |
$args = wp_parse_args( (array) $args, array (
|
130 |
-
|
131 |
'photo' => '0',
|
132 |
'tag' => '',
|
133 |
'description' => '',
|
134 |
'status' => ''
|
135 |
) );
|
136 |
|
137 |
-
|
138 |
|
139 |
$args['description'] = sanitize_text_field( $args['description'] );
|
140 |
$args['description'] = str_replace( array(chr(0),chr(1),chr(2),chr(3),chr(4),chr(5),chr(6),chr(7)), '', $args['description'] );
|
141 |
|
142 |
-
$query = $wpdb->prepare("INSERT INTO `" . WPPA_IPTC . "` (
|
143 |
`photo`,
|
144 |
`tag`,
|
145 |
`description`,
|
146 |
`status`
|
147 |
)
|
148 |
-
VALUES ( %s, %s, %s, %s
|
149 |
-
|
150 |
$args['photo'],
|
151 |
$args['tag'],
|
152 |
$args['description'],
|
153 |
$args['status']
|
154 |
);
|
155 |
-
$
|
156 |
|
157 |
-
|
158 |
-
else return false;
|
159 |
}
|
160 |
|
161 |
// Comments
|
@@ -499,4 +502,5 @@ global $wpdb;
|
|
499 |
$exists = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM `$table` WHERE `id` = %s", $id ), ARRAY_A );
|
500 |
if ( $exists ) return false;
|
501 |
return true;
|
502 |
-
}
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level wpdb routines that add new records
|
6 |
+
* Version 6.8.00
|
7 |
*
|
8 |
*/
|
9 |
|
61 |
global $wpdb;
|
62 |
|
63 |
$args = wp_parse_args( (array) $args, array (
|
64 |
+
|
65 |
'slug' => '',
|
66 |
'albums' => '',
|
67 |
'photos' => ''
|
68 |
) );
|
69 |
|
70 |
+
// WPPA_INDEX is now AUTO_INCREMENT
|
71 |
|
72 |
+
$query = $wpdb->prepare("INSERT INTO `" . WPPA_INDEX . "` (
|
73 |
`slug`,
|
74 |
`albums`,
|
75 |
`photos`
|
76 |
)
|
77 |
+
VALUES ( %s, %s, %s )",
|
78 |
+
|
79 |
$args['slug'],
|
80 |
$args['albums'],
|
81 |
$args['photos']
|
82 |
);
|
83 |
+
$bret = $wpdb->query($query);
|
84 |
|
85 |
+
return $bret;
|
|
|
86 |
}
|
87 |
|
88 |
// EXIF
|
90 |
global $wpdb;
|
91 |
|
92 |
$args = wp_parse_args( (array) $args, array (
|
93 |
+
|
94 |
'photo' => '0',
|
95 |
'tag' => '',
|
96 |
'description' => '',
|
97 |
+
'f_description' => '',
|
98 |
+
'status' => '',
|
99 |
+
'brand' => '',
|
100 |
) );
|
101 |
|
102 |
+
// WPPA_EXIF is now AUTO_INCREMENT
|
103 |
|
104 |
$args['description'] = sanitize_text_field( $args['description'] );
|
105 |
$args['description'] = str_replace( array(chr(0),chr(1),chr(2),chr(3),chr(4),chr(5),chr(6),chr(7)), '', $args['description'] );
|
106 |
|
107 |
+
$query = $wpdb->prepare("INSERT INTO `" . WPPA_EXIF . "` (
|
108 |
`photo`,
|
109 |
`tag`,
|
110 |
`description`,
|
111 |
+
`f_description`,
|
112 |
+
`status`,
|
113 |
+
`brand`
|
114 |
)
|
115 |
+
VALUES ( %s, %s, %s, %s, %s, %s )",
|
116 |
+
|
117 |
$args['photo'],
|
118 |
$args['tag'],
|
119 |
$args['description'],
|
120 |
+
$args['f_description'],
|
121 |
+
$args['status'],
|
122 |
+
$args['brand']
|
123 |
);
|
124 |
+
$bret = $wpdb->query($query);
|
125 |
|
126 |
+
return $bret;
|
|
|
127 |
}
|
128 |
|
129 |
// IPTC
|
131 |
global $wpdb;
|
132 |
|
133 |
$args = wp_parse_args( (array) $args, array (
|
134 |
+
|
135 |
'photo' => '0',
|
136 |
'tag' => '',
|
137 |
'description' => '',
|
138 |
'status' => ''
|
139 |
) );
|
140 |
|
141 |
+
// WPPA_IPTC is now AUTO_INCREMENT
|
142 |
|
143 |
$args['description'] = sanitize_text_field( $args['description'] );
|
144 |
$args['description'] = str_replace( array(chr(0),chr(1),chr(2),chr(3),chr(4),chr(5),chr(6),chr(7)), '', $args['description'] );
|
145 |
|
146 |
+
$query = $wpdb->prepare("INSERT INTO `" . WPPA_IPTC . "` (
|
147 |
`photo`,
|
148 |
`tag`,
|
149 |
`description`,
|
150 |
`status`
|
151 |
)
|
152 |
+
VALUES ( %s, %s, %s, %s )",
|
153 |
+
|
154 |
$args['photo'],
|
155 |
$args['tag'],
|
156 |
$args['description'],
|
157 |
$args['status']
|
158 |
);
|
159 |
+
$bret = $wpdb->query($query);
|
160 |
|
161 |
+
return $bret;
|
|
|
162 |
}
|
163 |
|
164 |
// Comments
|
502 |
$exists = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM `$table` WHERE `id` = %s", $id ), ARRAY_A );
|
503 |
if ( $exists ) return false;
|
504 |
return true;
|
505 |
+
}
|
506 |
+
|
wppa.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
-
* Version: 6.
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|
@@ -22,8 +22,8 @@ global $wpdb;
|
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
-
global $wppa_revno; $wppa_revno = '
|
26 |
-
global $wppa_api_version; $wppa_api_version = '6-
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
+
* Version: 6.8.00
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
+
global $wppa_revno; $wppa_revno = '6800'; // WPPA db version
|
26 |
+
global $wppa_api_version; $wppa_api_version = '6-8-00-012'; // WPPA software version
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|