From 76550fc1ec8e057c799eb9c7be0814797e78aaf9 Mon Sep 17 00:00:00 2001
From: linarphy <linarphy@linarphy.net>
Date: Wed, 10 May 2023 14:12:51 +0200
Subject: [PATCH] Fixes

- Fix i definition in last_consecutive
- Update flags in rotate
---
 utils.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utils.py b/utils.py
index 47e61e7..bf0a33f 100644
--- a/utils.py
+++ b/utils.py
@@ -191,6 +191,7 @@ def last_consecutive( list_ ):
     if not isinstance( list_ , list ) and not isinstance( list_ , np.ndarray ):
         raise ValueError( 'list_ must be a list, ' + type( list_ ) + ' given' )
     first , lower , greater = list_[0] , 0 , len( list_ )
+    i = lower + ( greater - lower ) // 2
     while greater - lower != 1:
         i = lower + ( greater - lower ) // 2
         if list_[ i ] - first != i: # outside of the consecutive list
@@ -210,4 +211,4 @@ def rotate( image , angle ):
     height , width = image.shape[ : 2 ]
     cX , cY        = ( width // 2 , height // 2 )
     matrix         = cv2.getRotationMatrix2D( ( cX , cY ) , angle , 1 )
-    return cv2.warpAffine( image , matrix , ( width , height ) , flags = cv2.INTER_LINEAR )
+    return cv2.warpAffine( image , matrix , ( width , height ) , flags = cv2.INTER_NEAREST )