Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FormRecognizer] Update text angle if it falls outside of the expected range #13092

Merged
merged 2 commits into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sdk/formrecognizer/Azure.AI.FormRecognizer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
- Property `CopyAuthorization.ExpiresOn` type is now `DateTimeOffset`.
- `RecognizedReceipt` and `RecognizedReceiptsCollection` classes removed. Receipt field values must now be obtained from a `RecognizedForm`.

### Fixes

- Fixed a bug in which the `FormPage.TextAngle` property sometimes fell out of the (-180, 180] range ([#13082](https://github.com/Azure/azure-sdk-for-net/issues/13082)).

## 1.0.0-preview.3 (06-10-2020)

### Renames
Expand Down
6 changes: 5 additions & 1 deletion sdk/formrecognizer/Azure.AI.FormRecognizer/src/FormPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ internal FormPage(PageResult_internal pageResult, IReadOnlyList<ReadResult_inter
ReadResult_internal readResult = readResults[pageIndex];

PageNumber = readResult.Page;
TextAngle = readResult.Angle;

// Workaround because the service can sometimes return angles between 180 and 360 (bug).
// Currently tracked by: https://github.com/Azure/azure-sdk-for-net/issues/12319
TextAngle = readResult.Angle <= 180.0f ? readResult.Angle : readResult.Angle - 360.0f;

Width = readResult.Width;
Height = readResult.Height;
Unit = readResult.Unit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ public async Task StartRecognizeCustomFormsWithoutLabels(bool useStream, bool in
}

[Test]
[TestCase(true, Ignore = "https://github.com/Azure/azure-sdk-for-net/issues/12319")]
[TestCase(true)]
[TestCase(false, Ignore = "https://github.com/Azure/azure-sdk-for-net/issues/12319")]
public async Task StartRecognizeCustomFormsWithoutLabelsCanParseMultipageForm(bool useStream)
{
Expand Down
Loading