              aligned face centered on the head for the given centering
          """
          with self._cache["cropped_roi"][1]:
              if centering not in self._cache["cropped_roi"][0]:
                  offset = self.pose.offset.get(centering, np.float32((0, 0)))  # legacy = 0,0
                  offset -= self.pose.offset["head"]
                  offset *= (self._head_size - (self._head_size * _EXTRACT_RATIOS["head"]))
  
                  center = np.rint(offset + self._head_size / 2).astype("int32")
                  padding = self.size // 2
 
</s> remove                 head_size = self._head_size
 </s> add  </s> remove                 slice_out = [slice(max(roi[1] * -1, 0), self._size - max(0, roi[3] - head_size)),
                             slice(max(roi[0] * -1, 0), self._size - max(0, roi[2] - head_size))]
 </s> add                 slice_out = [slice(max(roi[1] * -1, 0),
                                   self._size - min(self._size, max(0, roi[3] - self._head_size))),
                             slice(max(roi[0] * -1, 0),
                                   self._size - min(self._size, max(0, roi[2] - self._head_size)))] </s> remove         self._sub_crop["slice_out"] = [slice(max(roi[1] * -1, 0),
                                             crop_size - max(0, roi[3] - self.stored_size)),
                                       slice(max(roi[0] * -1, 0),
                                             crop_size - max(0, roi[2] - self.stored_size))]
 </s> add         self._sub_crop["slice_out"] = [
            slice(max(roi[1] * -1, 0),
                  crop_size - min(crop_size, max(0, roi[3] - self.stored_size))),
            slice(max(roi[0] * -1, 0),
                  crop_size - min(crop_size, max(0, roi[2] - self.stored_size)))]

                offset = self.pose.offset.get(centering, np.float32((0, 0)))  # legacy = 0.0
              aligned face centered on the head for the given centering
          """
          with self._cache["cropped_roi"][1]:
              if centering not in self._cache["cropped_roi"][0]:
                offset = self.pose.offset.get(centering, np.float32((0, 0)))  # legacy = 0.0
                  offset -= self.pose.offset["head"]
                  offset *= (self._head_size - (self._head_size * _EXTRACT_RATIOS["head"]))
  
                  center = np.rint(offset + self._head_size / 2).astype("int32")
                  padding = self.size // 2
keep keep keep keep replace keep keep keep keep keep
 bugfix - lib.align - Fix edge case aligned face sub crop 
lib/align/aligned_face.py