Mercurial > cgi-bin > hgweb.cgi > ImagePrep
annotate src/name/blackcap/imageprep/Settings.kt @ 15:fad32eda667f
Fix ImageWriter leak.
author | David Barts <n5jrn@me.com> |
---|---|
date | Sun, 19 Jul 2020 13:49:23 -0700 |
parents | 884f1415a330 |
children |
rev | line source |
---|---|
0 | 1 /* |
2 * Our settings. Basically just some parsed properties. | |
3 */ | |
4 package name.blackcap.imageprep | |
5 | |
1 | 6 import java.io.File |
7 | |
0 | 8 /* work around name shadowing */ |
9 private val _PROPS = PROPERTIES | |
10 | |
11 object Settings { | |
4
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
2
diff
changeset
|
12 var maxDimension = _PROPS.getProperty("maxDimension").toInt() |
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
2
diff
changeset
|
13 var outputQuality = _PROPS.getProperty("outputQuality").toInt() |
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
2
diff
changeset
|
14 var outputSuffix = _PROPS.getProperty("outputSuffix") |
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
2
diff
changeset
|
15 var outputTo = tilde(_PROPS.getProperty("outputTo")) |
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
2
diff
changeset
|
16 var outputToInputDir = strToBool(_PROPS.getProperty("outputToInputDir")) |
0 | 17 |
18 private fun strToBool(s: String): Boolean { | |
19 if (s.isNullOrEmpty()) | |
20 return false | |
21 val c1 = s[0].toLowerCase() | |
22 return c1 == 't' || c1 == 'y' | |
23 } | |
24 } |