Skip to content

Commit

Permalink
[FormRecognizer] Update text angle if it falls outside of the expecte…
Browse files Browse the repository at this point in the history
…d range (#13092)

* Created workaround for angle bug (#13082)

* Updated changelog
  • Loading branch information
kinelski authored Jun 29, 2020
1 parent 057b29f commit 716469b
Show file tree
Hide file tree
Showing 5 changed files with 8,974 additions and 2 deletions.
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

0 comments on commit 716469b

Please sign in to comment.