          if self._centering != "head":
              raise ValueError("Cropped slices can only be obtained from an aligned face with "
                               "'head' centering")
          with self._cache["cropped_slices"][1]:
              if not self._cache["cropped_slices"][0].get(centering):
                  size = self.get_cropped_size(centering)
                  roi = self.get_cropped_roi(centering)
                  slice_in = [slice(max(roi[1], 0), roi[3]), slice(max(roi[0], 0), roi[2])]
                  slice_out = [slice(max(roi[1] * -1, 0), size - max(0, roi[3] - self.size)),
                               slice(max(roi[0] * -1, 0), size - max(0, roi[2] - self.size))]
                  self._cache["cropped_slices"][0][centering] = {"in": slice_in, "out": slice_out}
                  logger.trace("centering: %s, cropped_slices: %s",
 
</s> remove                 slice_out = [slice(max(roi[1] * -1, 0), size - max(0, roi[3] - self.size)),
                             slice(max(roi[0] * -1, 0), size - max(0, roi[2] - self.size))]
                self._cache["cropped_slices"][0][centering] = {"in": slice_in, "out": slice_out}
 </s> add                 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))]
                self._cache["cropped_slices"][0][self._centering] = {"in": slice_in,
                                                                     "out": slice_out} </s> remove                              centering, self._cache["cropped_slices"][0][centering])
        return self._cache["cropped_slices"][0][centering]
 </s> add                              self._centering, self._cache["cropped_slices"][0][self._centering])
        return self._cache["cropped_slices"][0][self._centering] </s> remove         if self._centering != "head":
            raise ValueError("Cropped slices can only be obtained from an aligned face with "
                             "'head' centering")
 </s> add  </s> remove         crop_size = 2 * int(np.rint(src_size / (1 - _EXTRACT_RATIOS["legacy"]) / 2))
 </s> add         crop_size = get_centered_size("face", "legacy", self.stored_size) </s> remove         if self._centering != "head":
            raise ValueError("Sub ROI can only be obtained from an aligned face with 'head' "
                             "centering")
 </s> add 
            if not self._cache["cropped_slices"][0].get(self._centering):
                roi = self.get_cropped_roi(self._centering)
                head_size = self._head_size
          if self._centering != "head":
              raise ValueError("Cropped slices can only be obtained from an aligned face with "
                               "'head' centering")
          with self._cache["cropped_slices"][1]:
            if not self._cache["cropped_slices"][0].get(self._centering):
                roi = self.get_cropped_roi(self._centering)
                head_size = self._head_size
            if not self._cache["cropped_slices"][0].get(self._centering):
                roi = self.get_cropped_roi(self._centering)
                head_size = self._head_size
            if not self._cache["cropped_slices"][0].get(self._centering):
                roi = self.get_cropped_roi(self._centering)
                head_size = self._head_size
                  slice_in = [slice(max(roi[1], 0), roi[3]), slice(max(roi[0], 0), roi[2])]
                  slice_out = [slice(max(roi[1] * -1, 0), size - max(0, roi[3] - self.size)),
                               slice(max(roi[0] * -1, 0), size - max(0, roi[2] - self.size))]
                  self._cache["cropped_slices"][0][centering] = {"in": slice_in, "out": slice_out}
                  logger.trace("centering: %s, cropped_slices: %s",
keep keep keep keep replace replace replace keep keep keep keep keep
 Bugfix - Warp to landmarks 
lib/align/aligned_face.py