Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Add more logs for various "preview" operations (Imagick, Diaporama, etc)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Mar 30, 2015
1 parent 041798b commit 2012b54
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/src/plugins/editor.audio/class.AudioPreviewer.php
Expand Up @@ -75,6 +75,7 @@ public function switchAction($action, $httpVars, $postProcessData)

$node = new AJXP_Node($destStreamURL.$file);
AJXP_Controller::applyHook("node.read", array($node));
$this->logInfo('Preview', 'Read content of '.$node->getUrl());
//exit(1);

} else if ($action == "ls") {
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/editor.diaporama/class.ImagePreviewer.php
Expand Up @@ -56,7 +56,7 @@ public function switchAction($action, $httpVars, $filesVars)
header("Content-Length: 0");
return;
}

$this->logInfo('Preview', 'Preview content of '.$file);
if (isSet($httpVars["get_thumb"]) && $httpVars["get_thumb"] == "true" && $this->getFilteredOption("GENERATE_THUMBNAIL", $repository->getId())) {
$dimension = 200;
if(isSet($httpVars["dimension"]) && is_numeric($httpVars["dimension"])) $dimension = $httpVars["dimension"];
Expand Down
5 changes: 4 additions & 1 deletion core/src/plugins/editor.imagick/class.IMagickPreviewer.php
Expand Up @@ -66,8 +66,11 @@ public function switchAction($action, $httpVars, $filesVars)

if ($action == "imagick_data_proxy") {
$this->extractAll = false;
if(isSet($httpVars["all"])) $this->extractAll = true;
$file = $selection->getUniqueFile();
if(isSet($httpVars["all"])) {
$this->logInfo('Preview', 'Preview content of '.$file);
$this->extractAll = true;
}

if (($size = filesize($destStreamURL.$file)) === false) {
return false;
Expand Down
2 changes: 2 additions & 0 deletions core/src/plugins/editor.pixlr/class.PixlrEditor.php
Expand Up @@ -56,6 +56,7 @@ public function switchAction($action, $httpVars, $filesVars)
$fData = array("tmp_name" => $tmp, "name" => urlencode(basename($file)), "type" => "image/jpg");
//var_dump($fData);
$node = new AJXP_Node($destStreamURL.$file);
$this->logInfo('Preview', 'Sending content of '.$file.' to Pixlr server.');
AJXP_Controller::applyHook("node.read", array($node));


Expand Down Expand Up @@ -86,6 +87,7 @@ public function switchAction($action, $httpVars, $filesVars)
$file = AJXP_Utils::decodeSecureMagic($httpVars["original_file"]);
$node = new AJXP_Node($destStreamURL.$file);
$node->loadNodeInfo();
$this->logInfo('Edit', 'Retrieving content of '.$file.' from Pixlr server.');
AJXP_Controller::applyHook("node.before_change", array(&$node));
$url = $httpVars["new_url"];
$urlParts = parse_url($url);
Expand Down
4 changes: 4 additions & 0 deletions core/src/plugins/editor.video/class.VideoReader.php
Expand Up @@ -67,6 +67,9 @@ public function switchAction($action, $httpVars, $filesVars)
$ranges = explode('=', $_SERVER['HTTP_RANGE']);
$offsets = explode('-', $ranges[1]);
$offset = floatval($offsets[0]);
if($offset == 0){
$this->logInfo('Preview', 'Streaming content of '.$file);
}

$length = floatval($offsets[1]) - $offset;
if (!$length) $length = $filesize - $offset;
Expand Down Expand Up @@ -96,6 +99,7 @@ public function switchAction($action, $httpVars, $filesVars)
}
fclose($file);
} else {
$this->logInfo('Preview', 'Streaming content of '.$file);
$fp = fopen($filename, "rb");
header("Content-Length: ".$filesize);
header("Content-Range: bytes 0-" . ($filesize - 1) . "/" . $filesize. ";");
Expand Down
2 changes: 2 additions & 0 deletions core/src/plugins/editor.zoho/class.ZohoEditor.php
Expand Up @@ -124,6 +124,7 @@ public function switchAction($action, $httpVars, $filesVars)

$node = new AJXP_Node($destStreamURL.$file);
AJXP_Controller::applyHook("node.read", array($node));
$this->logInfo('Preview', 'Posting content of '.$file.' to Zoho server');

$extension = strtolower(pathinfo(urlencode(basename($file)), PATHINFO_EXTENSION));
$httpClient = new http_class();
Expand Down Expand Up @@ -219,6 +220,7 @@ public function switchAction($action, $httpVars, $filesVars)
echo "MODIFIED";
}
}
$this->logInfo('Edit', 'Retrieved content of '.$node->getUrl());
AJXP_Controller::applyHook("node.change", array(null, &$node));
}

Expand Down

0 comments on commit 2012b54

Please sign in to comment.