0.9.0.0
This commit is contained in:
3
CHANGELOG.md
Normal file
3
CHANGELOG.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[0.9.0.0]
|
||||||
|
|
||||||
|
- Added negative levels option
|
||||||
@@ -1 +1 @@
|
|||||||
0.8.13.0
|
0.9.0.0
|
||||||
20
leaf.php
20
leaf.php
@@ -3,7 +3,7 @@
|
|||||||
// Leaf - Tools for Book Scans
|
// Leaf - Tools for Book Scans
|
||||||
// No license, do not distribute
|
// No license, do not distribute
|
||||||
|
|
||||||
$version = "0.8.13";
|
$version = "0.9.0.0";
|
||||||
$time_start = microtime(true);
|
$time_start = microtime(true);
|
||||||
date_default_timezone_set("America/Los_Angeles");
|
date_default_timezone_set("America/Los_Angeles");
|
||||||
|
|
||||||
@@ -76,6 +76,17 @@ function levels_ps_to_imgk($string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function olevels_ps_to_imgk($string) {
|
||||||
|
$parts = explode(",", $string);
|
||||||
|
if (count($parts) != 2) {
|
||||||
|
msg("Invalid levels string",1);
|
||||||
|
} else {
|
||||||
|
$black = (number_format(($parts[0]/253),5)*100)."%";
|
||||||
|
$white = (number_format(($parts[1]/255),5)*100)."%";
|
||||||
|
return $black.",".$white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function unsharp_ps_to_imgk($string) {
|
function unsharp_ps_to_imgk($string) {
|
||||||
$parts = explode(",", $string);
|
$parts = explode(",", $string);
|
||||||
if (count($parts) != 3) {
|
if (count($parts) != 3) {
|
||||||
@@ -180,6 +191,8 @@ function args($query) {
|
|||||||
return levels_ps_to_imgk($opt['levels']);
|
return levels_ps_to_imgk($opt['levels']);
|
||||||
} elseif ($query == "plevels" && isset($opt['plevels'])) {
|
} elseif ($query == "plevels" && isset($opt['plevels'])) {
|
||||||
return levels_ps_to_imgk($opt['plevels']);
|
return levels_ps_to_imgk($opt['plevels']);
|
||||||
|
} elseif ($query == "olevels" && isset($opt['olevels'])) {
|
||||||
|
return olevels_ps_to_imgk($opt['olevels']);
|
||||||
} elseif ($query == "unsharp" && isset($opt['unsharp'])) {
|
} elseif ($query == "unsharp" && isset($opt['unsharp'])) {
|
||||||
return unsharp_ps_to_imgk($opt['unsharp']);
|
return unsharp_ps_to_imgk($opt['unsharp']);
|
||||||
} elseif (isset($opt[$query])) {
|
} elseif (isset($opt[$query])) {
|
||||||
@@ -866,6 +879,11 @@ foreach ($jpg as $parts) {
|
|||||||
$cmd .= "-level ".args("levels")." ";
|
$cmd .= "-level ".args("levels")." ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args("olevels")) {
|
||||||
|
$msg .= " (".args("olevels").")";
|
||||||
|
$cmd .= "+level ".args("olevels")." ";
|
||||||
|
}
|
||||||
|
|
||||||
if (args("unsharp")) {
|
if (args("unsharp")) {
|
||||||
$msg .= " (".args("unsharp").")";
|
$msg .= " (".args("unsharp").")";
|
||||||
$cmd .= "-unsharp ".args("unsharp")." ";
|
$cmd .= "-unsharp ".args("unsharp")." ";
|
||||||
|
|||||||
Reference in New Issue
Block a user