     destination.addImage(cgimage)
     XCTAssertTrue(destination.finalize())
     #if os(OSX)
-      let out_image = NSImage(data: data)
+      let out_image = NSImage(data: data as Data)
     #else
       let out_image = UIImage(data: data as Data)
     #endif

      else { XCTAssert(false); return }
    #if os(OSX)
      let image = NSImage(contentsOfFile: pngImageURL.path!)!
      var imageRect:CGRect = CGRectMake(0, 0, image.size.width, image.size.height)
      let cgimage = image.CGImageForProposedRect(&imageRect, context: nil, hints: nil)!
    #else
      let cgimage: CGImage = UIImage(contentsOfFile: pngImageURL.path!)!.cgImage!
    #endif

    return bundle.urlForResource("gifSample", withExtension: "gif")!
  }
  
  private var jpgImageURL: URL {
    let bundle = Bundle(for: self.dynamicType)
    return bundle.urlForResource("cameraSample", withExtension: "jpg")!
  }
