Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This Gist repository contains code snippet related to Aspose.OMR Cloud SDK for Ruby
Aspose.OMR-Cloud-SDK-Ruby
# For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-ruby/
raise RuntimeError, "Unable to upload file #{image_file_path}" unless @storage.upload_file(image_file_path)
image_name = File.basename(image_file_path)
response = @omr_api.post_run_omr_task(image_name, 'CorrectTemplate',
{:param => AsposeOmrCloud::OMRFunctionParam.new({:FunctionParam => serialize_files([template_file_path])}) }
)
check_omr_response(response, 'CorrectTemplate')
# For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-ruby/
raise RuntimeError, "Unable to upload file #{corrected_template_file_path}" unless @storage.upload_file(corrected_template_file_path)
corrected_template_file_name = File.basename(corrected_template_file_path)
response = @omr_api.post_run_omr_task(corrected_template_file_name, 'FinalizeTemplate',
{:param => AsposeOmrCloud::OMRFunctionParam.new({:FunctionParam => template_id}) }
)
check_omr_response(response, 'FinalizeTemplate')
# For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-ruby/
raise RuntimeError, "Unable to upload file #{template_file_path}" unless @storage.upload_file(template_file_path)
template_name = File.basename(template_file_path)
response = @omr_api.post_run_omr_task(template_name, 'GenerateTemplate',
{:param => AsposeOmrCloud::OMRFunctionParam.new({:FunctionParam => JSON({:ExtraStoragePath => @logos_folder_name})}) }
)
check_omr_response(response, 'GenerateTemplate')
# For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-ruby/
raise RuntimeError, "Unable to upload file #{image_path}" unless @storage.upload_file(image_path)
image_name = File.basename(image_path)
response = @omr_api.post_run_omr_task(image_name, 'RecognizeImage',
{:param => AsposeOmrCloud::OMRFunctionParam.new({:FunctionParam => template_id}) }
)
check_omr_response(response, 'RecognizeImage')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment