'contributor' => 'contributor',
'collection' => 'collection',
'page-progression' => 'pageProgression',
+ 'ppi' => 'ppi',
);
var $metaDefaults = array(
// Returns { 'imageFormat' => , 'archiveFormat' => '} given a sub-item prefix and loaded xml data
function findImageStack($subPrefix, $filesData) {
-
- static $cbPrefix = NULL;
-
+
// The order of the image formats determines which will be returned first
$imageFormats = array('JP2' => 'jp2', 'TIFF' => 'tif', 'JPEG' => 'jpg');
$imageFormatOrder = array_values($imageFormats);
}
}
- /*
- print("<pre>");
- print("found subPrefix $subPrefix\n");
- print_r($imageStacks);
- */
+ // print("<pre>");
+ // print("found subPrefix $subPrefix\n");
+ // print_r($imageStacks);
+ // die(0);
function subPrefixSort($imageStackA, $imageStackB) {
- if ($imageStackA['subPrefix'] == $imageStackB['subPrefix']) {
- return 0;
- }
- return ($imageStackA['subPrefix'] < $imageStackB['subPrefix']) ? -1 : 1;
+ return strcmp($imageStackA['subPrefix'], $imageStackB['subPrefix']);
}
if (! $subPrefix) {
usort($imageStacks, 'subPrefixSort');
function imageFilePath($leafNum, $subPrefix, $format) {
$pathParts = pathinfo($subPrefix);
- $almostIdentifier = $pathParts['filename'];
+ $almostIdentifier = $pathParts['basename'];
return sprintf("%s_%s/%s_%04d.%s", $almostIdentifier, $format, $almostIdentifier, intval($leafNum), $format);
}
// Check if we're on a dev vhost and point to JSIA in the user's public_html on the datanode
// $$$ TODO consolidate this logic
- if (strpos($_SERVER["REQUEST_URI"], "/~mang") === 0) { // Serving out of home dir
- $server .= ':80/~mang';
- } else if (strpos($_SERVER["REQUEST_URI"], "/~testflip") === 0) { // Serving out of home dir
- $server .= ':80/~testflip';
+ $devHosts = array('testflip', 'rkumar', 'mang');
+ foreach ($devHosts as $host) {
+ if (strpos($_SERVER["REQUEST_URI"], '/~' . $host) === 0) { // Serving out of home dir
+ $server .= ':80/' . $host;
+ }
}
$this->emitResponse( $this->buildMetadata($id, $itemPath, $subPrefix, $server) );