Ejemplo n.º 1
0
function file_size($src, $src1, $file)
{
    $ext = array_reverse(explode('.', $file));
    $f = new buildQuery('omeka_');
    $f1 = $src . "/" . $f->filterFileName($file);
    $f2 = $src1 . "/" . $f->filterFileName($file);
    if ($ext[0] == 'mp3' | $ext[0] == 'MP3') {
        $size = `du -s {$f1} | awk '{print \$1}'`;
    } else {
        $size = `du -s {$f2} | awk '{print \$1}'`;
    }
    return $size;
}
Ejemplo n.º 2
0
function derivative_image($db)
{
    $fnc = new buildQuery('omeka_');
    //print_r($db);
    $ogname = $fnc->filterFileName($db['file_archive_filename']);
    $newName = $db['archive_filename'];
    $base = "/websites/hurricanearchive.org/";
    $location = array('src' => $base . "content/vault/" . $ogname, 'files' => $base . 'devel/archive/files/' . $newName, 'thumbnails' => $base . 'devel/archive/thumbnails/' . $newName, 'square_thumbnails' => $base . 'devel/archive/square_thumbnails/' . $newName, 'fullsize' => $base . 'devel/archive/fullsize/' . $newName);
    $img = array("convert {$location['src']} {$location['files']}", "convert {$location['src']} {$location['fullsize']}", "convert -thumbnail 200x200 {$location['src']} {$location['thumbnails']}", "convert -thumbnail 200x200 {$location['src']} {$location['square_thumbnails']}");
    $file = "cp {$location['src']} {$location['files']}";
    //echo $base."\n";
    //print_r($img);
    if ($fnc->isimage($db['file_archive_filename']) > 0) {
        `{$img['0']}`;
        `{$img['1']}`;
        `{$img['2']}`;
        `{$img['3']}`;
    } else {
        `{$file}`;
    }
}