Exemple #1
0
function rawman_editimage($conv, $pic)
{
    $el = rawman_elem($pic);
    $dir = rawman_getpicdir($pic);
    $img = rawman_mkdir(array($dir, 'image', IMAGE_SIZE)) . $pic . ',' . $conv . '.jpg';
    $opt = array('year' => '20' . $el['year'], 'number' => $el['number']);
    $raw = rawman_getrawfile($pic);
    $info = pathinfo($raw);
    if (!is_file($image)) {
        /*
         ** Analiza parametrów
         */
        list($par_ev, $par_balance, $par_brightness, $par_gamma, $par_rotate, $par_noise) = split(',', $conv);
        $opt['dcraw'] .= rawman_get_dcraw_wb($par_balance);
        if (!IsEmpty($par_noise)) {
            $opt['dcraw'] .= ' -n ' . $par_noise;
        }
        $opt['dcraw'] .= ' -h -b ' . RetDefault($par_brightness, '1.33');
        if (in_array($par_rotate, array('left', 'right'))) {
            if ($info['extension'] == 'jpg') {
                $opt['cnvpre'] .= ' -rotate ' . ($par_rotate == 'left' ? 270 : 90);
            } else {
                $opt['dcraw'] .= ' -t ' . ($par_rotate == 'left' ? 270 : 90);
            }
        }
        $opt['cnvpre'] .= ' -shave 4x4 -gamma ' . RetDefault($par_gamma, '1.15');
        $opt['cnvpost'] .= ' -unsharp 3x3+0.3+0';
        rawman_createimage($raw, $img, $opt);
    }
    rawman_showpicture($img);
}
Exemple #2
0
function rawman_listday(&$raws)
{
    $count = 0;
    foreach ($raws as $udir => $arr) {
        foreach ($arr as $raw) {
            $pic = rawman_filename($raw);
            $el = rawman_elem($pic);
            $opt = rawman_convparams(rawman_mkdir(array(rawman_getpicdir($pic), 'param')) . $pic . '.txt', array('rating' => 0, 'coloring' => 'none'));
            $class = 'thumbnail';
            if ($opt['coloring'] != 'none') {
                $class .= ' ' . $opt['coloring'];
            }
            $title = sprintf('20%02d-%02d-%02d, #%d', $el['year'], $el['month'], $el['day'], $el['number']);
            $content .= sprintf('<li class="%s" id="thumb-%s">' . '<img src="%s/index.php/thumb/%s/%s.png" onclick="selImg(\'%s\',\'%s\')" title="%s" />' . '<br clear="both"/>%s' . '<br clear="both"/>%s' . '</li>', $class, $pic, RM_WEB, $udir, $pic, $pic, $udir, $title, $pic, rawman_rating($opt['rating'], false));
            $count++;
        }
    }
    return '<ul class="thumbnails" style="width: ' . 130 * $count . 'px;">' . $content . '</ul>';
}
Exemple #3
0
function rawman_number($pic)
{
    $el = rawman_elem($pic);
    return sprintf('%d', $el['number']);
}