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:  * Library for image handling using the Imagick library of functions
  5:  *
  6:  * Requires Imagick 3.0.0+ and ImageMagick 6.3.8+
  7:  *
  8:  * @package core
  9:  */
 10: // force UTF-8 Ø
 11: 
 12: define('IMAGICK_REQUIRED_VERSION', '3.0.0');
 13: define('IMAGEMAGICK_REQUIRED_VERSION', '6.3.8');
 14: 
 15: $_imagick_version = phpversion('imagick');
 16: $_imagick_version_pass = version_compare($_imagick_version, IMAGICK_REQUIRED_VERSION, '>=');
 17: 
 18: $_imagemagick_version = '';
 19: $_imagemagick_version_pass = false;
 20: 
 21: $_zp_imagick_present = extension_loaded('imagick') && $_imagick_version_pass;
 22: 
 23: if ($_zp_imagick_present) {
 24:     @$_imagemagick_version = Imagick::getVersion();
 25:     preg_match('/\d+(\.\d+)*/', $_imagemagick_version['versionString'], $matches);
 26: 
 27:     $_imagemagick_version['versionNumber'] = $matches[0];
 28:     $_imagemagick_version_pass = version_compare($_imagemagick_version['versionNumber'], IMAGEMAGICK_REQUIRED_VERSION, '>=');
 29: 
 30:     $_zp_imagick_present &= $_imagick_version_pass;
 31:     unset($matches);
 32: }
 33: 
 34: $_zp_graphics_optionhandlers += array('lib_Imagick_Options' => new lib_Imagick_Options());
 35: 
 36: /**
 37:  * Option class for lib-Imagick
 38:  */
 39: class lib_Imagick_Options {
 40: 
 41:     public static $ignore_size = 0;
 42: 
 43:     function __construct() {
 44:         setOptionDefault('magick_max_height', self::$ignore_size);
 45:         setOptionDefault('magick_max_width', self::$ignore_size);
 46: 
 47:         if (!sanitize_numeric(getOption('magick_max_height'))) {
 48:             setOption('magick_max_height', self::$ignore_size);
 49:         }
 50: 
 51:         if (!sanitize_numeric(getOption('magick_max_width'))) {
 52:             setOption('magick_max_width', self::$ignore_size);
 53:         }
 54:     }
 55: 
 56:     /**
 57:      * Standard option interface
 58:      *
 59:      * @return array
 60:      */
 61:     function getOptionsSupported() {
 62:         global $_zp_imagick_present, $_zp_graphics_optionhandlers;
 63:         if ($disabled = $this->canLoadMsg()) {
 64:             setOption('use_imagick', 0, true);
 65:         }
 66:         $imagickOptions = array(
 67:                         gettext('Enable Imagick') => array(
 68:                                         'key'            => 'use_imagick',
 69:                                         'type'       => OPTION_TYPE_CHECKBOX,
 70:                                         'order'      => 0,
 71:                                         'disabled' => $disabled,
 72:                                         'desc'       => ($disabled) ? '<p class="notebox">' . $disabled . '</p>' : gettext('Your PHP has support for Imagick. Check this option if you wish to use the Imagick graphics library.')
 73:                         )
 74:         );
 75: 
 76:         if (!$disabled) {
 77:             $imagickOptions += array(
 78:                             gettext('Max height')    => array(
 79:                                             'key'        => 'magick_max_height',
 80:                                             'type'   => OPTION_TYPE_TEXTBOX,
 81:                                             'order'  => 1,
 82:                                             'desc'   => sprintf(gettext('The maximum height used by the site for processed images. Set to %d for unconstrained. Default is <strong>%d</strong>'), self::$ignore_size, self::$ignore_size)
 83:                             ),
 84:                             gettext('Max width')     => array(
 85:                                             'key'        => 'magick_max_width',
 86:                                             'type'   => OPTION_TYPE_TEXTBOX,
 87:                                             'order'  => 2,
 88:                                             'desc'   => sprintf(gettext('The maximum width used by the site for processed images. Set to %d for unconstrained. Default is <strong>%d</strong>.'), self::$ignore_size, self::$ignore_size)
 89:                             )
 90:             );
 91:         }
 92: 
 93:         return $imagickOptions;
 94:     }
 95: 
 96:     function canLoadMsg() {
 97:         global $_imagick_version_pass, $_imagemagick_version_pass;
 98: 
 99:         if (extension_loaded('imagick')) {
100:             if (!$_imagick_version_pass) {
101:                 return sprintf(gettext('The <strong><em>Imagick</em></strong> library version must be <strong>%s</strong> or later.'), IMAGICK_REQUIRED_VERSION);
102:             }
103: 
104:             if (!$_imagemagick_version_pass) {
105:                 return sprintf(gettext('The <strong><em>ImageMagick</em></strong> binary version must be <strong>%s</strong> or later.'), IMAGEMAGICK_REQUIRED_VERSION);
106:             }
107:         } else {
108:             return gettext('The <strong><em>Imagick</em></strong> extension is not available.');
109:         }
110: 
111:         return '';
112:     }
113: 
114: }
115: 
116: /**
117:  * Zenphoto image manipulation functions using the Imagick library
118:  */
119: if ($_zp_imagick_present && (getOption('use_imagick') || !extension_loaded('gd'))) {
120:     $_lib_Imagick_info = array();
121:     $_lib_Imagick_info['Library'] = 'Imagick';
122:     $_lib_Imagick_info['Library_desc'] = sprintf(gettext('PHP Imagick library <em>%s</em>') . '<br /><em>%s</em>', $_imagick_version, $_imagemagick_version['versionString']);
123: 
124:     $_imagick_format_whitelist = array(
125:                     'BMP'        => 'jpg', 'BMP2'    => 'jpg', 'BMP3'    => 'jpg',
126:                     'GIF'        => 'gif', 'GIF87'   => 'gif',
127:                     'JPG'        => 'jpg', 'JPEG'    => 'jpg',
128:                     'PNG'        => 'png', 'PNG8'    => 'png', 'PNG24'   => 'png', 'PNG32'   => 'png',
129:                     'TIFF'   => 'jpg', 'TIFF64' => 'jpg'
130:     );
131: 
132:     $_imagick = new Imagick();
133:     $_imagick_formats = $_imagick->queryFormats();
134:     foreach ($_imagick_formats as $format) {
135:         if (array_key_exists($format, $_imagick_format_whitelist)) {
136:             $_lib_Imagick_info[$format] = $_imagick_format_whitelist[$format];
137:         }
138:     }
139:     unset($_imagick_format_whitelist);
140:     unset($_imagick_formats);
141:     unset($_imagick);
142:     unset($format);
143: 
144:     if (DEBUG_IMAGE) {
145:         debugLog('Loading ' . $_lib_Imagick_info['Library']);
146:     }
147: 
148:     /**
149:      * Takes an image filename and returns an Imagick image object
150:      *
151:      * @param string $imgfile the full path and filename of the image to load
152:      * @return Imagick
153:      */
154:     function zp_imageGet($imgfile) {
155:         global $_lib_Imagick_info;
156: 
157:         if (array_key_exists(strtoupper(getSuffix($imgfile)), $_lib_Imagick_info)) {
158:             $image = new Imagick();
159: 
160:             $maxHeight = getOption('magick_max_height');
161:             $maxWidth = getOption('magick_max_width');
162: 
163:             if ($maxHeight > lib_Imagick_Options::$ignore_size && $maxWidth > lib_Imagick_Options::$ignore_size) {
164:                 $image->setOption('jpeg:size', $maxWidth . 'x' . $maxHeight);
165:             }
166: 
167:             $image->readImage(filesystemToInternal($imgfile));
168: 
169:             //Generic CMYK to RGB conversion
170:             if ($image->getImageColorspace() == Imagick::COLORSPACE_CMYK) {
171:                 $image->transformimagecolorspace(Imagick::COLORSPACE_SRGB);
172:             }
173: 
174:             return $image;
175:         }
176: 
177:         return false;
178:     }
179: 
180:     /**
181:      * Outputs an image resource as a given type
182:      *
183:      * @param Imagick $im
184:      * @param string $type
185:      * @param string $filename
186:      * @param int $qual
187:      * @return bool
188:      */
189:     function zp_imageOutput($im, $type, $filename = NULL, $qual = 75) {
190:         $interlace = getOption('image_interlace');
191:         $qual = max(min($qual, 100), 0);
192: 
193:         $im->setImageFormat($type);
194: 
195:         switch ($type) {
196:             case 'gif':
197:                 $im->setImageCompression(Imagick::COMPRESSION_LZW);
198:                 $im->setImageCompressionQuality($qual);
199: 
200:                 if ($interlace) {
201:                     $im->setInterlaceScheme(Imagick::INTERLACE_GIF);
202:                 }
203: 
204:                 break;
205: 
206:             case 'jpeg':
207:             case 'jpg':
208:                 $im->setImageCompression(Imagick::COMPRESSION_JPEG);
209:                 $im->setImageCompressionQuality($qual);
210: 
211:                 if ($interlace) {
212:                     $im->setInterlaceScheme(Imagick::INTERLACE_JPEG);
213:                 }
214: 
215:                 break;
216: 
217:             case 'png':
218:                 $im->setImageCompression(Imagick::COMPRESSION_ZIP);
219:                 $im->setImageCompressionQuality($qual);
220: 
221:                 if ($interlace) {
222:                     $im->setInterlaceScheme(Imagick::INTERLACE_PNG);
223:                 }
224: 
225:                 break;
226:         }
227: 
228:         $im->optimizeImageLayers();
229: 
230:         if ($filename == NULL) {
231:             header('Content-Type: image/' . $type);
232: 
233:             return print $im->getImagesBlob();
234:         }
235: 
236:         return $im->writeImages(filesystemToInternal($filename), true);
237:     }
238: 
239:     /**
240:      * Creates a true color image
241:      *
242:      * @param int $w the width of the image
243:      * @param int $h the height of the image
244:      * @return Imagick
245:      */
246:     function zp_createImage($w, $h) {
247:         $im = new Imagick();
248:         $im->newImage($w, $h, 'none');
249:         $im->setImageType(Imagick::IMGTYPE_TRUECOLORMATTE);
250: 
251:         return $im;
252:     }
253: 
254:     /**
255:      * Fills an image area
256:      *
257:      * @param Imagick $image
258:      * @param int $x
259:      * @param int $y
260:      * @param color $color
261:      * @return bool
262:      */
263:     function zp_imageFill($image, $x, $y, $color) {
264:         $target = $image->getImagePixelColor($x, $y);
265: 
266:         return $image->floodFillPaintImage($color, 1, $target, $x, $y, false);
267:     }
268: 
269:     /**
270:      * Sets the transparency color
271:      *
272:      * @param Imagick $image
273:      * @param color $color
274:      * @return bool
275:      */
276:     function zp_imageColorTransparent($image, $color) {
277:         return $image->transparentPaintImage($color, 0.0, 1, false);
278:     }
279: 
280:     /**
281:      * Copies an image canvas
282:      *
283:      * @param Imagick $imgCanvas destination canvas
284:      * @param Imagick $img source canvas
285:      * @param int $dest_x destination x
286:      * @param int $dest_y destination y
287:      * @param int $src_x source x
288:      * @param int $src_y source y
289:      * @param int $w width
290:      * @param int $h height
291:      * @return bool
292:      */
293:     function zp_copyCanvas($imgCanvas, $img, $dest_x, $dest_y, $src_x, $src_y, $w, $h) {
294:         $img->cropImage($w, $h, $src_x, $src_y);
295:         $result = true;
296:         foreach ($imgCanvas as $frame) {
297:             $result &= $frame->compositeImage($img, Imagick::COMPOSITE_OVER, $dest_x, $dest_y);
298:         }
299:         return $result;
300:     }
301: 
302:     /**
303:      * Resamples an image to a new copy
304:      *
305:      * @param Imagick $dst_image
306:      * @param Imagick $src_image
307:      * @param int $dst_x
308:      * @param int $dst_y
309:      * @param int $src_x
310:      * @param int $src_y
311:      * @param int $dst_w
312:      * @param int $dst_h
313:      * @param int $src_w
314:      * @param int $src_h
315:      * @return bool
316:      */
317:     function zp_resampleImage($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {
318:         foreach ($src_image->getImageProfiles() as $name => $profile) {
319:             $dst_image->profileImage($name, $profile);
320:         }
321:         $result = true;
322:         $src_image = $src_image->coalesceImages();
323:         foreach ($src_image as $frame) {
324:             $frame->cropImage($src_w, $src_h, $src_x, $src_y);
325:             $frame->setImagePage(0, 0, 0, 0);
326:             $frame->resizeImage($dst_w, $dst_h, Imagick::FILTER_LANCZOS, 1);
327: 
328:             $dst_image->setImageDelay($frame->getImageDelay());
329:             $result &= $dst_image->compositeImage($frame, Imagick::COMPOSITE_OVER, $dst_x, $dst_y);
330: 
331:             if ($dst_image->getNumberImages() < $src_image->getNumberImages()) {
332:                 $result &= $dst_image->addImage(zp_createImage($dst_image->getImageWidth(), $dst_image->getImageHeight()));
333:             }
334:             if (!$result) {
335:                 break;
336:             }
337:         }
338:         return $result;
339:     }
340: 
341:     /**
342:      * Sharpens an image using an Unsharp Mask filter.
343:      *
344:      * @param Imagick $img the image to sharpen
345:      * @param int $amount the strength of the sharpening effect
346:      * @param int $radius the pixel radius of the sharpening mask
347:      * @param int $threshold the color difference threshold required for sharpening
348:      * @return Imagick
349:      */
350:     function zp_imageUnsharpMask($img, $amount, $radius, $threshold) {
351:         $img->unsharpMaskImage($radius, 0.1, $amount, $threshold);
352: 
353:         return $img;
354:     }
355: 
356:     /**
357:      * Resize a file with transparency to given dimensions and still retain the alpha channel information
358:      *
359:      * @param Imagick $src
360:      * @param int $w
361:      * @param int $h
362:      * @return Imagick
363:      */
364:     function zp_imageResizeAlpha($src, $w, $h) {
365:         $src->scaleImage($w, $h);
366: 
367:         return $src;
368:     }
369: 
370:     /**
371:      * Returns true if Imagick library is configured with image rotation support
372:      *
373:      * @return bool
374:      */
375:     function zp_imageCanRotate() {
376:         return true;
377:     }
378: 
379:     /**
380:      * Rotates an image resource according to its Orientation setting
381:      *
382:      * @param Imagick $im
383:      * @param int $rotate
384:      * @return Imagick
385:      */
386:     function zp_rotateImage($im, $rotate) {
387:         $im->rotateImage('none', 360 - $rotate);
388:         return $im;
389:     }
390: 
391:     /**
392:      * Returns the image height and width
393:      *
394:      * @param string $filename
395:      * @param array $imageinfo
396:      * @return array
397:      */
398:     function zp_imageDims($filename) {
399:         $ping = new Imagick();
400: 
401:         if ($ping->pingImage(filesystemToInternal($filename))) {
402:             return array('width' => $ping->getImageWidth(), 'height' => $ping->getImageHeight());
403:         }
404: 
405:         return false;
406:     }
407: 
408:     /**
409:      * Returns the IPTC data of an image
410:      *
411:      * @param string $filename
412:      * @return string
413:      */
414:     function zp_imageIPTC($filename) {
415:         $ping = new Imagick();
416: 
417:         if ($ping->pingImage(filesystemToInternal($filename))) {
418:             try {
419:                 return $ping->getImageProfile('iptc');
420:             } catch (ImagickException $e) {
421:                 // IPTC profile does not exist
422:             }
423:         }
424: 
425:         return false;
426:     }
427: 
428:     /**
429:      * Returns the width of an image resource
430:      *
431:      * @param Imagick $im
432:      * @return int
433:      */
434:     function zp_imageWidth($im) {
435:         return $im->getImageWidth();
436:     }
437: 
438:     /**
439:      * Returns the height of an image resource
440:      *
441:      * @param Imagick $im
442:      * @return int
443:      */
444:     function zp_imageHeight($im) {
445:         return $im->getImageHeight();
446:     }
447: 
448:     /**
449:      * Does a copy merge of two image resources
450:      *
451:      * @param Imagick $dst_im
452:      * @param Imagick $src_im
453:      * @param int $dst_x
454:      * @param int $dst_y
455:      * @param int $src_x
456:      * @param int $src_y
457:      * @param int $src_w
458:      * @param int $src_h
459:      * @param int $pct
460:      * @return bool
461:      */
462:     function zp_imageMerge($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct) {
463:         $src_im->cropImage($src_w, $src_h, $src_x, $src_y);
464:         $src_im->setImageOpacity($pct / 100);
465: 
466:         return $dst_im->compositeImage($src_im, Imagick::COMPOSITE_OVER, $dst_x, $dst_y);
467:     }
468: 
469:     /**
470:      * Creates a grayscale image
471:      *
472:      * @param Imagick $image The image to grayscale
473:      * @return Imagick
474:      */
475:     function zp_imageGray($image) {
476:         $image->setType(Imagick::IMGTYPE_GRAYSCALE);
477:         $image->setImageColorspace(Imagick::COLORSPACE_GRAY);
478:         $image->setImageProperty('exif:ColorSpace', Imagick::IMGTYPE_GRAYSCALE);
479: 
480:         return $image;
481:     }
482: 
483:     /**
484:      * Destroys an image resource
485:      *
486:      * @param Imagick $im
487:      * @return bool
488:      */
489:     function zp_imageKill($im) {
490:         return $im->destroy();
491:     }
492: 
493:     /**
494:      * Returns an RGB color identifier
495:      *
496:      * @param Imagick $image
497:      * @param int $red
498:      * @param int $green
499:      * @param int $blue
500:      * @return ImagickPixel
501:      */
502:     function zp_colorAllocate($image, $red, $green, $blue) {
503:         return new ImagickPixel("rgb($red, $green, $blue)");
504:     }
505: 
506:     /**
507:      * Renders a string into the image
508:      *
509:      * @param Imagick $image
510:      * @param ImagickDraw $font
511:      * @param int $x
512:      * @param int $y
513:      * @param string $string
514:      * @param ImagickPixel $color
515:      * @return bool
516:      */
517:     function zp_writeString($image, $font, $x, $y, $string, $color) {
518:         $font->setStrokeColor($color);
519: 
520:         return $image->annotateImage($font, $x, $y + $image->getImageHeight() / 2, 0, $string);
521:     }
522: 
523:     /**
524:      * Creates a rectangle
525:      *
526:      * @param Imagick $image
527:      * @param int $x1
528:      * @param int $y1
529:      * @param int $x2
530:      * @param int $y2
531:      * @param ImagickPixel $color
532:      * @return bool
533:      */
534:     function zp_drawRectangle($image, $x1, $y1, $x2, $y2, $color) {
535:         return $image->borderImage($color, 1, 1);
536:     }
537: 
538:     /**
539:      * Returns array of graphics library info
540:      *
541:      * @return array
542:      */
543:     function zp_graphicsLibInfo() {
544:         global $_lib_Imagick_info;
545: 
546:         return $_lib_Imagick_info;
547:     }
548: 
549:     /**
550:      * Returns a list of available fonts
551:      *
552:      * @return array
553:      */
554:     function zp_getFonts() {
555:         global $_imagick_fontlist;
556: 
557:         if (!is_array($_imagick_fontlist)) {
558:             @$_imagick_fontlist = Imagick::queryFonts();
559:             $_imagick_fontlist = array('system' => '') + array_combine($_imagick_fontlist, $_imagick_fontlist);
560: 
561:             $basefile = SERVERPATH . '/' . USER_PLUGIN_FOLDER . '/imagick_fonts/';
562: 
563:             if (is_dir($basefile)) {
564:                 chdir($basefile);
565:                 $filelist = safe_glob('*.ttf');
566: 
567:                 foreach ($filelist as $file) {
568:                     $key = filesystemToInternal(str_replace('.ttf', '', $file));
569:                     $_imagick_fontlist[$key] = getcwd() . '/' . $file;
570:                 }
571:             }
572: 
573:             chdir(dirname(__FILE__));
574:         }
575: 
576:         return $_imagick_fontlist;
577:     }
578: 
579:     /**
580:      * Loads a font and returns an object with the font loaded
581:      *
582:      * @param string $font
583:      * @return ImagickDraw
584:      */
585:     function zp_imageLoadFont($font = NULL, $size = 18) {
586:         $draw = new ImagickDraw();
587: 
588:         if (!empty($font)) {
589:             $draw->setFont($font);
590:         }
591: 
592:         $draw->setFontSize($size);
593: 
594:         return $draw;
595:     }
596: 
597:     /**
598:      * Returns the font width in pixels
599:      *
600:      * @param ImagickDraw $font
601:      * @return int
602:      */
603:     function zp_imageFontWidth($font) {
604:         $temp = new Imagick();
605:         $metrics = $temp->queryFontMetrics($font, "The quick brown fox jumps over the lazy dog");
606:         $temp->destroy();
607: 
608:         return $metrics['characterWidth'];
609:     }
610: 
611:     /**
612:      * Returns the font height in pixels
613:      *
614:      * @param ImagickDraw $font
615:      * @return int
616:      */
617:     function zp_imageFontHeight($font) {
618:         $temp = new Imagick();
619:         $metrics = $temp->queryFontMetrics($font, "The quick brown fox jumps over the lazy dog");
620:         $temp->destroy();
621: 
622:         return $metrics['characterHeight'];
623:     }
624: 
625:     /**
626:      * Creates an image from an image stream
627:      *
628:      * @param $string
629:      * @return Imagick
630:      */
631:     function zp_imageFromString($string) {
632:         $im = new Imagick();
633: 
634:         $maxHeight = getOption('magick_max_height');
635:         $maxWidth = getOption('magick_max_width');
636: 
637:         if ($maxHeight > lib_Imagick_Options::$ignore_size && $maxWidth > lib_Imagick_Options::$ignore_size) {
638:             $im->setOption('jpeg:size', $maxWidth . 'x' . $maxHeight);
639:         }
640: 
641:         $im->readImageBlob($string);
642: 
643:         return $im;
644:     }
645: 
646: }
647: ?>
648: 
Zenphoto doc API documentation generated by ApiGen