def get_options(): options = {} size = c_size_t() keys = c_call('magick_', 'query_configure_options', '*', byref(size)) for key in [native_str(keys[i]) for i in range(size.value)]: options[key] = c_call('magick_', 'query_configure_option', key) return options
def get_blob(image, format, compression, # @ReservedAssignment quality): with state(image, compression=compression, compression_quality=quality): format = format.upper() # @ReservedAssignment old_format = c_call('magick', 'get_format', image) c_call('magick', 'set_format', image, format) size = c_size_t() result = c_call(image, ('get', 'blob'), byref(size)) #from nose.tools import set_trace; set_trace() blob = string_at(result, size.value) c_call('magick_', 'relinquish_memory', result) c_call('magick', 'set_format', image, old_format) return blob
def get_blob( image, format, compression, # @ReservedAssignment quality): with state(image, compression=compression, compression_quality=quality): format = format.upper() # @ReservedAssignment old_format = c_call('magick', 'get_format', image) c_call('magick', 'set_format', image, format) size = c_size_t() result = c_call(image, ('get', 'blob'), byref(size)) #from nose.tools import set_trace; set_trace() blob = string_at(result, size.value) c_call('magick_', 'relinquish_memory', result) c_call('magick', 'set_format', image, old_format) return blob
def get_formats(): size = c_size_t() formats = c_call('magick_', 'query_formats', '*', byref(size)) return [native_str(formats[i]).lower() for i in range(size.value)]