added getters for compression and resolution
changed magic number 255 to COMPRESSION_RANGE
refactored getcompression and getresolution callback and errors

added error handling function and refactored public API

added comment to handleError

added comment to handleError
Merge pull request #18 from tessel/nl-add-compression-resolution-getters

added getters for compression and resolution