Skip to content

Commit

Permalink
fix dims on rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
LdDl committed Aug 28, 2023
1 parent e748e89 commit 3a66949
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions service/rpc/unary_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ func (ts *Microservice) ProcessImage(ctx context.Context, in *protos.LPRRequest)
height := stdImage.Bounds().Dy()
width := stdImage.Bounds().Dx()

dw := 0
dh := 0
xl := width
yt := height
dw := width
dh := height
xl := 0
yt := 0

if in.Bbox != nil {
dw = int(in.Bbox.Width)
dh = int(in.Bbox.Height)
xl = int(in.Bbox.XLeft)
yt = int(in.Bbox.YTop)
dw = int(in.Bbox.Width)
dh = int(in.Bbox.Height)
}
if dw <= 0 || dh <= 0 || xl >= width || yt >= height {
return &protos.LPRResponse{Error: "Provided bounding box is incorrect"}, status.Error(codes.InvalidArgument, ErrBadBoundingBBox.Error())
Expand Down

0 comments on commit 3a66949

Please sign in to comment.