ios - How to get Original Image and media type from PHAsset? -
my **gmimagepickercontroller**
returns list of selected images photos app.
the code follows.
- (void)assetspickercontroller:(gmimagepickercontroller *)picker didfinishpickingassets:(nsarray *)assetarray { nslog(@"%@",assetarray); nslog(@"gmimagepicker: user ended picking assets. number of selected items is: %lu", (unsigned long)assetarray.count); }
the assetarray return result this, selected 3 images photos app
( "<phasset: 0x7fa39e02e840> 1aeef04a-f8ab-4019-aab5- 2875cfd8f8e3/l0/001 mediatype=1/0, sourcetype=1, (425x425), creationdate=2016-02-03 13:53:17 +0000, location=0, hidden=0, favorite=0 ", "<phasset: 0x7fa39e02c840> 50489c13-55d0-4518-b290-b01b99d66996/l0/001 mediatype=1/0, sourcetype=1, (425x335), creationdate=2016-02-03 13:53:08 +0000, location=0, hidden=0, favorite=0 ", "<phasset: 0x7fa39e02c750> d0a466b2-9cf2-4fd9-a12f-07921a1d0e8f/l0/001 mediatype=1/0, sourcetype=1, (425x365), creationdate=2016-02-03 13:53:04 +0000, location=0, hidden=0, favorite=0 " )
now problem want originalimage
, mediatype
above result store image document directory. please me solve problem.
nslog(@"====%@====",assetarray); for(int i=0;i<assetarray.count;i++) { self.requestoptions = [[phimagerequestoptions alloc] init]; self.requestoptions.resizemode = phimagerequestoptionsresizemodeexact; self.requestoptions.deliverymode = phimagerequestoptionsdeliverymodehighqualityformat; // 1 key self.requestoptions.synchronous = true; // self.assets = [nsmutablearray arraywitharray:assets]; phimagemanager *manager = [phimagemanager defaultmanager]; albumimages = [nsmutablearray arraywithcapacity:[assetarray count]]; // assets contains phasset objects. __block uiimage *ima; (phasset *asset in assetarray) { // asset [manager requestimageforasset:asset targetsize:phimagemanagermaximumsize contentmode:phimagecontentmodedefault options:self.requestoptions resulthandler:^void(uiimage *image, nsdictionary *info) { //retrive images ima = image; }]; } }
using phimagemanager can full original image.
Comments
Post a Comment