Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Created January 11, 2021 12:15
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/3ad721f30f4b85a9a4bab99ec5696cb3 to your computer and use it in GitHub Desktop.
Save aspose-cloud/3ad721f30f4b85a9a4bab99ec5696cb3 to your computer and use it in GitHub Desktop.
This Gist repository contains code snippet related to Aspose.OMR Cloud SDK for Perl
Aspose.OMR-Cloud-SDK-Perl
// For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-perl/
my ($self, $template_image_path, $image_file_path) = @_;
my $image_file_name = ::basename($image_file_path);
$self->{storage}->upload_file($image_file_path, $image_file_name);
my @files = ($template_image_path);
my $response = $self->{omr_api}->post_run_omr_task(name => $image_file_name, action_name => "CorrectTemplate"
, param => asposeomrcloud::Object::OMRFunctionParam->new(('FunctionParam' => $self->serialize_files(\@files)))
);
die "CorrectTemplate failed $response->{error_text}" unless $response->{error_code} == 0;
#print(::Dumper($response));
return $response;
// For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-perl/
my ($self, $template_id, $corrected_template_file_path) = @_;
my $corrected_template_file_name = ::basename($corrected_template_file_path);
$self->{storage}->upload_file($corrected_template_file_path, $corrected_template_file_name);
my $response = $self->{omr_api}->post_run_omr_task(name => $corrected_template_file_name, action_name => "FinalizeTemplate"
, param => asposeomrcloud::Object::OMRFunctionParam->new(('FunctionParam' => $template_id))
);
die "FinalizeTemplate failed $response->{error_text}" unless $response->{error_code} == 0;
#print(::Dumper($response));
return $response;
// For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-perl/
my ($self, $template_file_path, $logos_folder) = @_;
my $file_name = ::basename($template_file_path);
$self->{storage}->upload_file($template_file_path, $file_name);
my $response = $self->{omr_api}->post_run_omr_task(name => $file_name, action_name => "GenerateTemplate"
, param => asposeomrcloud::Object::OMRFunctionParam->new(('FunctionParam' => JSON::to_json({ExtraStoragePath => $logos_folder})))
);
die "GenerateTemplate failed $response->{error_text}" unless $response->{error_code} == 0;
#print(::Dumper($response));
return $response;
// For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-perl/
my ($self, $template_id, $image_path) = @_;
my $image_file_name = ::basename($image_path);
$self->{storage}->upload_file($image_path, $image_file_name);
my $response = $self->{omr_api}->post_run_omr_task(name => $image_file_name, action_name => "RecognizeImage"
, param => asposeomrcloud::Object::OMRFunctionParam->new(('FunctionParam' => $template_id))
);
die "RecognizeImage failed $response->{error_text}" unless $response->{error_code} == 0;
#print(::Dumper($response));
return $response;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment