          (ch_b, ch_g, ch_r, ch_a))
      return image_bgra.astype(d_type)
  
  
  def rotate_image_by_angle(image, angle,
                            rotated_width=None, rotated_height=None):
      """ Rotate an image by a given angle.
          From: https://stackoverflow.com/questions/22041699 """
  
      height, width = image.shape[:2]
      image_center = (width/2, height/2)
      rotation_matrix = cv2.getRotationMatrix2D(  # pylint: disable=no-member
          image_center, -1.*angle, 1.)
      if rotated_width is None or rotated_height is None:
          abs_cos = abs(rotation_matrix[0, 0])
          abs_sin = abs(rotation_matrix[0, 1])
          if rotated_width is None:
              rotated_width = int(height*abs_sin + width*abs_cos)
          if rotated_height is None:
              rotated_height = int(height*abs_cos + width*abs_sin)
      rotation_matrix[0, 2] += rotated_width/2 - image_center[0]
      rotation_matrix[1, 2] += rotated_height/2 - image_center[1]
      return (cv2.warpAffine(image,  # pylint: disable=no-member
                             rotation_matrix,
                             (rotated_width, rotated_height)),
              rotation_matrix)
  
  
  def rotate_landmarks(face, rotation_matrix):
      """ Rotate the landmarks and bounding box for faces
          found in rotated images.
          Pass in a DetectedFace object, Alignments dict or DLib rectangle"""
      if isinstance(face, DetectedFace):
 
</s> remove 
 </s> add         logger.trace("Returning rotation matrix: %s", r_mat) </s> remove     def delete_alignment(self, *args):
 </s> add     def delete_alignment(self, *args):  # pylint: disable=unused-argument
          (ch_b, ch_g, ch_r, ch_a))
      return image_bgra.astype(d_type)
  
  
























  def rotate_landmarks(face, rotation_matrix):
      """ Rotate the landmarks and bounding box for faces
          found in rotated images.
          Pass in a DetectedFace object, Alignments dict or DLib rectangle"""
      if isinstance(face, DetectedFace):
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Logging (#541)

* Convert prints to logger. Further logging improvements. Tidy  up

* Fix system verbosity. Allow SystemExit

* Fix reload extract bug

* Child Traceback handling

* Safer shutdown procedure

* Add shutdown event to queue manager

* landmarks_as_xy > property. GUI notes + linting. Aligner bugfix

* fix FaceFilter. Enable nFilter when no Filter is supplied

* Fix blurry face filter

* Continue on IO error. Better error handling

* Explicitly print stack trace tocrash log

* Windows Multiprocessing bugfix

* Add git info and conda version to crash log

* Windows/Anaconda mp bugfix

* Logging fixes for training 
lib/utils.py