Mercurial > cgi-bin > hgweb.cgi > ImagePrep
view src/name/blackcap/imageprep/Settings.kt @ 12:26a507e095ab
Use ImageObserver and wait if needed.
author | David Barts <n5jrn@me.com> |
---|---|
date | Sat, 18 Jul 2020 12:04:05 -0700 |
parents | 884f1415a330 |
children |
line wrap: on
line source
/* * Our settings. Basically just some parsed properties. */ package name.blackcap.imageprep import java.io.File /* work around name shadowing */ private val _PROPS = PROPERTIES object Settings { var maxDimension = _PROPS.getProperty("maxDimension").toInt() var outputQuality = _PROPS.getProperty("outputQuality").toInt() var outputSuffix = _PROPS.getProperty("outputSuffix") var outputTo = tilde(_PROPS.getProperty("outputTo")) var outputToInputDir = strToBool(_PROPS.getProperty("outputToInputDir")) private fun strToBool(s: String): Boolean { if (s.isNullOrEmpty()) return false val c1 = s[0].toLowerCase() return c1 == 't' || c1 == 'y' } }