Exemple #1
0
function rawman_editbox($pic)
{
    // Reading params and settting form fields
    $par = rawman_mkdir(array(rawman_getpicdir($pic), 'param')) . $pic . '.txt';
    $opt = rawman_convparams($par, array('rating' => 0, 'coloring' => 'none', 'wb' => 'camera', 'rotate' => 'none'));
    if (preg_match('/\\-b\\s+(\\d\\.\\d+)\\b/', $opt['dcraw'], $m)) {
        _fsine(array('brightness' => $m[1]));
    }
    if (IsEmpty($opt['wb']) && preg_match('/\\-a\\b/', $opt['dcraw'], $m)) {
        $opt['wb'] = 'auto';
    }
    if (preg_match('/\\-gamma\\s+(\\d\\.\\d+)\\b/', $opt['cnvpre'], $m)) {
        _fsine(array('gamma' => $m[1]));
    }
    if (preg_match('/\\-t\\s+(\\d+)\\b/', $opt['dcraw'], $m)) {
        $opt['rotate'] = $m[1] == 270 ? 'left' : 'right';
    } elseif (preg_match('/\\-rotate\\s+(\\d+)\\b/', $opt['cnvpre'], $m)) {
        $opt['rotate'] = $m[1] == 270 ? 'left' : 'right';
    }
    $arr_ev = array('-2.00', '-1.66', '-1.50', '-1.33', '-1.00', '-0.66', '-0.50', '-0.33', '0.00', '+0.33', '+0.50', '+0.66', '+1.00', '+1.33', '+1.50', '+1.66', '+2.00');
    $arr_high = array(0 => '0 - White', 1 => '1 - Pink', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7', 8 => '8', 9 => '9');
    _fsine(array('ev' => '+0.33', 'rotate' => $opt['rotate']));
    echo '
<form name="editForm">' . CreateHiddenField('balance', $opt['wb']) . rawman_wb($opt['wb'], true) . '<p style="clear:both;"></p>
<ul>
<li>Ekspozycja: ' . CreateSelectField('ev', $arr_ev, 0) . 'EV</li>
<li>Jasność: ' . CreateInputText('brightness', 5) . '</li>
<li>Gamma: ' . CreateInputText('gamma', 5) . '</li>
<li>Ziarno: ' . CreateInputText('noise', 5) . '</li>
<li>Odbłyski: ' . CreateSelectField('highlight', $arr_high) . '</li>
</ul>
' . '<p style="clear:both;"></p>' . CreateHiddenField('rotate', $opt['rotate']) . rawman_rotate($opt['rotate'], true) . '<p style="clear:both;"></p>' . CreateButton('preview', 'View', 'onclick="editImg()"') . CreateButton('cancel', 'Cancel', 'onclick="rmSendReq(\'' . rmconf('elem-dir') . '/info\')"') . CreateButton('apply', 'Apply', 'onclick="applyImg()"') . '</form>';
}
Exemple #2
0
function _fsine($name, $value = null)
{
    global $form;
    if ($value == null && is_array($name)) {
        foreach ($name as $key => $val) {
            _fsine($key, $val);
        }
    } elseif (IsEmpty($form[$name])) {
        $form[$name] = $value;
    }
}