§21-8. The punishments prescribed by this chapter can be inflicted only upon a legal conviction in a court having jurisdiction.