{"action":"created","issue":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3144","repository_url":"https://api.github.com/repos/NativeScript/NativeScript","labels_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3144/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3144/comments","events_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3144/events","html_url":"https://github.com/NativeScript/NativeScript/issues/3144","id":190949784,"number":3144,"title":"[Question] Difference between image-asset and image-source?","user":{"login":"NordlingArt","id":2098838,"avatar_url":"https://avatars.githubusercontent.com/u/2098838?v=3","gravatar_id":"","url":"https://api.github.com/users/NordlingArt","html_url":"https://github.com/NordlingArt","followers_url":"https://api.github.com/users/NordlingArt/followers","following_url":"https://api.github.com/users/NordlingArt/following{/other_user}","gists_url":"https://api.github.com/users/NordlingArt/gists{/gist_id}","starred_url":"https://api.github.com/users/NordlingArt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NordlingArt/subscriptions","organizations_url":"https://api.github.com/users/NordlingArt/orgs","repos_url":"https://api.github.com/users/NordlingArt/repos","events_url":"https://api.github.com/users/NordlingArt/events{/privacy}","received_events_url":"https://api.github.com/users/NordlingArt/received_events","type":"User","site_admin":false},"labels":[{"id":203689647,"url":"https://api.github.com/repos/NativeScript/NativeScript/labels/T:Question","name":"T:Question","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-22T09:40:17Z","updated_at":"2016-11-22T12:07:54Z","closed_at":null,"body":"I see no documentation for image-asset and I am unable to find the difference between them. I am aware of iOS PHAsset that delivers \"assets\". Is this module to be used with native image assets, and what is the purpose of this module compared to image-source?\r\n\r\nTo clarify my question. Is this the same:\r\n\r\n```js\r\n// var nativeAsset = [PHAsset for iOS and something else for Android];\r\nvar asset = new imageAsset.ImageAsset(nativeAsset);\r\ntest.options = { width: 100, height: 100, keepAspectRatio: false };\r\n\r\nasset.getImageAsync(function(image, error) {\r\n  var newImage = imageSource.fromNativeSource(image);\r\n});\r\n```\r\n\r\nAs this (iOS)?\r\n  \r\n```js\r\nvar manager = PHImageManager.defaultManager();\r\nvar options = PHImageRequestOptions.alloc().init();\r\n\r\noptions.resizeMode = PHImageRequestOptionsResizeModeFast;\r\noptions.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;\r\n// options.synchronous = true; // Should be false because of ImageAsset.getImageAsync()?\r\n\r\nmanager.requestImageForAssetTargetSizeContentModeOptionsResultHandler(asset, CGSizeMake(100, 100), PHImageContentModeAspectFill, options, function(result, info) {\r\n  var newImage = imageSource.fromNativeSource(result);\r\n});\r\n```\r\n\r\nExcept that image-asset handles both platforms?"},"comment":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/comments/262224675","html_url":"https://github.com/NativeScript/NativeScript/issues/3144#issuecomment-262224675","issue_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3144","id":262224675,"user":{"login":"NickIliev","id":18008302,"avatar_url":"https://avatars.githubusercontent.com/u/18008302?v=3","gravatar_id":"","url":"https://api.github.com/users/NickIliev","html_url":"https://github.com/NickIliev","followers_url":"https://api.github.com/users/NickIliev/followers","following_url":"https://api.github.com/users/NickIliev/following{/other_user}","gists_url":"https://api.github.com/users/NickIliev/gists{/gist_id}","starred_url":"https://api.github.com/users/NickIliev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickIliev/subscriptions","organizations_url":"https://api.github.com/users/NickIliev/orgs","repos_url":"https://api.github.com/users/NickIliev/repos","events_url":"https://api.github.com/users/NickIliev/events{/privacy}","received_events_url":"https://api.github.com/users/NickIliev/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T12:07:54Z","updated_at":"2016-11-22T12:07:54Z","body":"Hi @NordlingArt \r\n\r\nYou can take a look at the implementation of image-asset for iOS  [here](https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/image-asset/image-asset.ios.ts) and indeed one of the reasons for introducing the image-asset module is to handle the work with PHAsset which is required in order to work with iOS Photo framework.  Also, a lot of optimizations were introduced as well. \r\n"}}
{"actor":{"display_login":"NickIliev"}}