     ///
     /// - Returns: An copy of the receiver cropped to the given rectangle.
     public func crop(to rect: CGRect) -> UIImage! {
+        guard !animatable else { return UIImage.animatedImage(with: self.images!.flatMap({ _img in autoreleasepool{ _img.crop(to: rect) } }), duration: duration) }
         // Early fatal checking.
         guard rect.width > 0.0 && rect.height > 0.0 else { return nil }
-        
-        guard let cgImage = self.cgImage?.cropping(to: rect) else { return nil }
-        return UIImage(cgImage: cgImage)
-    }
-    /// Creates a copy of the receiver that is cropped to the given size with a specific resizing mode.
+        let croppingRect = CGRect(origin: rect.origin, size: rect.size)
+        
+        guard let cgImage = self.cgImage?.cropping(to: croppingRect) else { return nil }
+        return UIImage(cgImage: cgImage, scale: scale, orientation: imageOrientation)
+    }
+    /// Creates a copy of the receiver that is cropped to the given size with a specific resizing mode in pixels. Animated image supported.
     ///
     /// The size will be adjusted using `CGRectIntegral`.
     ///

        context.draw(cgImage, in: transposed ? transposedRect : newRect)
        // Get the resized image from the context and a UIImage
        guard let resized_img = context.makeImage() else { return nil }
        return UIImage(cgImage: resized_img)
    }
    /// Returns an affine transform that takes into account the image orientation when drawing a scaled image.
    private func _transform(forOrientation size: CGSize) -> CGAffineTransform {

        default: break
        }
        
        return _resize(fills: size, applying: _transform(forOrientation: size), transposed: transposed, quality: quality)
    }
    /// Returns a copy of the image that has been transformed using the given affine transform and scaled to the new size in pixels.
    /// Animated image supported.
    ///
    /// The new image's orientation will be UIImageOrientationUp, regardless of the current image's orientation
    ///
    /// If the new size is not integral, it will be rounded up.
    private func _resize(fills newSize: CGSize, applying transform: CGAffineTransform, transposed: Bool, quality: CGInterpolationQuality) -> UIImage! {
        guard !animatable else { return UIImage.animatedImage(with: self.images!.flatMap({ _img in autoreleasepool{ _img._resize(fills: newSize, applying: transform, transposed: transposed, quality: quality) } }), duration: duration) }
        
        let newRect        = CGRect(origin: .zero, size: newSize).integral
        let transposedRect = CGRect(origin: .zero, size: CGSize(width: newRect.height, height: newRect.width)).integral
        guard let cgImage = self.cgImage, let colorSpace = cgImage.colorSpace else { return nil }
        // Build a context that's the same dimensions as the new size
        // FIXME: How to decide the right alpha info of the bitmap.
        let bitmap = _correct(bitmapInfo: cgImage.bitmapInfo, for: colorSpace)
        
        guard let context = CGContext(data: nil, width: Int(newRect.width), height: Int(newRect.height), bitsPerComponent: cgImage.bitsPerComponent, bytesPerRow: 0, space: colorSpace, bitmapInfo: bitmap.rawValue) else { return nil }
        // Rotate and/or flip the image if required by its orientation
