Re: Unable to extract JPEG from PHAsset

2017-06-18 Thread Glen Huang
Forgot to mention, I also tested passing an image created using UIImage(named:) to UIImageJPEGRepresentation, and it worked just fine on my real device. I opened rdar://32829011 , there is a test case in it, if you're interested. > On 18 Jun 2017, at 5:45 PM, Glen Huang wrote: > > Thanks for

Re: Unable to extract JPEG from PHAsset

2017-06-18 Thread Glen Huang
Thanks for the reply. I'm sorry but I'm not familiar with the "usual debugging things" that can be apply to UIImage. Is there any official document introducing the inner workings of UIImage that I can read? But following your advice, I did go check image.cgImage before passing it to UIImageJPE

Re: Unable to extract JPEG from PHAsset

2017-06-17 Thread David Duncan
> On Jun 16, 2017, at 7:31 AM, Glen Huang wrote: > > Hi, > > I'm trying to extract the JPEG data from a PHAsset. I did it like this: > >let fetchOptions = PHFetchOptions() >fetchOptions.sortDescriptors = [NSSortDescriptor(key: > "creationDate", ascending: true)] >