本文整理汇总了PHP中AJXP_Utils::is_image方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Utils::is_image方法的具体用法?PHP AJXP_Utils::is_image怎么用?PHP AJXP_Utils::is_image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_Utils
的用法示例。
在下文中一共展示了AJXP_Utils::is_image方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: extractImageMetadata
public function extractImageMetadata($currentNode, &$metadata, $wrapperClassName, &$realFile)
{
$isImage = AJXP_Utils::is_image($currentNode);
$metadata["is_image"] = $isImage;
$setRemote = false;
$remoteWrappers = $this->pluginConf["META_EXTRACTION_REMOTEWRAPPERS"];
$remoteThreshold = $this->pluginConf["META_EXTRACTION_THRESHOLD"];
if (in_array($wrapperClassName, $remoteWrappers)) {
if ($remoteThreshold != 0 && isset($metadata["bytesize"])) {
$setRemote = $metadata["bytesize"] > $remoteThreshold;
} else {
$setRemote = true;
}
}
if ($isImage) {
if ($setRemote) {
$metadata["image_type"] = "N/A";
$metadata["image_width"] = "N/A";
$metadata["image_height"] = "N/A";
$metadata["readable_dimension"] = "";
} else {
if (!isset($realFile)) {
$realFile = call_user_func(array($wrapperClassName, "getRealFSReference"), $currentNode);
}
list($width, $height, $type, $attr) = @getimagesize($realFile);
$metadata["image_type"] = image_type_to_mime_type($type);
$metadata["image_width"] = $width;
$metadata["image_height"] = $height;
$metadata["readable_dimension"] = $width . "px X " . $height . "px";
}
}
}
示例2: extractImageMetadata
/**
* Enrich node metadata
* @param AJXP_Node $ajxpNode
*/
public function extractImageMetadata(&$ajxpNode)
{
$currentPath = $ajxpNode->getUrl();
$wrapperClassName = $ajxpNode->wrapperClassName;
$isImage = AJXP_Utils::is_image($currentPath);
$ajxpNode->is_image = $isImage;
if (!$isImage) {
return;
}
$setRemote = false;
$remoteWrappers = $this->getFilteredOption("META_EXTRACTION_REMOTEWRAPPERS");
if (is_string($remoteWrappers)) {
$remoteWrappers = explode(",", $remoteWrappers);
}
$remoteThreshold = $this->getFilteredOption("META_EXTRACTION_THRESHOLD");
if (in_array($wrapperClassName, $remoteWrappers)) {
if ($remoteThreshold != 0 && isset($ajxpNode->bytesize)) {
$setRemote = $ajxpNode->bytesize > $remoteThreshold;
} else {
$setRemote = true;
}
}
if ($isImage) {
if ($setRemote) {
$ajxpNode->image_type = "N/A";
$ajxpNode->image_width = "N/A";
$ajxpNode->image_height = "N/A";
$ajxpNode->readable_dimension = "";
} else {
$realFile = $ajxpNode->getRealFile();
list($width, $height, $type, $attr) = @getimagesize($realFile);
if ($this->getFilteredOption("EXIF_ROTATION")) {
require_once AJXP_INSTALL_PATH . "/plugins/editor.diaporama/PThumb.lib.php";
$pThumb = new PThumb($this->getFilteredOption["THUMBNAIL_QUALITY"], $this->getFilteredOption("EXIF_ROTATION"));
$orientation = $pThumb->exiforientation($realFile, false);
if ($pThumb->rotationsupported($orientation)) {
$ajxpNode->image_exif_orientation = $orientation;
if ($orientation > 4) {
$tmp = $height;
$height = $width;
$width = $tmp;
}
}
}
$ajxpNode->image_type = image_type_to_mime_type($type);
$ajxpNode->image_width = $width;
$ajxpNode->image_height = $height;
$ajxpNode->readable_dimension = $width . "px X " . $height . "px";
}
}
//$this->logDebug("CURRENT NODE IN EXTRACT IMAGE METADATA ", $ajxpNode);
}
示例3: switchAction
//.........这里部分代码省略.........
// skip "complete" mode that was in fact quite the same as standard tree listing (dz)
}
if (!isset($dir) || $dir == "/") {
$dir = "";
}
$searchMode = $fileListMode = $completeMode = false;
if (isset($mode)) {
if ($mode == "search") {
$searchMode = true;
} else {
if ($mode == "file_list") {
$fileListMode = true;
} else {
if ($mode == "complete") {
$completeMode = true;
}
}
}
}
$nom_rep = $dir;
//AJXP_Exception::errorToXml($nom_rep);
$result = $this->SSHOperation->listFilesIn($nom_rep);
$metaData = array();
if (RecycleBinManager::recycleEnabled() && RecycleBinManager::currentLocationIsRecycle($dir)) {
$metaData["ajxp_mime"] = "ajxp_recycle";
}
AJXP_XMLWriter::renderHeaderNode(AJXP_Utils::xmlEntities($dir, true), AJXP_Utils::xmlEntities(basename($dir), true), false, $metaData);
foreach ($result as $file) {
$attributes = "";
$fileName = SystemTextEncoding::toUTF8($file["name"]);
$icon = AJXP_Utils::mimetype($fileName, "image", $file["isDir"] == 1);
if ($searchMode) {
if ($file["isDir"] == 0) {
$attributes = "is_file=\"true\" icon=\"" . SystemTextEncoding::toUTF8($icon) . "\"";
}
} else {
if ($fileListMode) {
$atts = array();
$atts[] = "is_file=\"" . (1 - $file["isDir"]) . "\"";
$atts[] = "is_image=\"" . AJXP_Utils::is_image($fileName) . "\"";
$atts[] = "mimestring=\"" . AJXP_Utils::mimetype($fileName, "type", $file["isDir"] == 1) . "\"";
$atts[] = "ajxp_modiftime=\"" . $this->dateModif($file["time"]) . "\"";
$atts[] = "filesize=\"" . AJXP_Utils::roundSize($file["size"]) . "\"";
$atts[] = "bytesize=\"" . $file["size"] . "\"";
$atts[] = "filename=\"" . str_replace("&", "&", $dir . "/" . $fileName) . "\"";
$atts[] = "icon=\"" . ($file["isDir"] == 1 ? "folder.png" : SystemTextEncoding::toUTF8($icon)) . "\"";
$attributes = join(" ", $atts);
} else {
if ($file["isDir"] == 1) {
$link = SERVER_ACCESS . "?dir=" . $dir . "/" . $fileName;
$link = urlencode($link);
$folderBaseName = str_replace("&", "&", $fileName);
$folderFullName = "{$dir}/" . $folderBaseName;
$parentFolderName = $dir;
if (!$completeMode) {
$icon = "folder.png";
$openicon = "folder_open.png";
if (preg_match("/\\.zip\$/", $file["name"])) {
$icon = $openicon = CLIENT_RESOURCES_FOLDER . "/images/actions/16/accessories-archiver.png";
}
$attributes = "icon=\"{$icon}\" openicon=\"{$openicon}\" filename=\"" . $folderFullName . "\" src=\"{$link}\"";
}
}
}
}
if (strlen($attributes) > 0) {
print "<tree text=\"" . str_replace("&", "&", SystemTextEncoding::toUTF8($this->SSHOperation->unescapeFileName($file["name"]))) . "\" {$attributes}>";
print "</tree>";
}
}
AJXP_XMLWriter::close();
exit(1);
break;
}
if (isset($logMessage) || isset($errorMessage)) {
$xmlBuffer .= AJXP_XMLWriter::sendMessage(isset($logMessage) ? $logMessage : null, isset($errorMessage) ? $errorMessage : null, false);
}
if (isset($requireAuth)) {
$xmlBuffer .= AJXP_XMLWriter::requireAuth(false);
}
if (isset($reloadContextNode)) {
if (!isset($pendingSelection)) {
$pendingSelection = "";
}
$xmlBuffer .= AJXP_XMLWriter::reloadDataNode("", $pendingSelection, false);
}
if (isset($reloadDataNode)) {
$xmlBuffer .= AJXP_XMLWriter::reloadDataNode($reloadDataNode, "", false);
}
if (isset($reload_current_node) && $reload_current_node == "true") {
$xmlBuffer .= AJXP_XMLWriter::reloadCurrentNode(false);
}
if (isset($reload_dest_node) && $reload_dest_node != "") {
$xmlBuffer .= AJXP_XMLWriter::reloadNode($reload_dest_node, false);
}
if (isset($reload_file_list)) {
$xmlBuffer .= AJXP_XMLWriter::reloadFileList($reload_file_list, false);
}
return $xmlBuffer;
}
示例4: extractImageMetadata
/**
* Enrich node metadata
* @param AJXP_Node $ajxpNode
*/
public function extractImageMetadata(&$ajxpNode)
{
$currentPath = $ajxpNode->getUrl();
$wrapperClassName = $ajxpNode->wrapperClassName;
$isImage = AJXP_Utils::is_image($currentPath);
$ajxpNode->is_image = $isImage;
if (!$isImage) {
return;
}
$setRemote = false;
$remoteWrappers = $this->getFilteredOption("META_EXTRACTION_REMOTEWRAPPERS");
if (is_string($remoteWrappers)) {
$remoteWrappers = explode(",", $remoteWrappers);
}
$remoteThreshold = $this->getFilteredOption("META_EXTRACTION_THRESHOLD");
if (in_array($wrapperClassName, $remoteWrappers)) {
if ($remoteThreshold != 0 && isset($ajxpNode->bytesize)) {
$setRemote = $ajxpNode->bytesize > $remoteThreshold;
} else {
$setRemote = true;
}
}
if ($isImage) {
if ($setRemote) {
$ajxpNode->image_type = "N/A";
$ajxpNode->image_width = "N/A";
$ajxpNode->image_height = "N/A";
$ajxpNode->readable_dimension = "";
} else {
$realFile = $ajxpNode->getRealFile();
list($width, $height, $type, $attr) = @getimagesize($realFile);
$ajxpNode->image_type = image_type_to_mime_type($type);
$ajxpNode->image_width = $width;
$ajxpNode->image_height = $height;
$ajxpNode->readable_dimension = $width . "px X " . $height . "px";
}
}
//$this->logDebug("CURRENT NODE IN EXTRACT IMAGE METADATA ", $ajxpNode);
}