         // Crop out any part of the image that's larger than the thumbnail size
         // The cropped rect must be centered on the resized image
         // Round the origin points so that the size isn't altered when CGRectIntegral is later invoked
-        let croppedRect = CGRect(x: ((resizedImage.scaledWidth - sizet) * 0.5).rounded(), y: ((resizedImage.scaledHeight - sizet) * 0.5).rounded(), width: sizet, height: sizet)
+        let croppedRect = CGRect(x: ((resizedImage.size.width - sizet) * 0.5).rounded(), y: ((resizedImage.size.width - sizet) * 0.5).rounded(), width: sizet, height: sizet)
         guard let croppedImage = resizedImage.crop(to: croppedRect) else { return nil }
         var borderedImage = croppedImage
         if borderWidth > 0.0 { borderedImage = croppedImage.bordered(borderWidth) }
         
         return borderedImage.round(cornerRadius, border: borderWidth)
     }
-    /// Creates a copy of this image that is scale-aspect-fit to the thumbnail size using `ImageIO`.
+    /// Creates a copy of this image that is scale-aspect-fit to the thumbnail size using `ImageIO` in points.
     /// Animated image supported.
     ///
     /// - Parameter size: A size of thumbnail to scale-aspect-fit to.

        guard let alp_img = context.makeImage() else { return nil }
        return UIImage(cgImage: alp_img, scale: scale, orientation: imageOrientation)
    }
    /// Creates a copy of the image with a transparent border of the given size added around its edges in pixels.
    /// Animated image supported.
    ///
    /// If the image has no alpha layer, one will be added to it.

    ///
    /// - Returns: An copy of the receiver cropped to the given size and resizing mode.
    public func crop(fits size: CGSize, using mode: ResizingMode = .center) -> UIImage! {
        // Scales points to pxiels.
        var croppingRect = CGRect(origin: .zero, size: size).scale(by: scale)
        switch mode {
        case .scaleToFill:
            return resize(fills: size, quality: .default)
