                  for idx, face in enumerate(faces):
                      image = self.convert_one_face(converter,
                                                    (filename, image, idx, face))
                  filename = str(self.output_dir / Path(filename).name)
                  cv2.imwrite(filename, image)
          except Exception as err:
              print("Failed to convert image: {}. "
                    "Reason: {}".format(filename, err))
              raise
  
 
</s> remove 
        except Exception as err:
            print("{} not read!".format(self.location))
            print(str(err))
            data = dict()
 </s> add         except IOError as err:
            print("Error: {} not read: {}".format(self.file, err.strerror))
            exit(1) </s> remove             with open(self.location, self.serializer.roptions) as align:
 </s> add             with open(self.file, self.serializer.roptions) as align: </s> remove         resized_faces = faces["resized_faces"]
 </s> add  </s> remove         for idx, face in enumerate(output_item["detected_faces"]):
            resized_face = output_item["resized_faces"][idx]
            dims = resized_face.shape[:2]
            size = dims[0]
            t_mat = output_item["t_mats"][idx]

            aligned_landmarks = extractor.transform_points(
                face.landmarksXY,
                t_mat, size, 48)
 </s> add         for face in output_item["detected_faces"]:
            aligned_landmarks = face.aligned_landmarks
            resized_face = face.aligned_face
            size = face.aligned["size"] </s> remove                                 resized_faces[idx],
 </s> add                                 face.aligned_face,
                cv2.imwrite(filename, image)  # pylint: disable=no-member
                  for idx, face in enumerate(faces):
                      image = self.convert_one_face(converter,
                                                    (filename, image, idx, face))
                  filename = str(self.output_dir / Path(filename).name)
                cv2.imwrite(filename, image)  # pylint: disable=no-member
          except Exception as err:
              print("Failed to convert image: {}. "
                    "Reason: {}".format(filename, err))
              raise
  
keep keep keep keep replace keep keep keep keep keep
 Fix convert-adjust (#531)

* Add dimensions to alignments + refactor

* Add frame_dims + funcs to DetectFaces. Add alignments lib

* Convert Adjust working

* Refactor and tidy up 
scripts/convert.py