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 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