Overview

Packages

  • admin
  • classes
    • media
  • CodeIgniter
    • Libraries
  • core
  • functions
  • JSMin
  • None
  • OpenID
  • PHP
  • PHPMailer
  • plugins
    • admin
    • development
    • feed
    • mail
    • media
    • misc
    • seo
    • spam
    • uploader
    • users
    • zenpage
    • zenphoto
      • news
  • Services
    • JSON

Classes

  • _zp_captcha
  • _zp_HTML_cache
  • admin_approval
  • Album
  • AlbumBase
  • AlbumZip
  • AMFReader
  • AMFStream
  • AnyFile
  • AnyFile_Options
  • Auth_OpenID
  • Auth_OpenID_AlreadySigned
  • Auth_OpenID_AssociateRequest
  • Auth_OpenID_Association
  • Auth_OpenID_AuthRequest
  • Auth_OpenID_AX
  • Auth_OpenID_AX_AttrInfo
  • Auth_OpenID_AX_Error
  • Auth_OpenID_AX_FetchRequest
  • Auth_OpenID_AX_FetchResponse
  • Auth_OpenID_AX_KeyValueMessage
  • Auth_OpenID_AX_Message
  • Auth_OpenID_AX_StoreRequest
  • Auth_OpenID_AX_StoreResponse
  • Auth_OpenID_BcMathWrapper
  • Auth_OpenID_CancelResponse
  • Auth_OpenID_CheckAuthRequest
  • Auth_OpenID_CheckIDRequest
  • Auth_OpenID_Consumer
  • Auth_OpenID_ConsumerResponse
  • Auth_OpenID_CryptUtil
  • Auth_OpenID_DatabaseConnection
  • Auth_OpenID_Decoder
  • Auth_OpenID_DiffieHellman
  • Auth_OpenID_DiffieHellmanSHA1ConsumerSession
  • Auth_OpenID_DiffieHellmanSHA1ServerSession
  • Auth_OpenID_DiffieHellmanSHA256ConsumerSession
  • Auth_OpenID_DiffieHellmanSHA256ServerSession
  • Auth_OpenID_DumbStore
  • Auth_OpenID_Encoder
  • Auth_OpenID_EncodingError
  • Auth_OpenID_Extension
  • Auth_OpenID_FailureResponse
  • Auth_OpenID_FileStore
  • Auth_OpenID_GenericConsumer
  • Auth_OpenID_GmpMathWrapper
  • Auth_OpenID_KVForm
  • Auth_OpenID_MalformedReturnURL
  • Auth_OpenID_MalformedTrustRoot
  • Auth_OpenID_Mapping
  • Auth_OpenID_MathLibrary
  • Auth_OpenID_MDB2Store
  • Auth_OpenID_MemcachedStore
  • Auth_OpenID_Message
  • Auth_OpenID_MySQLStore
  • Auth_OpenID_NamespaceMap
  • Auth_OpenID_NoReturnToError
  • Auth_OpenID_OpenIDStore
  • Auth_OpenID_PAPE_Request
  • Auth_OpenID_PAPE_Response
  • Auth_OpenID_Parse
  • Auth_OpenID_PlainTextConsumerSession
  • Auth_OpenID_PlainTextServerSession
  • Auth_OpenID_PostgreSQLStore
  • Auth_OpenID_Request
  • Auth_OpenID_Server
  • Auth_OpenID_ServerError
  • Auth_OpenID_ServerErrorContainer
  • Auth_OpenID_ServerRequest
  • Auth_OpenID_ServerResponse
  • Auth_OpenID_ServiceEndpoint
  • Auth_OpenID_ServiceEndpointLoader
  • Auth_OpenID_SessionNegotiator
  • Auth_OpenID_SetupNeededResponse
  • Auth_OpenID_Signatory
  • Auth_OpenID_SigningEncoder
  • Auth_OpenID_SQLiteStore
  • Auth_OpenID_SQLStore
  • Auth_OpenID_SRegBase
  • Auth_OpenID_SRegRequest
  • Auth_OpenID_SRegResponse
  • Auth_OpenID_SuccessResponse
  • Auth_OpenID_TrustRoot
  • Auth_OpenID_TypeURIMismatch
  • Auth_OpenID_UntrustedReturnURL
  • Auth_OpenID_WebResponse
  • Auth_Yadis_Discovery
  • Auth_Yadis_DiscoveryResult
  • Auth_Yadis_dom
  • Auth_Yadis_domxml
  • Auth_Yadis_HTTPFetcher
  • Auth_Yadis_HTTPResponse
  • Auth_Yadis_Manager
  • Auth_Yadis_ManagerLoader
  • Auth_Yadis_ParanoidHTTPFetcher
  • Auth_Yadis_ParseHTML
  • Auth_Yadis_PHPSession
  • Auth_Yadis_PlainHTTPFetcher
  • Auth_Yadis_ProxyResolver
  • Auth_Yadis_Service
  • Auth_Yadis_SessionLoader
  • Auth_Yadis_XMLParser
  • Auth_Yadis_XRDS
  • Auth_Yadis_Yadis
  • auto_backup
  • AVCSequenceParameterSetReader
  • bxslider
  • cacheManager
  • cacheManagerFeed
  • CI_jsmin
  • CI_load
  • cloneZenphoto
  • codeIgniter_kludge
  • colorbox
  • Comment
  • comment_form
  • contactformOptions
  • crop_image
  • cycle
  • defaultCodeblocks
  • deprecated_functions
  • DownloadList
  • dynamic_locale
  • dynamicAlbum
  • elFinder_options
  • email_new_user
  • exampleMacros
  • external_auth
  • ExternalFeed
  • externalFeed_options
  • favorites
  • favoritesOptions
  • federated_logon
  • feed
  • fieldExtender
  • flag_thumbnail
  • Gallery
  • galleryArticles
  • getID3
  • getid3_aac
  • getid3_apetag
  • getid3_flv
  • getid3_handler
  • getid3_id3v1
  • getid3_id3v2
  • getid3_lib
  • getid3_lyrics3
  • getid3_mp3
  • getid3_mpeg
  • getid3_quicktime
  • getid3_swf
  • GoogleMap
  • Googlemaps
  • googleVerifyOptions
  • hitcounter
  • HTML
  • htmlmetatags
  • http_auth
  • Image
  • image_effects
  • internal_deprecations
  • ipBlocker
  • jcarousel
  • jPlayer
  • jplayer_options
  • jquery_rating
  • JSMin
  • lib_GD_Options
  • lib_Imagick_Options
  • lib_NoGraphics
  • MediaObject
  • menu_manager
  • MergedRSS
  • MergedRSSOptions
  • mobile
  • Mobile_Detect
  • mobileTheme
  • multipleLayoutOptions
  • null_seo
  • OAuthConsumer
  • OAuthDataStore
  • OAuthRequest
  • OAuthServer
  • OAuthSignatureMethod
  • OAuthSignatureMethod_HMAC_SHA1
  • OAuthSignatureMethod_PLAINTEXT
  • OAuthSignatureMethod_RSA_SHA1
  • OAuthToken
  • OAuthUtil
  • pagedThumbsNav
  • pagedthumbsOptions
  • PclZip
  • PersistentObject
  • PHPMailer
  • PlainText
  • POP3
  • print_album_menu
  • pseudoPlayer
  • publishContent
  • quota_manager
  • reCaptcha
  • ReCaptchaResponse
  • register_user
  • rewriteRules
  • rewriteTokens
  • RSS
  • RSS_internal_deprecations
  • rss_options
  • search_statistics
  • SearchEngine
  • security_logger
  • seo_locale
  • Services_JSON
  • Services_JSON_Error
  • setupexternalFeed
  • setupRSS
  • show_not_loggedin
  • sitemap
  • slideshow
  • SMTP
  • static_html_cache
  • tagsuggest
  • TextObject
  • TextObject_internal_deprecations
  • TextObject_Options
  • ThemeObject
  • themeSwitcher
  • tinymce4Options
  • tinyURL
  • Transientimage
  • tweet
  • TwitterOAuth
  • UploadHandler
  • user_expiry
  • user_groups
  • user_logout_options
  • userAddressFields
  • utf8
  • Video
  • Video_internal_deprecations
  • VideoObject_Options
  • viewer_size_image_options
  • WEBdocs
  • WEBdocs_Options
  • xmpMetadata
  • Zenpage
  • Zenpage_internal_deprecations
  • ZenpageCategory
  • zenpagecms
  • ZenpageItems
  • ZenpageNews
  • ZenpagePage
  • ZenpageRoot
  • Zenphoto_Administrator
  • Zenphoto_Authority
  • zenphoto_org_news
  • zenphoto_seo
  • zenphotoDonate
  • ZipStream
  • zp_PHPMailer
  • zpCaptcha
  • zpFunctions
  • zpLegacySpam
  • zpMutex
  • zpSimpleSpam
  • zpTrivialSpam

Exceptions

  • BadFunctionCallException
  • BadMethodCallException
  • Exception
  • getid3_exception
  • JSMin_UnterminatedCommentException
  • JSMin_UnterminatedRegExpException
  • JSMin_UnterminatedStringException
  • LogicException
  • OAuthExcept
  • phpmailerException

Functions

  • __autoload
  • _escape_xref
  • _recaptcha_aes_encrypt
  • _recaptcha_aes_pad
  • _recaptcha_http_post
  • _recaptcha_mailhide_email_parts
  • _recaptcha_mailhide_urlbase64
  • _recaptcha_qsencode
  • accessAllAlbums
  • add_context
  • addalbumsToDatabase
  • addCategoriesToDatabase
  • addGeoCoord
  • addItem
  • addPagesToDatabase
  • addPluginScript
  • addPluginType
  • addSubalbumMenus
  • admin_album_list
  • admin_securityChecks
  • admin_showupdate
  • adminPageNav
  • adminToolbox
  • albumNumber
  • applyMacros
  • Auth_OpenID_arrangeByType
  • Auth_OpenID_AX_checkAlias
  • Auth_OpenID_AX_toTypeURIs
  • Auth_OpenID_bestMatchingService
  • Auth_OpenID_checkFieldName
  • Auth_OpenID_checkSessionType
  • Auth_OpenID_checkTimestamp
  • Auth_OpenID_detectMathLibrary
  • Auth_OpenID_discover
  • Auth_OpenID_discoverURI
  • Auth_OpenID_discoverWithoutYadis
  • Auth_OpenID_discoverWithYadis
  • Auth_OpenID_discoverXRI
  • Auth_OpenID_extractReturnURL
  • Auth_OpenID_findOPLocalIdentifier
  • Auth_OpenID_getAllAssociationTypes
  • Auth_OpenID_getAllowedReturnURLs
  • Auth_OpenID_getAuthorityPattern
  • Auth_OpenID_getAvailableSessionTypes
  • Auth_OpenID_getDefaultAssociationOrder
  • Auth_OpenID_getDefaultGen
  • Auth_OpenID_getDefaultMod
  • Auth_OpenID_getDefaultNegotiator
  • Auth_OpenID_getEncodedPattern
  • Auth_OpenID_getEncryptedNegotiator
  • Auth_OpenID_getEscapeRE
  • Auth_OpenID_getMathLib
  • Auth_OpenID_getOnlyEncryptedOrder
  • Auth_OpenID_getOpenIDConsumerTypeURIs
  • Auth_OpenID_getOpenIDTypeName
  • Auth_OpenID_getOpenIDTypeURIs
  • Auth_OpenID_getOPOrUserServices
  • Auth_OpenID_getSecretSize
  • Auth_OpenID_getSessionTypes
  • Auth_OpenID_getSupportedAssociationTypes
  • Auth_OpenID_getUnreserved
  • Auth_OpenID_getURIPattern
  • Auth_OpenID_getURLIllegalCharRE
  • Auth_OpenID_HMACSHA1
  • Auth_OpenID_HMACSHA256
  • Auth_OpenID_include_init
  • Auth_OpenID_isError
  • Auth_OpenID_isOpenID1
  • Auth_OpenID_legacy_discover
  • Auth_OpenID_makeOpenIDEndpoints
  • Auth_OpenID_math_extensions
  • Auth_OpenID_mkNonce
  • Auth_OpenID_noMathSupport
  • Auth_OpenID_pct_encoded_replace
  • Auth_OpenID_pct_encoded_replace_unreserved
  • Auth_OpenID_registerNamespaceAlias
  • Auth_OpenID_remove_dot_segments
  • Auth_OpenID_removeNamespaceAlias
  • Auth_OpenID_returnToMatches
  • Auth_OpenID_setNoMathSupport
  • Auth_OpenID_SHA1
  • Auth_OpenID_SHA256
  • Auth_OpenID_splitNonce
  • Auth_OpenID_supportsSReg
  • Auth_OpenID_urinorm
  • Auth_OpenID_verifyReturnTo
  • Auth_Yadis_array_scramble
  • Auth_Yadis_escapeForIRI
  • Auth_Yadis_getCanonicalID
  • Auth_Yadis_getDefaultProxy
  • Auth_Yadis_getEscapeRE
  • Auth_Yadis_getIPrivateChars
  • Auth_Yadis_getNSMap
  • Auth_Yadis_getServiceEndpoints
  • Auth_Yadis_getSupportedExtensions
  • Auth_Yadis_getUCSChars
  • Auth_Yadis_getXMLParser
  • Auth_Yadis_getXRDExpiration
  • Auth_Yadis_getXrefRE
  • Auth_Yadis_getXRIAuthorities
  • Auth_Yadis_identifierScheme
  • Auth_Yadis_iriToURI
  • Auth_Yadis_pct_escape_unicode
  • Auth_Yadis_providerIsAuthoritative
  • Auth_Yadis_rootAuthority
  • Auth_Yadis_setDefaultParser
  • Auth_Yadis_startswith
  • Auth_Yadis_toIRINormal
  • Auth_Yadis_toURINormal
  • Auth_Yadis_XRI
  • Auth_Yadis_XRIAppendArgs
  • authorSelector
  • build_query
  • build_url
  • bulkActionRedirect
  • bulkTags
  • byteConvert
  • cacheImage
  • checkAccess
  • checkAlbumimagesort
  • checkAlbumParentid
  • checkAlbumPassword
  • checkChosenItemStatus
  • checkChosenMenuset
  • checked
  • checkFolder
  • checkForEmptyTitle
  • checkForGuest
  • checkForPage
  • checkForPassword
  • checkForUpdate
  • checkHitcounterDisplay
  • checkIfChecked
  • checkIfLockedNews
  • checkIfLockedPage
  • checkIfNew
  • checkInstall
  • checkLayoutUseForImages
  • checkNewsAccess
  • checkNewsCategoryPassword
  • checkObjectsThumb
  • checkPagePassword
  • checkPageValidity
  • checkParentLayouts
  • checkPublishDates
  • checkRequiredField
  • checkSelectedAlbum
  • checkSignature
  • cleanAlbum
  • cleanHTML
  • clearSitemapCache
  • clonedFrom
  • codeblocktabsJS
  • comment_form_addComment
  • comment_form_handle_comment
  • comment_form_PaginationJS
  • comment_form_postcomment
  • comment_form_print10Most
  • comment_form_visualEditor
  • commentFormUseCaptcha
  • commentReply
  • commentsAllowed
  • consolidatedEditMessages
  • copyLayoutSelection
  • copyThemeDirectory
  • countArticles
  • countCombiNews
  • createMenuIfNotExists
  • createRelatedItemsResultArray
  • cron_starter
  • currentRelativeURL
  • customOptions
  • dateDiff
  • datepickerJS
  • dateTimeConvert
  • db_affected_rows
  • db_close
  • db_collation
  • db_connect
  • db_count
  • db_create
  • db_create_table
  • db_error
  • db_fetch_assoc
  • db_fetch_row
  • db_free_result
  • db_getSQLmode
  • db_insert_id
  • db_LIKE_escape
  • db_list_fields
  • db_name
  • db_num_rows
  • db_permissions
  • db_quote
  • db_setSQLmode
  • db_show
  • db_software
  • db_table_update
  • db_truncate_table
  • debug404
  • debugLog
  • debugLogBacktrace
  • debugLogVar
  • defaultCodeblocks_codebox
  • deleteArticle
  • deleteCategory
  • deleteItem
  • deleteLayoutSelection
  • deletePage
  • deleteThemeDirectory
  • detect_fetcher
  • detect_math
  • detect_query_corruption
  • detect_random
  • detect_stores
  • detect_xml
  • dircopy
  • displayError
  • doIncludes
  • elFinder_admin_tabs
  • elFinder_tinymce
  • enableExtension
  • escape
  • executeRSS
  • exitZP
  • exposeZenPhotoInformations
  • extensionEnabled
  • fetchComments
  • filesystemToInternal
  • filter_extractReturnURL
  • filter_MatchesAnyOpenIDConsumerType
  • filter_MatchesAnyOpenIDType
  • filterImageQuery
  • fix_path_redirect
  • formatList
  • fullText
  • galleryAlbumsPerPage
  • genAlbumList
  • generateCaptcha
  • generateLanguageList
  • generateListFromArray
  • generateListFromFiles
  • generateRadiobuttonsFromArray
  • generateSitemapCacheFile
  • generateSitemapIndexCacheFile
  • generateUnorderedListFromArray
  • get_AnyFile_suffixes
  • get_context
  • get_filterScript
  • get_instance
  • get_language_string
  • getAdminThumb
  • getAlbumArray
  • getAlbumBreadcrumb
  • getAlbumBreadcrumbAdmin
  • getAlbumCustomData
  • getAlbumData
  • getAlbumDate
  • getAlbumDesc
  • getAlbumFolder
  • getAlbumGeodata
  • getAlbumId
  • getAlbumInherited
  • getAlbumLinkURL
  • getAlbumLocation
  • getAlbumPage
  • getAlbumPlace
  • getAlbumStatistic
  • getAlbumThumb
  • getAlbumTitle
  • getAlbumURL
  • getAllAccessibleAlbums
  • getAllAlbums
  • getAllArticleDates
  • getAllCategories
  • getAllDates
  • getAllowedTags
  • getAllSubAlbumIDs
  • getAllSubalbums
  • getAllTagsCount
  • getAllTagsFromAlbum
  • getAllTagsFromAlbum_multi_unique
  • getAllTagsFromZenpage
  • getAllTagsUnique
  • getAllTranslations
  • getAnnotatedAlbumTitle
  • getAnnotatedImageTitle
  • getArticles
  • getAuthor
  • getBare
  • getBareAlbumDesc
  • getBareAlbumTitle
  • getBareGalleryDesc
  • getBareGalleryTitle
  • getBareImageDesc
  • getBareImageTitle
  • getBareNewsAlbumTitle
  • getBareNewsTitle
  • getBarePageTitle
  • getCategory
  • getCategoryID
  • getCategoryLink
  • getCategoryParentID
  • getCategorySortOrder
  • getCategoryTitle
  • getCheckboxState
  • getCodeblock
  • getCombiNews
  • getCommentAddress
  • getCommentAuthorEmail
  • getCommentAuthorLink
  • getCommentAuthorName
  • getCommentAuthorSite
  • getCommentBody
  • getCommentCount
  • getCommentDate
  • getCommentDateTime
  • getCommentErrors
  • getCommentsAllowed
  • getCommentStored
  • getCommentTime
  • getConsumer
  • getContentShorten
  • getCurrentMenuItem
  • getCurrentNewsArchive
  • getCurrentNewsCategory
  • getCurrentNewsCategoryID
  • getCurrentNewsCategoryParentID
  • getCurrentNewsPage
  • getCurrentPage
  • getCurrentTheme
  • getCustomAlbumThumb
  • getCustomAlbumThumbMaxSpace
  • getCustomImageURL
  • getCustomPageURL
  • getCustomSizedImageMaxSpace
  • getCustomSizedImageThumbMaxSpace
  • getDefaultHeight
  • getDefaultSizedImage
  • getDefaultWidth
  • getDownloadLink
  • getdownloadList
  • getDownloadURL
  • getE
  • getEnabledPlugins
  • getExpiryDatePost
  • getFavoritesURL
  • getField
  • getFirstImageURL
  • getFullHeight
  • getFullImageURL
  • getFullNewsImage
  • getFullWidth
  • getGalleryDesc
  • getGalleryIndexURL
  • getGalleryTitle
  • getGeoCoord
  • getHeadTitle
  • getHitcounter
  • getImageArgs
  • getImageCacheFilename
  • getImageCachePostfix
  • getImageCity
  • getImageCountry
  • getImageCustomData
  • getImageData
  • getImageDate
  • getImageDesc
  • getImageEXIFData
  • getImageGeodata
  • getImageID
  • getImageLinkURL
  • getImageLocation
  • getImageMetaData
  • getImageParameters
  • getImageProcessorURI
  • getImageProcessorURIFromCacheName
  • getImageRotation
  • getImageSortOrder
  • getImageState
  • getImageStatistic
  • getImageThumb
  • getImageTitle
  • getImageURI
  • getImageURL
  • getItem
  • getItemByID
  • getItemTitleAndURL
  • getjPlayerSkinCSS
  • getjPlayerSkins
  • getLanguageArray
  • getLanguageFlag
  • getLastImageURL
  • getLatestComments
  • getLatestNews
  • getLatestZenpageComments
  • getLayout
  • getLayoutSelector
  • getLink
  • getLinkHTML
  • getLogTabs
  • getMacros
  • getMainSiteName
  • getMainSiteURL
  • getManagedAlbumList
  • getMaxSpaceContainer
  • getMenuFromLink
  • getMenuItemChilds
  • getMenuItems
  • getMenumanagerPredicessor
  • getMenumanagerSuccessor
  • getMenuSetSelector
  • getMenuVisibility
  • getMimeString
  • getNestedAlbumList
  • getNewsAdminOption
  • getNewsAdminOptionPath
  • getNewsAlbumName
  • getNewsAlbumTitle
  • getNewsAlbumURL
  • getNewsArchivePath
  • getNewsArchiveURL
  • getNewsAuthor
  • getNewsCategories
  • getNewsCategoryCustomData
  • getNewsCategoryDesc
  • getNewsCategoryPath
  • getNewsCategoryURL
  • getNewsContent
  • getNewsContentShorten
  • getNewsCustomData
  • getNewsDate
  • getNewsExtraContent
  • getNewsID
  • getNewsImageTags
  • getNewsIndexURL
  • getNewsLink
  • getNewsPagesStatistic
  • getNewsPathNav
  • getNewsReadMore
  • getNewsTitle
  • getNewsTitleLink
  • getNewsTitlePath
  • getNewsType
  • getNewsURL
  • getNewsVideoContent
  • getNextAlbum
  • getNextAlbumURL
  • getNextImageThumb
  • getNextImageURL
  • getNextNewsPageURL
  • getNextNewsURL
  • getNextPageURL
  • getNextPrevNews
  • getNotViewableAlbums
  • getNotViewableImages
  • getNumAlbums
  • getNumAllSubalbums
  • getNumImages
  • getNumNews
  • getNumPages
  • getNumSubalbums
  • getOpenIDURL
  • getOption
  • getOptionFromDB
  • getOptionList
  • getPageAuthor
  • getPageContent
  • getPageCustomData
  • getPageDate
  • getPageExtraContent
  • getPageID
  • getPageLastChangeDate
  • getPageLinkPath
  • getPageLinkURL
  • getPageNavList
  • getPageNumURL
  • getPageParentID
  • getPageRedirect
  • getPages
  • getPageSelector
  • getPageSortorder
  • getPageTitle
  • getPageTitleLink
  • getPageURL
  • getParentAlbums
  • getParentAlbumsAdmin
  • getParentBreadcrumb
  • getParentItems
  • getParentMenuItems
  • getParentNewsCategories
  • getParentPages
  • getPasswordProtectImage
  • getPHPFiles
  • getPlugin
  • getPluginFiles
  • getPluginTabs
  • getPrevAlbum
  • getPrevAlbumURL
  • getPrevImageThumb
  • getPrevImageURL
  • getPrevNewsPageURL
  • getPrevNewsURL
  • getPrevPageURL
  • getProtectedImageURL
  • getRandomImages
  • getRandomImagesAlbum
  • getRating
  • getRelatedItems
  • getRequestURI
  • getReturnTo
  • getRSSHeaderLink
  • getRSSLink
  • getScheme
  • getSearchDate
  • getSearchURL
  • getSearchWords
  • getSelectedLayout
  • getSerializedArray
  • getSetClause
  • getSiteHomeURL
  • getSitemapAlbumList
  • getSitemapAlbums
  • getSitemapGoogleImageVideoExtras
  • getSitemapGoogleLoopIndex
  • getSitemapImages
  • getSitemapIndexLinks
  • getSitemapZenpageNewsArticles
  • getSitemapZenpageNewsCategories
  • getSitemapZenpageNewsIndex
  • getSitemapZenpagePages
  • getSizeCustomImage
  • getSizeDefaultImage
  • getSizeDefaultThumb
  • getSizedImageURL
  • getSizeFullImage
  • getStore
  • getSubCategories
  • getSubtabs
  • getSuffix
  • getTagCountByAccess
  • getTagOrder
  • getTags
  • gettext_pl
  • gettext_th
  • getTheme
  • getThemeFiles
  • getThemeOption
  • getTimezones
  • getTinyMCE4ConfigFiles
  • getTitle
  • getTotalArticles
  • getTotalImagesIn
  • getTotalNewsPages
  • getTotalPages
  • getTrustRoot
  • getUnprotectedImageURL
  • getUrAlbum
  • getURL
  • getUserIP
  • getUserLocale
  • getVersion
  • getViewerImageSize
  • getWatermarkParam
  • getWatermarkPath
  • getWatermarks
  • getWhereClause
  • getXSRFToken
  • getZenpageHitcounter
  • getZenpageRSSHeaderLink
  • getZenpageRSSLink
  • getZenpageStatistic
  • googleVerifyHead
  • handleSearchParms
  • hasDynamicAlbumSuffix
  • hasNextImage
  • hasNextPage
  • hasPrevImage
  • hasPrevPage
  • hitcounter
  • html_decode
  • html_encode
  • html_encodeTagged
  • httpsRedirect
  • httpUploadHandler
  • httpUploadHandler_admin_tabs
  • i18nSetLocale
  • imageBlurGD
  • imageDebug
  • imageError
  • imageNumber
  • imgSrcURI
  • in_context
  • inNewsCategory
  • inProtectedNewsCategory
  • installSignature
  • instrument
  • inSubNewsCategoryOf
  • internalToFilesystem
  • inventMenuItem
  • iptc_make_tag
  • is_AdminEditPage
  • is_connected
  • is_GalleryNewsType
  • is_News
  • is_NewsArchive
  • is_NewsArticle
  • is_NewsCategory
  • is_NewsPage
  • is_NewsType
  • is_Pages
  • is_valid_email_zp
  • is_valid_image
  • is_valid_other_type
  • is_zip
  • isAlbumClass
  • isAlbumPage
  • isArchive
  • isHandledAlbum
  • isImageClass
  • isImagePage
  • isImagePhoto
  • isImageVideo
  • isLandscape
  • isMyAlbum
  • isMyNews
  • isMyPage
  • isolate
  • isProtectedAlbum
  • isProtectedNewsCategory
  • isProtectedPage
  • isSubNewsCategoryOf
  • isValidURL
  • jQueryUpload_head
  • jQueryUpload_headers
  • jQueryUploadHandler
  • jQueryUploadHandler_admin_tabs
  • js_encode
  • json_decode
  • json_encode
  • kses
  • kses_array_lc
  • kses_attr
  • kses_bad_protocol
  • kses_bad_protocol_once
  • kses_bad_protocol_once2
  • kses_check_attr_val
  • kses_decode_entities
  • kses_hair
  • kses_hook
  • kses_html_error
  • kses_js_entities
  • kses_no_null
  • kses_normalize_entities
  • kses_normalize_entities2
  • kses_split
  • kses_split2
  • kses_stripslashes
  • kses_version
  • ksesProcess
  • layoutSelector
  • layoutSelector_album
  • listDBUses
  • listDirectoryFiles
  • listUses
  • load_zenpage_news
  • load_zenpage_pages
  • loadLocalOptions
  • log_message
  • lookupSortKey
  • macro_admin_tabs
  • macroList_show
  • makeAlbumCurrent
  • makeImageCurrent
  • makeSpecialImageName
  • markRelease_button
  • mb_strlen
  • mb_strpos
  • mb_strrpos
  • mb_strtolower
  • mb_strtoupper
  • mb_substr
  • mb_substr_count
  • menu_admin_toolbox_global
  • menu_tabs
  • minDiff
  • mkdir_recursive
  • my_truncate_string
  • myts_date
  • newAlbum
  • newImage
  • next_album
  • next_comment
  • next_image
  • next_news
  • next_page
  • ngettext_pl
  • ngettext_th
  • normalizeColumns
  • omsAdditions
  • openedForComments
  • parse_query
  • parse_size
  • parseAllowedTags
  • parseHttpAcceptLanguage
  • passAlbums
  • passImages
  • pathurlencode
  • PclZipUtilCopyBlock
  • PclZipUtilOptionText
  • PclZipUtilPathInclusion
  • PclZipUtilPathReduction
  • PclZipUtilRename
  • PclZipUtilTranslateWinPath
  • PHPMailerAutoload
  • populateManagedObjectsList
  • postAlbumSort
  • postIndexDecode
  • postIndexEncode
  • prefix
  • prepareAlbumPage
  • prepareCustomPage
  • prepareImagePage
  • prepareIndexPage
  • print404status
  • print_language_string_list
  • printAddToFavorites
  • printAdminFooter
  • printAdminHeader
  • printAdminRightsTable
  • printAdminToolbox
  • printAlbumBreadcrumb
  • printAlbumButtons
  • printAlbumCustomData
  • printAlbumData
  • printAlbumDate
  • printAlbumDesc
  • printAlbumEditForm
  • printAlbumEditRow
  • printAlbumLegend
  • printAlbumLink
  • printAlbumLocation
  • printAlbumMap
  • printAlbumMenu
  • printAlbumMenuJump
  • printAlbumMenuList
  • printAlbumMenuListAlbum
  • printAlbumPlace
  • printAlbumRating
  • printAlbumsSelector
  • printAlbumStatistic
  • printAlbumStatisticItem
  • printAlbumThumbImage
  • printAlbumTitle
  • printAlbumURL
  • printAlbumZip
  • printAllDates
  • printAllNewsCategories
  • printAllTags
  • printAllTagsAs
  • printAllTagsFromAlbum
  • printAllTagsFromZenpage
  • printAnnotatedAlbumTitle
  • printAnnotatedImageTitle
  • printArticleCategories
  • printArticleDatesDropdown
  • printArticlesPerPageDropdown
  • printBareAlbumDesc
  • printBareAlbumTitle
  • printBareGalleryDesc
  • printBareGalleryTitle
  • printBareImageDesc
  • printBareImageTitle
  • printBareNewsTitle
  • printBarePageTitle
  • printBulkActions
  • printCaptcha
  • printCategoriesStatistic
  • printCategoryCheckboxListEntry
  • printCategoryDropdown
  • printCategoryListSortableTable
  • printCategorySelection
  • printCodeblock
  • printCodeblockEdit
  • printCommentAuthorLink
  • printCommentErrors
  • printCommentForm
  • printContactForm
  • printCurrentNewsArchive
  • printCurrentNewsCategory
  • printCustomAlbumThumbImage
  • printCustomAlbumThumbMaxSpace
  • printCustomMenu
  • printCustomPageSelector
  • printCustomPageURL
  • printCustomSizedImage
  • printCustomSizedImageMaxHeight
  • printCustomSizedImageMaxSpace
  • printCustomSizedImageThumbMaxSpace
  • printDefaultSizedImage
  • printDownloadAlbumZipURL
  • printDownloadLink
  • printDownloadLinkAlbumZip
  • printdownloadList
  • printDownloadURL
  • printEditable
  • printEditCommentLink
  • printEditDropdown
  • printExpired
  • printFavoritesLink
  • printFavoritesURL
  • printField
  • printGalleryDesc
  • printGalleryIndexURL
  • printGalleryTitle
  • printGoogleMap
  • printHeadTitle
  • printHomeLink
  • printImageCustomData
  • printImageData
  • printImageDate
  • printImageDesc
  • printImageDiv
  • printImageEXIFData
  • printImageID
  • printImageLink
  • printImageMap
  • printImageMetadata
  • printImageRating
  • printImageSortOrder
  • printImageStatistic
  • printImageThumb
  • printImageTitle
  • printImageURL
  • printItemEditLink
  • printItemsList
  • printItemsListTable
  • printItemStatusDropdown
  • printjCarouselThumbNav
  • printjPlayerPlaylist
  • printLanguageSelector
  • printLatestAlbums
  • printLatestComments
  • printLatestImages
  • printLatestImagesByDate
  • printLatestImagesByMtime
  • printLatestNews
  • printLatestUpdatedAlbums
  • printLatestZenpageComments
  • printLink
  • printLinkHTML
  • printLogoAndLinks
  • printManagedObjects
  • printMenuemanagerPageList
  • printMenuemanagerPageListWithNav
  • printMenumanagerBreadcrumb
  • printMenumanagerNextLink
  • printMenumanagerPrevLink
  • printMostPopularItems
  • printMostRatedAlbums
  • printMostRatedImages
  • printMostRatedItems
  • printNestedAlbumsList
  • printNestedItemsList
  • printNestedMenu
  • printNews
  • printNewsArchive
  • printNewsAuthor
  • printNewsCategories
  • printNewsCategoryCustomData
  • printNewsCategoryDesc
  • printNewsCategoryURL
  • printNewsContent
  • printNewsCustomData
  • printNewsDate
  • printNewsExtraContent
  • printNewsImageTags
  • printNewsIndexURL
  • printNewsLink
  • printNewsPageList
  • printNewsPageListWithNav
  • printNewsReadMoreLink
  • printNewsStatistic
  • printNewsTitle
  • printNewsTitleLink
  • printNewsURL
  • printNextNewsLink
  • printNextNewsPageLink
  • printNextPageLink
  • printNextPageURL
  • printPageArticleTags
  • printPageAuthor
  • printPageContent
  • printPageCustomData
  • printPageDate
  • printPagedThumbsNav
  • printPageExtraContent
  • printPageID
  • printPageLastChangeDate
  • printPageLinkURL
  • printPageList
  • printPageListWithNav
  • printPageMenu
  • printPageNav
  • printPageSelector
  • printPagesListTable
  • printPagesStatistic
  • printPageTitle
  • printPageTitleLink
  • printPageURL
  • printParentBreadcrumb
  • printParentPagesBreadcrumb
  • printPasswordForm
  • printPopularAlbums
  • printPopularImages
  • printPreloadScript
  • printPrevNewsLink
  • printPrevNewsPageLink
  • printPrevPageLink
  • printPrevPageURL
  • printPublished
  • printPublishIconLink
  • printRandomImages
  • printRating
  • printRegisterURL
  • printRegistrationForm
  • printRelatedItems
  • printRSSHeaderLink
  • printRSSLink
  • printSearchBreadcrumb
  • printSearchForm
  • printSiteHomeURL
  • printSizedImageLink
  • printSizedImageURL
  • printSlideShow
  • printSlideShowJS
  • printSlideShowLink
  • printSortableHead
  • printSortOrderDropdown
  • printSubPagesExcerpts
  • printSubtabs
  • printTabs
  • printTags
  • printThumbNav
  • printTopRatedAlbums
  • printTopRatedImages
  • printTopRatedItems
  • printUnpublishedDropdown
  • printUserLogin_out
  • printUserSizeImage
  • printUserSizeSelector
  • printVersion
  • printZenJavascripts
  • printZenpageIconLegend
  • printZenpageItemsBreadcrumb
  • printZenpageNewsCategorySelector
  • printZenpagePagesSelector
  • printZenpageRSSHeaderLink
  • printZenpageRSSLink
  • printZenpageStatistic
  • printZenphotoLink
  • process_language_string_save
  • processAlbumBulkActions
  • processAlbumEdit
  • processCodeblockSave
  • processCommentBulkActions
  • processCredentials
  • processCustomOptionSave
  • processEditSelection
  • processExpired
  • processImageBulkActions
  • processImageEdit
  • processManagedObjects
  • processMenuBulkActions
  • processOrder
  • processRights
  • processTags
  • processZenpageBulkActions
  • propSizes
  • publishItem
  • purgeOption
  • query
  • query_full_array
  • query_single_row
  • rc4
  • read_exif_data_protected
  • readTags
  • recaptcha_check_answer
  • recaptcha_get_html
  • recaptcha_get_signup_url
  • recaptcha_mailhide_html
  • recaptcha_mailhide_url
  • reconfigureAction
  • reconfigureCS
  • reconfigurePage
  • recordMissing
  • rem_context
  • removeParentAlbumNames
  • resetCurrentAlbum
  • restore_context
  • reveal
  • rewrite_get_album_image
  • rewrite_path
  • rewrite_path_zenpage
  • RSS_Channel
  • RSS_Retrieve
  • RSS_Tags
  • rulesList
  • run
  • safe_fnmatch
  • safe_glob
  • sanitize
  • sanitize_numeric
  • sanitize_path
  • sanitize_script
  • sanitize_string
  • sanitizeRedirect
  • save_context
  • saveLayoutSelection
  • saveZenphotoLayoutSelection
  • search_quote
  • secureServer
  • seo_cleanup_button
  • seoFriendly
  • seoFriendlyJS
  • set_context
  • setAlbumCustomData
  • setAlbumSubtabs
  • setImageCustomData
  • setMainDomain
  • setOption
  • setOptionDefault
  • setPluginDomain
  • setThemeColumns
  • setThemeDomain
  • setThemeOption
  • setThemeOptionDefault
  • setupAllowedMaps
  • setupCurrentLocale
  • setupDomain
  • setupTheme
  • shortenContent
  • showOrNotShowField
  • shuffle_assoc
  • signatureChange
  • site_upgrade_button
  • site_upgrade_status
  • sitemap_echonl
  • sitemap_getChangefreq
  • sitemap_getDateformat
  • sitemap_getDBLimit
  • sitemap_getISO8601Date
  • skipScheduledPublishing
  • sortByKey
  • sortByMultilingual
  • sortMultiArray
  • standardScripts
  • standardThemeOptions
  • stickyNews
  • storeConfig
  • storeTags
  • stripSuffix
  • submenuOf
  • switchLog
  • tagSelector
  • tagSuggestJS
  • tagSuggestJS_admin
  • tagSuggestJS_frontend
  • themeIsEditable
  • themeSetup
  • timezoneDiff
  • tinymce4ConfigJS
  • truncate_string
  • unpublishedZenphotoItemCheck
  • unpublishSubalbums
  • unQuote
  • unzip
  • updateArticle
  • updateCacheName
  • updateCategory
  • updateConfigItem
  • updateItemSortorder
  • updateItemsSortorder
  • updateMenuItem
  • updatePage
  • upload_extra
  • upload_form
  • upload_head
  • user_mailing_list_button
  • validateLocale
  • wordpress_import_button
  • wp_prefix
  • wp_query_full_array
  • wpimport_TryAgainError
  • XSRFdefender
  • XSRFToken
  • zenJavascript
  • zenpageAlbumImage
  • zenpageBulkActionMessage
  • zenpageHitcounter
  • zenpageJSCSS
  • zenpageOpenedForComments
  • zenpagePublish
  • zenphoto_PHPMailer
  • zenphoto_sendmail
  • zenPhotoTheme
  • zp_apply_filter
  • zp_clearCookie
  • zp_colorAllocate
  • zp_cookieEncode
  • zp_copyCanvas
  • zp_createImage
  • zp_drawRectangle
  • zp_error
  • zp_filter_slot
  • zp_filter_unique_id
  • zp_getCookie
  • zp_getFonts
  • zp_graphicsLibInfo
  • zp_handle_password
  • zp_handle_password_single
  • zp_has_filter
  • zp_image_types
  • zp_imageCanRotate
  • zp_imageColorTransparent
  • zp_imageDims
  • zp_imageFill
  • zp_imageFontHeight
  • zp_imageFontWidth
  • zp_imageFromString
  • zp_imageGet
  • zp_imageGray
  • zp_imageHeight
  • zp_imageIPTC
  • zp_imageKill
  • zp_imageLoadFont
  • zp_imageMerge
  • zp_imageOutput
  • zp_imageResizeAlpha
  • zp_imageUnsharpMask
  • zp_imageWidth
  • zp_load_album
  • zp_load_gallery
  • zp_load_image
  • zp_load_page
  • zp_load_request
  • zp_load_search
  • zp_loggedin
  • zp_mail
  • zp_register_filter
  • zp_remove_filter
  • zp_resampleImage
  • zp_rotateImage
  • zp_session_start
  • zp_setCookie
  • zp_writeString
  • zpErrorHandler
  • zpFormattedDate
  • zpRewriteURL
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
   1: <?php
   2: 
   3: /**
   4:  *
   5:  * Enable this filter to scan images (or <i>xmp sidecar</i> files) for metadata.
   6:  *
   7:  * Relevant metadata found will be incorporated into the image (or album object).
   8:  * See <i>{@link http://www.adobe.com/devnet/xmp.html  Adobe XMP Specification}</i>
   9:  * for xmp metadata description. This plugin attempts to map the <i>xmp metadata</i> to Zenphoto or IPTC fields.
  10:  *
  11:  * If a sidecar file exists, it will take precedence (the image file will not be
  12:  * examined.) The sidecar file should reside in the same folder, have the same <i>prefix</i> name as the
  13:  * image (album), and the suffix <var>.xmp</var>. Thus, the sidecar for <i>image</i>.jpg would be named
  14:  * <i>image</i><var>.xmp</var>.
  15:  *
  16:  * NOTE: dynamic albums have an <var>.alb</var> suffix. Append <var>.xmp</var> to that name so
  17:  * that the dynamic album sidecar would be named <i>album</i><var>.alb.xmp</var>.
  18:  *
  19:  * There are two options for this plugin
  20:  *  <ul>
  21:  *      <li>The suffix of the metadata sidecar file</li>
  22:  *      <li>A list of image file suffixes that may contain metadata</li>
  23:  *  </ul>
  24:  * Check each image type you wish the plugin to search within for
  25:  * an <i>xmp block</i>. These are disabled by default because scanning image files can add considerably to the
  26:  * processing time.
  27:  *
  28:  * The plugin does not present any theme interface.
  29:  *
  30:  * @author Stephen Billard (sbillard)
  31:  * @package plugins
  32:  * @subpackage media
  33:  */
  34: $plugin_is_filter = 9 | CLASS_PLUGIN;
  35: $plugin_description = gettext('Extracts <em>XMP</em> metadata from images and <code>XMP</code> sidecar files.');
  36: $plugin_author = "Stephen Billard (sbillard)";
  37: 
  38: $option_interface = 'xmpMetadata';
  39: 
  40: zp_register_filter('album_instantiate', 'xmpMetadata::album_instantiate');
  41: zp_register_filter('new_album', 'xmpMetadata::new_album');
  42: zp_register_filter('album_refresh', 'xmpMetadata::new_album');
  43: zp_register_filter('image_instantiate', 'xmpMetadata::image_instantiate');
  44: zp_register_filter('image_metadata', 'xmpMetadata::new_image');
  45: zp_register_filter('upload_filetypes', 'xmpMetadata::sidecars');
  46: zp_register_filter('save_album_utilities_data', 'xmpMetadata::putXMP');
  47: zp_register_filter('edit_album_utilities', 'xmpMetadata::create');
  48: zp_register_filter('save_image_utilities_data', 'xmpMetadata::putXMP');
  49: zp_register_filter('edit_image_utilities', 'xmpMetadata::create');
  50: zp_register_filter('bulk_image_actions', 'xmpMetadata::bulkActions');
  51: zp_register_filter('bulk_album_actions', 'xmpMetadata::bulkActions');
  52: 
  53: require_once(dirname(dirname(__FILE__)) . '/exif/exif.php');
  54: 
  55: define('XMP_EXTENSION', strtolower(getOption('xmpMetadata_suffix')));
  56: 
  57: /**
  58:  * Plugin option handling class
  59:  *
  60:  */
  61: class xmpMetadata {
  62: 
  63:     private static $XML_trans = array(
  64:                     '&#128;'     => '€',
  65:                     '&#130;'     => '‚',
  66:                     '&#131;'     => 'ƒ',
  67:                     '&#132;'     => '„',
  68:                     '&#133;'     => '…',
  69:                     '&#134;'     => '†',
  70:                     '&#135;'     => '‡',
  71:                     '&#136;'     => 'ˆ',
  72:                     '&#137;'     => '‰',
  73:                     '&#138;'     => 'Š',
  74:                     '&#139;'     => '‹',
  75:                     '&#140;'     => 'Œ',
  76:                     '&#142;'     => 'Ž',
  77:                     '&#145;'     => '‘',
  78:                     '&#146;'     => '’',
  79:                     '&#147;'     => '“',
  80:                     '&#148;'     => '”',
  81:                     '&#149;'     => '•',
  82:                     '&#150;'     => '–',
  83:                     '&#151;'     => '—',
  84:                     '&#152;'     => '˜',
  85:                     '&#153;'     => '™',
  86:                     '&#154;'     => 'š',
  87:                     '&#155;'     => '›',
  88:                     '&#156;'     => 'œ',
  89:                     '&#158;'     => 'ž',
  90:                     '&#159;'     => 'Ÿ',
  91:                     '&#161;'     => '¡',
  92:                     '&#162;'     => '¢',
  93:                     '&#163;'     => '£',
  94:                     '&#164;'     => '¤',
  95:                     '&#165;'     => '¥',
  96:                     '&#166;'     => '¦',
  97:                     '&#167;'     => '§',
  98:                     '&#168;'     => '¨',
  99:                     '&#169;'     => '©',
 100:                     '&#170;'     => 'ª',
 101:                     '&#171;'     => '«',
 102:                     '&#172;'     => '¬',
 103:                     '&#173;'     => '­',
 104:                     '&#174;'     => '®',
 105:                     '&#175;'     => '¯',
 106:                     '&#176;'     => '°',
 107:                     '&#177;'     => '±',
 108:                     '&#178;'     => '²',
 109:                     '&#179;'     => '³',
 110:                     '&#180;'     => '´',
 111:                     '&#181;'     => 'µ',
 112:                     '&#182;'     => '¶',
 113:                     '&#183;'     => '·',
 114:                     '&#184;'     => '¸',
 115:                     '&#185;'     => '¹',
 116:                     '&#186;'     => 'º',
 117:                     '&#187;'     => '»',
 118:                     '&#188;'     => '¼',
 119:                     '&#189;'     => '½',
 120:                     '&#190;'     => '¾',
 121:                     '&#191;'     => '¿',
 122:                     '&#192;'     => 'À',
 123:                     '&#193;'     => 'Á',
 124:                     '&#194;'     => 'Â',
 125:                     '&#195;'     => 'Ã',
 126:                     '&#196;'     => 'Ä',
 127:                     '&#197;'     => 'Å',
 128:                     '&#198;'     => 'Æ',
 129:                     '&#199;'     => 'Ç',
 130:                     '&#200;'     => 'È',
 131:                     '&#201;'     => 'É',
 132:                     '&#202;'     => 'Ê',
 133:                     '&#203;'     => 'Ë',
 134:                     '&#204;'     => 'Ì',
 135:                     '&#205;'     => 'Í',
 136:                     '&#206;'     => 'Î',
 137:                     '&#207;'     => 'Ï',
 138:                     '&#208;'     => 'Ð',
 139:                     '&#209;'     => 'Ñ',
 140:                     '&#210;'     => 'Ò',
 141:                     '&#211;'     => 'Ó',
 142:                     '&#212;'     => 'Ô',
 143:                     '&#213;'     => 'Õ',
 144:                     '&#214;'     => 'Ö',
 145:                     '&#215;'     => '×',
 146:                     '&#216;'     => 'Ø',
 147:                     '&#217;'     => 'Ù',
 148:                     '&#218;'     => 'Ú',
 149:                     '&#219;'     => 'Û',
 150:                     '&#220;'     => 'Ü',
 151:                     '&#221;'     => 'Ý',
 152:                     '&#222;'     => 'Þ',
 153:                     '&#223;'     => 'ß',
 154:                     '&#224;'     => 'à',
 155:                     '&#225;'     => 'á',
 156:                     '&#226;'     => 'â',
 157:                     '&#227;'     => 'ã',
 158:                     '&#228;'     => 'ä',
 159:                     '&#229;'     => 'å',
 160:                     '&#230;'     => 'æ',
 161:                     '&#231;'     => 'ç',
 162:                     '&#232;'     => 'è',
 163:                     '&#233;'     => 'é',
 164:                     '&#234;'     => 'ê',
 165:                     '&#235;'     => 'ë',
 166:                     '&#236;'     => 'ì',
 167:                     '&#237;'     => 'í',
 168:                     '&#238;'     => 'î',
 169:                     '&#239;'     => 'ï',
 170:                     '&#240;'     => 'ð',
 171:                     '&#241;'     => 'ñ',
 172:                     '&#242;'     => 'ò',
 173:                     '&#243;'     => 'ó',
 174:                     '&#244;'     => 'ô',
 175:                     '&#245;'     => 'õ',
 176:                     '&#246;'     => 'ö',
 177:                     '&#247;'     => '÷',
 178:                     '&#248;'     => 'ø',
 179:                     '&#249;'     => 'ù',
 180:                     '&#250;'     => 'ú',
 181:                     '&#251;'     => 'û',
 182:                     '&#252;'     => 'ü',
 183:                     '&#253;'     => 'ý',
 184:                     '&#254;'     => 'þ',
 185:                     '&#255;'     => 'ÿ',
 186:                     '&#256;'     => 'Ā',
 187:                     '&#257;'     => 'ā',
 188:                     '&#258;'     => 'Ă',
 189:                     '&#259;'     => 'ă',
 190:                     '&#260;'     => 'Ą',
 191:                     '&#261;'     => 'ą',
 192:                     '&#262;'     => 'Ć',
 193:                     '&#263;'     => 'ć',
 194:                     '&#264;'     => 'Ĉ',
 195:                     '&#265;'     => 'ĉ',
 196:                     '&#266;'     => 'Ċ',
 197:                     '&#267;'     => 'ċ',
 198:                     '&#268;'     => 'Č',
 199:                     '&#269;'     => 'č',
 200:                     '&#270;'     => 'Ď',
 201:                     '&#271;'     => 'ď',
 202:                     '&#272;'     => 'Đ',
 203:                     '&#273;'     => 'đ',
 204:                     '&#274;'     => 'Ē',
 205:                     '&#275;'     => 'ē',
 206:                     '&#276;'     => 'Ĕ',
 207:                     '&#277;'     => 'ĕ',
 208:                     '&#278;'     => 'Ė',
 209:                     '&#279;'     => 'ė',
 210:                     '&#280;'     => 'Ę',
 211:                     '&#281;'     => 'ę',
 212:                     '&#282;'     => 'Ě',
 213:                     '&#283;'     => 'ě',
 214:                     '&#284;'     => 'Ĝ',
 215:                     '&#285;'     => 'ĝ',
 216:                     '&#286;'     => 'Ğ',
 217:                     '&#287;'     => 'ğ',
 218:                     '&#288;'     => 'Ġ',
 219:                     '&#289;'     => 'ġ',
 220:                     '&#290;'     => 'Ģ',
 221:                     '&#291;'     => 'ģ',
 222:                     '&#292;'     => 'Ĥ',
 223:                     '&#293;'     => 'ĥ',
 224:                     '&#294;'     => 'Ħ',
 225:                     '&#295;'     => 'ħ',
 226:                     '&#296;'     => 'Ĩ',
 227:                     '&#297;'     => 'ĩ',
 228:                     '&#298;'     => 'Ī',
 229:                     '&#299;'     => 'ī',
 230:                     '&#300;'     => 'Ĭ',
 231:                     '&#301;'     => 'ĭ',
 232:                     '&#302;'     => 'Į',
 233:                     '&#303;'     => 'į',
 234:                     '&#304;'     => 'İ',
 235:                     '&#305;'     => 'ı',
 236:                     '&#306;'     => 'IJ',
 237:                     '&#307;'     => 'ij',
 238:                     '&#308;'     => 'Ĵ',
 239:                     '&#309;'     => 'ĵ',
 240:                     '&#310;'     => 'Ķ',
 241:                     '&#311;'     => 'ķ',
 242:                     '&#312;'     => 'ĸ',
 243:                     '&#313;'     => 'Ĺ',
 244:                     '&#314;'     => 'ĺ',
 245:                     '&#315;'     => 'Ļ',
 246:                     '&#316;'     => 'ļ',
 247:                     '&#317;'     => 'Ľ',
 248:                     '&#318;'     => 'ľ',
 249:                     '&#319;'     => 'Ŀ',
 250:                     '&#320;'     => 'ŀ',
 251:                     '&#321;'     => 'Ł',
 252:                     '&#322;'     => 'ł',
 253:                     '&#323;'     => 'Ń',
 254:                     '&#324;'     => 'ń',
 255:                     '&#325;'     => 'Ņ',
 256:                     '&#326;'     => 'ņ',
 257:                     '&#327;'     => 'Ň',
 258:                     '&#328;'     => 'ň',
 259:                     '&#329;'     => 'ʼn',
 260:                     '&#330;'     => 'Ŋ',
 261:                     '&#331;'     => 'ŋ',
 262:                     '&#332;'     => 'Ō',
 263:                     '&#333;'     => 'ō',
 264:                     '&#334;'     => 'Ŏ',
 265:                     '&#335;'     => 'ŏ',
 266:                     '&#336;'     => 'Ő',
 267:                     '&#337;'     => 'ő',
 268:                     '&#338;'     => 'Œ',
 269:                     '&#339;'     => 'œ',
 270:                     '&#340;'     => 'Ŕ',
 271:                     '&#341;'     => 'ŕ',
 272:                     '&#342;'     => 'Ŗ',
 273:                     '&#343;'     => 'ŗ',
 274:                     '&#344;'     => 'Ř',
 275:                     '&#345;'     => 'ř',
 276:                     '&#346;'     => 'Ś',
 277:                     '&#347;'     => 'ś',
 278:                     '&#348;'     => 'Ŝ',
 279:                     '&#349;'     => 'ŝ',
 280:                     '&#34;'      => '"',
 281:                     '&#350;'     => 'Ş',
 282:                     '&#351;'     => 'ş',
 283:                     '&#352;'     => 'Š',
 284:                     '&#353;'     => 'š',
 285:                     '&#354;'     => 'Ţ',
 286:                     '&#355;'     => 'ţ',
 287:                     '&#356;'     => 'Ť',
 288:                     '&#357;'     => 'ť',
 289:                     '&#358;'     => 'Ŧ',
 290:                     '&#359;'     => 'ŧ',
 291:                     '&#360;'     => 'Ũ',
 292:                     '&#361;'     => 'ũ',
 293:                     '&#362;'     => 'Ū',
 294:                     '&#363;'     => 'ū',
 295:                     '&#364;'     => 'Ŭ',
 296:                     '&#365;'     => 'ŭ',
 297:                     '&#366;'     => 'Ů',
 298:                     '&#367;'     => 'ů',
 299:                     '&#368;'     => 'Ű',
 300:                     '&#369;'     => 'ű',
 301:                     '&#370;'     => 'Ų',
 302:                     '&#371;'     => 'ų',
 303:                     '&#372;'     => 'Ŵ',
 304:                     '&#373;'     => 'ŵ',
 305:                     '&#374;'     => 'Ŷ',
 306:                     '&#375;'     => 'ŷ',
 307:                     '&#377;'     => 'Ź',
 308:                     '&#378;'     => 'ź',
 309:                     '&#379;'     => 'Ż',
 310:                     '&#380;'     => 'ż',
 311:                     '&#381;'     => 'Ž',
 312:                     '&#382;'     => 'ž',
 313:                     '&#383;'     => 'ſ',
 314:                     '&#38;'      => '&',
 315:                     '&#39;'      => '\'',
 316:                     '&#402;'     => 'ƒ',
 317:                     '&#439;'     => 'Ʒ',
 318:                     '&#452;'     => 'DŽ',
 319:                     '&#453;'     => 'Dž',
 320:                     '&#454;'     => 'dž',
 321:                     '&#455;'     => 'LJ',
 322:                     '&#456;'     => 'Lj',
 323:                     '&#457;'     => 'lj',
 324:                     '&#458;'     => 'NJ',
 325:                     '&#459;'     => 'Nj',
 326:                     '&#460;'     => 'nj',
 327:                     '&#478;'     => 'Ǟ',
 328:                     '&#479;'     => 'ǟ',
 329:                     '&#484;'     => 'Ǥ',
 330:                     '&#485;'     => 'ǥ',
 331:                     '&#486;'     => 'Ǧ',
 332:                     '&#487;'     => 'ǧ',
 333:                     '&#488;'     => 'Ǩ',
 334:                     '&#489;'     => 'ǩ',
 335:                     '&#494;'     => 'Ǯ',
 336:                     '&#495;'     => 'ǯ',
 337:                     '&#497;'     => 'DZ',
 338:                     '&#499;'     => 'dz',
 339:                     '&#500;'     => 'Ǵ',
 340:                     '&#501;'     => 'ǵ',
 341:                     '&#506;'     => 'Ǻ',
 342:                     '&#507;'     => 'ǻ',
 343:                     '&#508;'     => 'Ǽ',
 344:                     '&#509;'     => 'ǽ',
 345:                     '&#510;'     => 'Ǿ',
 346:                     '&#511;'     => 'ǿ',
 347:                     '&#60;'      => '<',
 348:                     '&#62;'      => '>',
 349:                     '&#636;'     => 'ɼ',
 350:                     '&#64257;' => 'fi',
 351:                     '&#64258;' => 'fl',
 352:                     '&#658;'     => 'ʒ',
 353:                     '&#728;'     => '˘',
 354:                     '&#729;'     => '˙',
 355:                     '&#730;'     => '˚',
 356:                     '&#731;'     => '˛',
 357:                     '&#732;'     => '˜',
 358:                     '&#733;'     => '˝',
 359:                     '&#7682;'    => 'Ḃ',
 360:                     '&#7683;'    => 'ḃ',
 361:                     '&#7690;'    => 'Ḋ',
 362:                     '&#7691;'    => 'ḋ',
 363:                     '&#7696;'    => 'Ḑ',
 364:                     '&#7697;'    => 'ḑ',
 365:                     '&#7710;'    => 'Ḟ',
 366:                     '&#7711;'    => 'ḟ',
 367:                     '&#7728;'    => 'Ḱ',
 368:                     '&#7729;'    => 'ḱ',
 369:                     '&#7744;'    => 'Ṁ',
 370:                     '&#7745;'    => 'ṁ',
 371:                     '&#7766;'    => 'Ṗ',
 372:                     '&#7767;'    => 'ṗ',
 373:                     '&#7776;'    => 'Ṡ',
 374:                     '&#7777;'    => 'ṡ',
 375:                     '&#7786;'    => 'Ṫ',
 376:                     '&#7787;'    => 'ṫ',
 377:                     '&#7808;'    => 'Ẁ',
 378:                     '&#7809;'    => 'ẁ',
 379:                     '&#7810;'    => 'Ẃ',
 380:                     '&#7811;'    => 'ẃ',
 381:                     '&#7812;'    => 'Ẅ',
 382:                     '&#7813;'    => 'ẅ',
 383:                     '&#7922;'    => 'Ỳ',
 384:                     '&#7923;'    => 'ỳ',
 385:                     '&#8213;'    => '―',
 386:                     '&#8227;'    => '‣',
 387:                     '&#8252;'    => '‼',
 388:                     '&#8254;'    => '‾',
 389:                     '&#8260;'    => '⁄',
 390:                     '&#8319;'    => 'ⁿ',
 391:                     '&#8355;'    => '₣',
 392:                     '&#8356;'    => '₤',
 393:                     '&#8359;'    => '₧',
 394:                     '&#8453;'    => '℅',
 395:                     '&#8470;'    => '№',
 396:                     '&#8539;'    => '⅛',
 397:                     '&#8540;'    => '⅜',
 398:                     '&#8541;'    => '⅝',
 399:                     '&#8542;'    => '⅞',
 400:                     '&#8592;'    => '←',
 401:                     '&#8593;'    => '↑',
 402:                     '&#8594;'    => '→',
 403:                     '&#8595;'    => '↓',
 404:                     '&#8706;'    => '∂',
 405:                     '&#8710;'    => '∆',
 406:                     '&#8719;'    => '∏',
 407:                     '&#8721;'    => '∑',
 408:                     '&#8729;'    => '∙',
 409:                     '&#8730;'    => '√',
 410:                     '&#8734;'    => '∞',
 411:                     '&#8735;'    => '∟',
 412:                     '&#8745;'    => '∩',
 413:                     '&#8747;'    => '∫',
 414:                     '&#8776;'    => '≈',
 415:                     '&#8800;'    => '≠',
 416:                     '&#8801;'    => '≡',
 417:                     '&#8804;'    => '≤',
 418:                     '&#8805;'    => '≥',
 419:                     '&#94;'      => '^',
 420:                     '&#9792;'    => '♀',
 421:                     '&#9794;'    => '♂',
 422:                     '&#9824;'    => '♠',
 423:                     '&#9827;'    => '♣',
 424:                     '&#9829;'    => '♥',
 425:                     '&#9830;'    => '♦',
 426:                     '&#9833;'    => '♩',
 427:                     '&#9834;'    => '♪',
 428:                     '&#9836;'    => '♬',
 429:                     '&#9837;'    => '♭',
 430:                     '&#9839;'    => '♯',
 431:                     '&498;'      => 'Dz',
 432:                     '&AElig;'    => 'Æ',
 433:                     '&Aacute;' => 'Á',
 434:                     '&Acirc;'    => 'Â',
 435:                     '&Agrave;' => 'À',
 436:                     '&Aring;'    => 'Å',
 437:                     '&Atilde;' => 'Ã',
 438:                     '&Auml;'     => 'Ä',
 439:                     '&Ccedil;' => 'Ç',
 440:                     '&Dagger;' => '‡',
 441:                     '&ETH;'      => 'Ð',
 442:                     '&Eacute;' => 'É',
 443:                     '&Ecirc;'    => 'Ê',
 444:                     '&Egrave;' => 'È',
 445:                     '&Euml;'     => 'Ë',
 446:                     '&Iacute;' => 'Í',
 447:                     '&Icirc;'    => 'Î',
 448:                     '&Igrave;' => 'Ì',
 449:                     '&Iuml;'     => 'Ï',
 450:                     '&Ntilde;' => 'Ñ',
 451:                     '&OElig;'    => 'Œ',
 452:                     '&Oacute;' => 'Ó',
 453:                     '&Ocirc;'    => 'Ô',
 454:                     '&Ograve;' => 'Ò',
 455:                     '&Oslash;' => 'Ø',
 456:                     '&Otilde;' => 'Õ',
 457:                     '&Ouml;'     => 'Ö',
 458:                     '&THORN;'    => 'Þ',
 459:                     '&Uacute;' => 'Ú',
 460:                     '&Ucirc;'    => 'Û',
 461:                     '&Ugrave;' => 'Ù',
 462:                     '&Uuml;'     => 'Ü',
 463:                     '&Yacute;' => 'Ý',
 464:                     '&Yuml;'     => 'Ÿ',
 465:                     '&aacute;' => 'á',
 466:                     '&acirc;'    => 'â',
 467:                     '&acute;'    => '´',
 468:                     '&aelig;'    => 'æ',
 469:                     '&agrave;' => 'à',
 470:                     '&amp;'      => '&',
 471:                     '&aring;'    => 'å',
 472:                     '&atilde;' => 'ã',
 473:                     '&auml;'     => 'ä',
 474:                     '&brvbar;' => '¦',
 475:                     '&ccedil;' => 'ç',
 476:                     '&cedil;'    => '¸',
 477:                     '&cent;'     => '¢',
 478:                     '&clubs;'    => '♣',
 479:                     '&copy;'     => '©',
 480:                     '&curren;' => '¤',
 481:                     '&dagger;' => '†',
 482:                     '&darr;'     => '↓',
 483:                     '&dbquo;'    => '„',
 484:                     '&deg;'      => '°',
 485:                     '&diams;'    => '♦',
 486:                     '&divide;' => '÷',
 487:                     '&eacute;' => 'é',
 488:                     '&ecirc;'    => 'ê',
 489:                     '&egrave;' => 'è',
 490:                     '&eth;'      => 'ð',
 491:                     '&euml;'     => 'ë',
 492:                     '&euro;'     => '€',
 493:                     '&frac12;' => '½',
 494:                     '&frac14;' => '¼',
 495:                     '&frac34;' => '¾',
 496:                     '&gt;'       => '>',
 497:                     '&hearts;' => '♥',
 498:                     '&iacute;' => 'í',
 499:                     '&icirc;'    => 'î',
 500:                     '&iexcl;'    => '¡',
 501:                     '&igrave;' => 'ì',
 502:                     '&iquest;' => '¿',
 503:                     '&iuml;'     => 'ï',
 504:                     '&laquo;'    => '«',
 505:                     '&larr;'     => '←',
 506:                     '&ldquo;'    => '“',
 507:                     '&lsaquo;' => '‹',
 508:                     '&lsquo;'    => '‘',
 509:                     '&lt;'       => '<',
 510:                     '&macr;'     => '¯',
 511:                     '&mdash;'    => '—',
 512:                     '&micro;'    => 'µ',
 513:                     '&middot;' => '·',
 514:                     '&ndash;'    => '–',
 515:                     '&not;'      => '¬',
 516:                     '&ntilde;' => 'ñ',
 517:                     '&oacute;' => 'ó',
 518:                     '&ocirc;'    => 'ô',
 519:                     '&oelig;'    => 'œ',
 520:                     '&ograve;' => 'ò',
 521:                     '&oline;'    => '‾',
 522:                     '&ordf;'     => 'ª',
 523:                     '&ordm;'     => 'º',
 524:                     '&oslash;' => 'ø',
 525:                     '&otilde;' => 'õ',
 526:                     '&ouml;'     => 'ö',
 527:                     '&para;'     => '¶',
 528:                     '&permil;' => '‰',
 529:                     '&plusmn;' => '±',
 530:                     '&pound;'    => '£',
 531:                     '&quot;'     => '"',
 532:                     '&raquo;'    => '»',
 533:                     '&rarr;'     => '→',
 534:                     '&rdquo;'    => '”',
 535:                     '&reg;'      => '®',
 536:                     '&rsaquo;' => '›',
 537:                     '&rsquo;'    => '’',
 538:                     '&sbquo;'    => '‚',
 539:                     '&sect;'     => '§',
 540:                     '&shy;'      => '­',
 541:                     '&spades;' => '♠',
 542:                     '&sup1;'     => '¹',
 543:                     '&sup2;'     => '²',
 544:                     '&sup3;'     => '³',
 545:                     '&szlig;'    => 'ß',
 546:                     '&thorn;'    => 'þ',
 547:                     '&tilde'     => '˜',
 548:                     '&tilde;'    => '˜',
 549:                     '&times;'    => '×',
 550:                     '&trade;'    => '™',
 551:                     '&uacute;' => 'ú',
 552:                     '&uarr;'     => '↑',
 553:                     '&ucirc;'    => 'û',
 554:                     '&ugrave;' => 'ù',
 555:                     '&uml;'      => '¨',
 556:                     '&uuml;'     => 'ü',
 557:                     '&yacute;' => 'ý',
 558:                     '&yen;'      => '¥',
 559:                     '&yuml;'     => 'ÿ'
 560:     );
 561: 
 562:     /**
 563:      * Class instantiation function
 564:      *
 565:      * @return xmpMetadata_options
 566:      */
 567:     function __construct() {
 568:         setOptionDefault('xmpMetadata_suffix', 'xmp');
 569:     }
 570: 
 571:     /**
 572:      * Option interface
 573:      *
 574:      * @return array
 575:      */
 576:     function getOptionsSupported() {
 577:         global $_zp_supported_images, $_zp_extra_filetypes;
 578:         $list = $_zp_supported_images;
 579:         foreach (array('gif', 'wbmp') as $suffix) {
 580:             $key = array_search($suffix, $list);
 581:             if ($key !== false)
 582:                 unset($list[$key]);
 583:         }
 584:         natcasesort($list);
 585:         $types = array();
 586:         foreach ($_zp_extra_filetypes as $suffix => $type) {
 587:             if ($type == 'Video')
 588:                 $types[] = $suffix;
 589:         }
 590:         natcasesort($types);
 591:         $list = array_merge($list, $types);
 592:         $listi = array();
 593:         foreach ($list as $suffix) {
 594:             $listi[$suffix] = 'xmpMetadata_examine_images_' . $suffix;
 595:         }
 596:         return array(gettext('Sidecar file extension')   => array('key'  => 'xmpMetadata_suffix', 'type' => OPTION_TYPE_TEXTBOX,
 597:                                         'desc' => gettext('The plugin will look for files with <em>image_name.extension</em> and extract XMP metadata from them into the <em>image_name</em> record.')),
 598:                         gettext('Process extensions')            => array('key'              => 'xmpMetadata_examine_imagefile', 'type'          => OPTION_TYPE_CHECKBOX_UL,
 599:                                         'checkboxes' => $listi,
 600:                                         'desc'           => gettext('If no sidecar file exists and the extension is enabled, the plugin will search within that type <em>image</em> file for an <code>XMP</code> block. <strong>Warning</strong> do not set this option unless you require it. Searching image files can be computationally intensive.'))
 601:         );
 602:     }
 603: 
 604:     /**
 605:      * Custom option handler
 606:      *
 607:      * @param string $option
 608:      * @param mixed $currentValue
 609:      */
 610:     function handleOption($option, $currentValue) {
 611: 
 612:     }
 613: 
 614:     /**
 615:      * Parses xmp metadata for interesting tags
 616:      *
 617:      * @param string $xmpdata
 618:      * @return array
 619:      */
 620:     private static function extract($xmpdata) {
 621:         $desiredtags = array(
 622:                         'EXIFLensType'                   => '<aux:Lens>',
 623:                         'EXIFLensInfo'                   => '<aux:LensInfo>',
 624:                         'EXIFArtist'                         => '<dc:creator>',
 625:                         'IPTCCopyright'                  => '<dc:rights>',
 626:                         'IPTCImageCaption'           => '<dc:description>',
 627:                         'IPTCObjectName'                 => '<dc:title>',
 628:                         'IPTCKeywords'                   => '<dc:subject>',
 629:                         'EXIFExposureTime'           => '<exif:ExposureTime>',
 630:                         'EXIFFNumber'                        => '<exif:FNumber>',
 631:                         'EXIFAperatureValue'         => '<exif:ApertureValue>',
 632:                         'EXIFExposureProgram'        => '<exif:ExposureProgram>',
 633:                         'EXIFISOSpeedRatings'        => '<exif:ISOSpeedRatings>',
 634:                         'EXIFDateTimeOriginal'   => '<exif:DateTimeOriginal>',
 635:                         'EXIFExposureBiasValue'  => '<exif:ExposureBiasValue>',
 636:                         'EXIFGPSLatitude'                => '<exif:GPSLatitude>',
 637:                         'EXIFGPSLongitude'           => '<exif:GPSLongitude>',
 638:                         'EXIFGPSAltitude'                => '<exif:GPSAltitude>',
 639:                         'EXIFGPSAltituedRef'         => '<exif:GPSAltitudeRef>',
 640:                         'EXIFMeteringMode'           => '<exif:MeteringMode>',
 641:                         'EXIFFocalLength'                => '<exif:FocalLength>',
 642:                         'EXIFContrast'                   => '<exif:Contrast>',
 643:                         'EXIFSharpness'                  => '<exif:Sharpness>',
 644:                         'EXIFExposureTime'           => '<exif:ShutterSpeedValue>',
 645:                         'EXIFSaturation'                 => '<exif:Saturation>',
 646:                         'EXIFWhiteBalance'           => '<exif:WhiteBalance>',
 647:                         'IPTCLocationCode'           => '<Iptc4xmpCore:CountryCode>',
 648:                         'IPTCSubLocation'                => '<Iptc4xmpCore:Location>',
 649:                         'rating'                                 => '<MicrosoftPhoto:Rating>',
 650:                         'IPTCSource'                         => '<photoshop:Source>',
 651:                         'IPTCCity'                           => '<photoshop:City>',
 652:                         'IPTCState'                          => '<photoshop:State>',
 653:                         'IPTCLocationName'           => '<photoshop:Country>',
 654:                         'IPTCImageHeadline'          => '<photoshop:Headline>',
 655:                         'IPTCImageCredit'                => '<photoshop:Credit>',
 656:                         'EXIFMake'                           => '<tiff:Make>',
 657:                         'EXIFModel'                          => '<tiff:Model>',
 658:                         'EXIFOrientation'                => '<tiff:Orientation>',
 659:                         'EXIFImageWidth'                 => '<tiff:ImageWidth>',
 660:                         'EXIFImageHeight'                => '<tiff:ImageLength>',
 661:                         'owner'                                  => '<zp:Owner>',
 662:                         'thumb'                                  => '<zp:Thumbnail>',
 663:                         'watermark'                          => '<zp:Watermark>',
 664:                         'watermark_use'                  => '<zp:Watermark_use>',
 665:                         'watermark_thumb'                => '<zp:Watermark_thumb>',
 666:                         'custom_data'                        => '<zp:CustomData',
 667:                         'codeblock'                          => '<zp:Codeblock>'
 668:         );
 669:         $xmp_parsed = array();
 670:         while (!empty($xmpdata)) {
 671:             $s = strpos($xmpdata, '<');
 672:             $e = strpos($xmpdata, '>', $s);
 673:             $tag = substr($xmpdata, $s, $e - $s + 1);
 674:             $xmpdata = substr($xmpdata, $e + 1);
 675:             $key = array_search($tag, $desiredtags);
 676:             if ($key !== false) {
 677:                 $close = str_replace('<', '</', $tag);
 678:                 $e = strpos($xmpdata, $close);
 679:                 $meta = trim(substr($xmpdata, 0, $e));
 680:                 $xmpdata = substr($xmpdata, $e + strlen($close));
 681:                 if (strpos($meta, '<') === false) {
 682:                     $xmp_parsed[$key] = self::decode($meta);
 683:                 } else {
 684:                     $elements = array();
 685:                     while (!empty($meta)) {
 686:                         $s = strpos($meta, '<');
 687:                         $e = strpos($meta, '>', $s);
 688:                         $tag = substr($meta, $s, $e - $s + 1);
 689:                         $meta = substr($meta, $e + 1);
 690:                         if (strpos($tag, 'rdf:li') !== false) {
 691:                             $e = strpos($meta, '</rdf:li>');
 692:                             $elements[] = self::decode(trim(substr($meta, 0, $e)));
 693:                             $meta = substr($meta, $e + 9);
 694:                         }
 695:                     }
 696:                     $xmp_parsed[$key] = $elements;
 697:                 }
 698:             } else { // look for shorthand elements
 699:                 if (strpos($tag, '<rdf:Description') !== false) {
 700:                     $meta = substr($tag, 17); // strip off the description tag leaving the elements
 701:                     while (preg_match('/^[a-zA-z0-9_]+\:[a-zA-z0-9_]+\=".*"/', $meta, $element)) {
 702:                         $item = $element[0];
 703:                         $meta = trim(substr($meta, strlen($item)));
 704:                         $i = strpos($item, '=');
 705:                         $tag = '<' . substr($item, 0, $i) . '>';
 706:                         $v = self::decode(trim(substr($item, $i + 2, -1)));
 707:                         $key = array_search($tag, $desiredtags);
 708:                         if ($key !== false) {
 709:                             $xmp_parsed[$key] = $v;
 710:                         }
 711:                     }
 712:                 }
 713:             }
 714:         }
 715:         return ($xmp_parsed);
 716:     }
 717: 
 718:     /**
 719:      * insures that the metadata is a string
 720:      *
 721:      * @param mixed $meta
 722:      * @return string
 723:      */
 724:     private static function to_string($meta) {
 725:         if (is_array($meta)) {
 726:             $meta = implode(',', $meta);
 727:         }
 728:         return trim($meta);
 729:     }
 730: 
 731:     /**
 732:      * Filter called when an album object is instantiated
 733:      * sets the sidecars to include xmp files
 734:      *
 735:      * @param $album album object
 736:      * @return $object
 737:      */
 738:     static function album_instantiate($album) {
 739:         $album->sidecars[XMP_EXTENSION] = XMP_EXTENSION;
 740:         return $album;
 741:     }
 742: 
 743:     /**
 744:      * Filter for handling album objects
 745:      *
 746:      * @param object $album
 747:      * @return object
 748:      */
 749:     static function new_album($album) {
 750:         $metadata_path = dirname($album->localpath) . '/' . basename($album->localpath) . '*';
 751:         $files = safe_glob($metadata_path);
 752:         if (count($files) > 0) {
 753:             foreach ($files as $file) {
 754:                 if (strtolower(getSuffix($file)) == XMP_EXTENSION) {
 755:                     $source = file_get_contents($file);
 756:                     $metadata = self::extract($source);
 757:                     if (array_key_exists('IPTCImageCaption', $metadata)) {
 758:                         $album->setDesc(self::to_string($metadata['IPTCImageCaption']));
 759:                     }
 760:                     if (array_key_exists('IPTCImageHeadline', $metadata)) {
 761:                         $album->setTitle(self::to_string($metadata['IPTCImageHeadline']));
 762:                     }
 763:                     if (array_key_exists('IPTCLocationName', $metadata)) {
 764:                         $album->setLocation(self::to_string($metadata['IPTCLocationName']));
 765:                     }
 766:                     if (array_key_exists('IPTCKeywords', $metadata)) {
 767:                         $tags = $metadata['IPTCKeywords'];
 768:                         if (!is_array($tags)) {
 769:                             $tags = explode(',', $tags);
 770:                         }
 771:                         $album->setTags($tags);
 772:                     }
 773:                     if (array_key_exists('EXIFDateTimeOriginal', $metadata)) {
 774:                         $album->setDateTime($metadata['EXIFDateTimeOriginal']);
 775:                     }
 776:                     if (array_key_exists('thumb', $metadata)) {
 777:                         $album->setThumb($metadata['thumb']);
 778:                     }
 779:                     if (array_key_exists('owner', $metadata)) {
 780:                         $album->setOwner($metadata['owner']);
 781:                     }
 782:                     if (array_key_exists('custom_data', $metadata)) {
 783:                         $album->setCustomData($metadata['custom_data']);
 784:                     }
 785:                     if (array_key_exists('codeblock', $metadata)) {
 786:                         $album->setCodeblock($metadata['codeblock']);
 787:                     }
 788:                     if (array_key_exists('watermark', $metadata)) {
 789:                         $album->setWatermark($metadata['watermark']);
 790:                     }
 791:                     if (array_key_exists('watermark_thumb', $metadata)) {
 792:                         $album->setWatermarkThumb($metadata['watermark_thumb']);
 793:                     }
 794:                     if (array_key_exists('rating', $metadata)) {
 795:                         $v = min(getoption('rating_stars_count'), $metadata['rating']) * min(1, getOption('rating_split_stars'));
 796:                         $album->set('total_value', $v);
 797:                         $album->set('rating', $v);
 798:                         $album->set('total_votes', 1);
 799:                     }
 800:                     $album->save();
 801:                     break;
 802:                 }
 803:             }
 804:             return $album;
 805:         }
 806:     }
 807: 
 808:     /**
 809:      * Finds and returns xmp metadata
 810:      *
 811:      * @param int $j
 812:      * @return string
 813:      */
 814:     private static function extractXMP($f) {
 815:         if (preg_match('~<.*?xmpmeta~', $f, $m)) {
 816:             $open = $m[0];
 817:             $close = str_replace('<', '</', $open);
 818:             $j = strpos($f, $open);
 819:             if ($j !== false) {
 820:                 $k = strpos($f, $close, $j + 4);
 821:                 $meta = substr($f, $j, $k + 14 - $j);
 822:                 $l = 0;
 823:                 return $meta;
 824:             }
 825:         }
 826:         return false;
 827:     }
 828: 
 829:     /**
 830:      * convert a fractional representation to something more user friendly
 831:      *
 832:      * @param $element string
 833:      * @return string
 834:      */
 835:     private static function rationalNum($element) {
 836:         // deal with the fractional representation
 837:         $n = explode('/', $element);
 838:         $v = sprintf('%f', $n[0] / $n[1]);
 839:         for ($i = strlen($v) - 1; $i > 1; $i--) {
 840:             if ($v{$i} != '0')
 841:                 break;
 842:         }
 843:         if ($v{$i} == '.')
 844:             $i--;
 845:         return substr($v, 0, $i + 1);
 846:     }
 847: 
 848:     private static function encode($str) {
 849:         return strtr($str, array_flip(self::$XML_trans));
 850:     }
 851: 
 852:     private static function decode($str) {
 853:         return strtr($str, self::$XML_trans);
 854:     }
 855: 
 856:     static function image_instantiate($image) {
 857:         $image->sidecars[XMP_EXTENSION] = XMP_EXTENSION;
 858:         return $image;
 859:     }
 860: 
 861:     /**
 862:      * Filter for handling image objects
 863:      *
 864:      * @param object $image
 865:      * @return object
 866:      */
 867:     static function new_image($image) {
 868:         global $_zp_exifvars;
 869:         $source = '';
 870:         $metadata_path = '';
 871:         $files = safe_glob(substr($image->localpath, 0, strrpos($image->localpath, '.')) . '.*');
 872:         if (count($files) > 0) {
 873:             foreach ($files as $file) {
 874:                 if (strtolower(getSuffix($file)) == XMP_EXTENSION) {
 875:                     $metadata_path = $file;
 876:                     break;
 877:                 }
 878:             }
 879:         }
 880:         if (!empty($metadata_path)) {
 881:             $source = self::extractXMP(file_get_contents($metadata_path));
 882:         } else if (getOption('xmpMetadata_examine_images_' . strtolower(substr(strrchr($image->localpath, "."), 1)))) {
 883:             $f = file_get_contents($image->localpath);
 884:             $l = filesize($image->localpath);
 885:             $abort = 0;
 886:             $i = 0;
 887:             while ($i < $l && $abort < 200 && !$source) {
 888:                 $tag = bin2hex(substr($f, $i, 2));
 889:                 $size = hexdec(bin2hex(substr($f, $i + 2, 2)));
 890:                 switch ($tag) {
 891:                     case 'ffe1': // EXIF
 892:                     case 'ffe2': // EXIF extension
 893:                     case 'fffe': // COM
 894:                     case 'ffe0': // IPTC marker
 895:                         $source = self::extractXMP($f);
 896:                         $i = $i + $size + 2;
 897:                         $abort = 0;
 898:                         break;
 899:                     default:
 900:                         if ($f{$i} == '<') {
 901:                             $source = self::extractXMP($f);
 902:                         }
 903:                         $i = $i + 1;
 904:                         $abort++;
 905:                         break;
 906:                 }
 907:             }
 908:         }
 909:         if (!empty($source)) {
 910:             $metadata = self::extract($source);
 911:             $image->set('hasMetadata', count($metadata > 0));
 912:             foreach ($metadata as $field => $element) {
 913:                 if (array_key_exists($field, $_zp_exifvars)) {
 914:                     if (!$_zp_exifvars[$field][5]) {
 915:                         continue; //    the field has been disabled
 916:                     }
 917:                 }
 918:                 $v = self::to_string($element);
 919: 
 920:                 switch ($field) {
 921:                     case 'EXIFDateTimeOriginal':
 922:                         $image->setDateTime($element);
 923:                         break;
 924:                     case 'IPTCImageCaption':
 925:                         $image->setDesc($v);
 926:                         break;
 927:                     case 'IPTCCity':
 928:                         $image->setCity($v);
 929:                         break;
 930:                     case 'IPTCState':
 931:                         $image->setState($v);
 932:                         break;
 933:                     case 'IPTCLocationName':
 934:                         $image->setCountry($v);
 935:                         break;
 936:                     case 'IPTCSubLocation':
 937:                         $image->setLocation($v);
 938:                         break;
 939:                     case 'EXIFExposureTime':
 940:                         $v = formatExposure(self::rationalNum($element));
 941:                         break;
 942:                     case 'EXIFFocalLength':
 943:                         $v = self::rationalNum($element) . ' mm';
 944:                         break;
 945:                     case 'EXIFAperatureValue':
 946:                     case 'EXIFFNumber':
 947:                         $v = 'f/' . self::rationalNum($element);
 948:                         break;
 949:                     case 'EXIFExposureBiasValue':
 950:                     case 'EXIFGPSAltitude':
 951:                         $v = self::rationalNum($element);
 952:                         break;
 953:                     case 'EXIFGPSLatitude':
 954:                     case 'EXIFGPSLongitude':
 955:                         $ref = substr($element, -1, 1);
 956:                         $image->set($field . 'Ref', $ref);
 957:                         $element = substr($element, 0, -1);
 958:                         $n = explode(',', $element);
 959:                         if (count($n) == 3) {
 960:                             $v = $n[0] + ($n[1] + ($n[2] / 60) / 60);
 961:                         } else {
 962:                             $v = $n[0] + $n[1] / 60;
 963:                         }
 964:                         break;
 965:                     case 'rating':
 966:                         $v = min(getoption('rating_stars_count'), $v) * min(1, getOption('rating_split_stars'));
 967:                         $image->set('total_value', $v);
 968:                         $image->set('total_votes', 1);
 969:                         break;
 970:                     case 'watermark':
 971:                     case 'watermark_use':
 972:                     case 'custom_data':
 973:                     case 'codeblock':
 974:                     case 'owner':
 975:                         $image->set($field, $v);
 976:                         break;
 977:                     case 'IPTCKeywords':
 978:                         if (!is_array($element)) {
 979:                             $element = explode(',', $element);
 980:                         }
 981:                         $image->setTags($element);
 982:                         break;
 983:                 }
 984:                 if (array_key_exists($field, $_zp_exifvars)) {
 985:                     $image->set($field, $v);
 986:                 }
 987:             }
 988:             $image->save();
 989:         }
 990:         return $image;
 991:     }
 992: 
 993:     static function sidecars($types) {
 994:         $types[] = XMP_EXTENSION;
 995:         return $types;
 996:     }
 997: 
 998:     static function putXMP($object, $prefix) {
 999:         if (isset($_POST['xmpMedadataPut_' . $prefix])) {
1000:             self::publish($object);
1001:         }
1002:         return $object;
1003:     }
1004: 
1005:     static function publish($object) {
1006:         $desiredtags = array('copyright'                 => '<dc:rights>',
1007:                         'desc'                       => '<dc:description>',
1008:                         'title'                      => '<dc:title>',
1009:                         'tags'                       => '<dc:subject>',
1010:                         'location'               => '<Iptc4xmpCore:Location>',
1011:                         'city'                       => '<photoshop:City>',
1012:                         'state'                      => '<photoshop:State>',
1013:                         'country'                    => '<photoshop:Country>',
1014:                         'title'                      => '<photoshop:Headline>',
1015:                         'credit'                     => '<photoshop:Credit>',
1016:                         'thumb'                      => '<zp:Thumbnail>',
1017:                         'owner'                      => '<zp:Owner>',
1018:                         'watermark'              => '<zp:Watermark>',
1019:                         'watermark_use'      => '<zp:Watermark_use>',
1020:                         'watermark_thumb'    => '<zp:Watermark_thumb>',
1021:                         'custom_data'            => '<zp:CustomData>',
1022:                         'codeblock'              => '<zp:Codeblock>',
1023:                         'date'                       => '<exif:DateTimeOriginal>',
1024:                         'rating'                     => '<MicrosoftPhoto:Rating>'
1025:         );
1026:         $process = array('dc', 'Iptc4xmpCore', 'photoshop', 'xap');
1027:         if (isAlbumClass($object)) {
1028:             $file = rtrim($object->localpath, '/');
1029:             $file .= '.xmp';
1030:         } else {
1031:             $file = stripSuffix($object->localpath) . '.xmp';
1032:         }
1033:         @chmod($file, 0777);
1034:         $f = fopen($file, 'w');
1035:         fwrite($f, '<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.2-c020 1.124078, Tue Sep 11 2007 23:21:40 ">' . "\n");
1036:         fwrite($f, ' <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">' . "\n");
1037:         $last_element = $special = $output = false;
1038:         foreach ($desiredtags as $field => $elementXML) {
1039:             $elementXML = substr($elementXML, 1, -1);
1040:             if ($last_element != $elementXML) {
1041:                 if ($output) {
1042:                     fwrite($f, '  </rdf:Description>' . "\n");
1043:                     fwrite($f, '  <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">' . "\n");
1044:                 }
1045:                 $last_element = $elementXML;
1046:                 $output = false;
1047:             }
1048:             $v = self::encode($object->get($field));
1049:             $tag = $elementXML;
1050:             switch ($elementXML) {
1051:                 case 'dc:creator':
1052:                     $special = 'rdf:Seq';
1053:                     $tag = 'rdf:li';
1054:                     if ($v) {
1055:                         fwrite($f, "   <$elementXML>\n");
1056:                         fwrite($f, "    <$special>\n");
1057:                         fwrite($f, "     <$tag>$v</$tag>\n");
1058:                         fwrite($f, "    </$special>\n");
1059:                         fwrite($f, "   </$elementXML>\n");
1060:                         $output = true;
1061:                     }
1062:                     break;
1063:                 case 'dc:rights':
1064:                 case 'xapRights:UsageTerms':
1065:                     $special = 'rdf:Alt';
1066:                     $tag = 'rdf:li';
1067:                     if ($v) {
1068:                         fwrite($f, "   <$elementXML>\n");
1069:                         fwrite($f, "    <$special>\n");
1070:                         fwrite($f, "     <$tag>$v</$tag>\n");
1071:                         fwrite($f, "    </$special>\n");
1072:                         fwrite($f, "   </$elementXML>\n");
1073:                         $output = true;
1074:                     }
1075:                     break;
1076:                 case 'dc:subject':
1077:                     $tags = $object->getTags();
1078:                     if (!empty($tags)) {
1079:                         fwrite($f, "   <$elementXML>\n");
1080:                         fwrite($f, "    <rdf:Bag>\n");
1081:                         foreach ($tags as $tag) {
1082:                             fwrite($f, "     <rdf:li>" . self::encode($tag) . "</rdf:li>\n");
1083:                         }
1084:                         fwrite($f, "    </rdf:Bag>\n");
1085:                         fwrite($f, "   </$elementXML>\n");
1086:                         $output = true;
1087:                     }
1088:                     break;
1089:                 default:
1090:                     if ($v) {
1091:                         fwrite($f, "   <$tag>$v</$tag>\n");
1092:                         $output = true;
1093:                     }
1094:                     break;
1095:             }
1096:         }
1097:         fwrite($f, '  </rdf:Description>' . "\n");
1098:         fwrite($f, ' </rdf:RDF>' . "\n");
1099:         fwrite($f, '</x:xmpmeta>' . "\n");
1100:         fclose($f);
1101:         clearstatcache();
1102:         @chmod($file, FILE_MOD);
1103:         return gettext('Metadata exported');
1104:     }
1105: 
1106:     static function create($html, $object, $prefix) {
1107:         if ($html)
1108:             $html .= '<hr />';
1109:         $html .= '<label><input type="checkbox" name="xmpMedadataPut_' . $prefix . '" value="1" /> ' . gettext('Export metadata info to XMP sidecar.') . '</label>';
1110:         return $html;
1111:     }
1112: 
1113:     static function bulkActions($actions) {
1114:         return array_merge($actions, array(gettext('Export Metadata') => 'xmpMetadataPublish'));
1115:     }
1116: 
1117: }
1118: 
1119: ?>
Zenphoto doc API documentation generated by ApiGen