Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Created January 11, 2021 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-cloud/5b7fccaec056fa66b55b2d7ad22b9c20 to your computer and use it in GitHub Desktop.
Save aspose-cloud/5b7fccaec056fa66b55b2d7ad22b9c20 to your computer and use it in GitHub Desktop.
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