Is it possible to create an ALAsset object from NSData or other image type (CFImageRef, CIImage, UIImage)? [closed]

StackOverflow https://stackoverflow.com//questions/12696028

Question

Is it possible to create an ALAsset object from NSData or other image type (CFImageRef, CIImage, UIImage)?

I don't want to save all of my applications images to the camera roll, but I want to be able to upload multiple images to Walgreen's QuickPrints API, which is a compiled library that only takes ALAssets for multiple image uploads.

Edit: My understanding of the Walgreen's API/SDK was incorrect. See my answer for details, if you want multiple images uploaded without using ALAssets, you'll have to upload them one at a time.

Was it helpful?

Solution 2

The real answer to this issue is that while Walgreen's documentation wasn't perfectly clear on this at the time of asking, the cart is tracked as batch with a limit of 100 photos, rather an upload being considered a batch.

As long as you don't send the cart to the Walgreen's API, and receive a checkout URL with:

 [checkoutSDK postCart];

It will keep track of all single and multiple uploads in a "batch" with a maximum limit of 100, rather than overwriting the previous cart with each call to:

 [checkoutSDK upload:someTypeOfImageData];

Hopefully they'll add a bit more detail the documentation soon, if they haven't already.

OTHER TIPS

From the docs: "An ALAsset object represents a photo or a video managed by the Photo application." So you have no choice but to save the data out if you really need an ALAsset.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top