{"action":"created","comment":{"url":"https://api.github.com/repos/OpenImageIO/oiio/pulls/comments/81217936","pull_request_review_id":2214537,"id":81217936,"diff_hunk":"@@ -2495,6 +2495,26 @@ ImageCacheImpl::get_image_info (ImageCacheFile *file,\n         *(int *)data = file->is_udim();\n         return true;\n     }\n+    if (file->is_udim() && dataname == s_channels) {\n+        // Special case -- it's ok to ask for a UDIM's channels. It'll\n+        // search for a concrete file. Beware, this will cause trouble\n+        // if different panels of the same UDIM scheme have different\n+        // numbers of channels! Search the 10x10 files for a match, give\n+        // up if not found.\n+        ImageCacheFile *concretefile = NULL;\n+        for (int j = 0; j < 10 && !concretefile; ++j) {","path":"src/libtexture/imagecache.cpp","position":null,"original_position":11,"commit_id":"d2123d536b433a8765116d2fc5e7ad11ed1cc922","original_commit_id":"36d0ad2434a69be45bf36a78c5ebcb0673d42689","user":{"login":"fpsunflower","id":578593,"avatar_url":"https://avatars.githubusercontent.com/u/578593?v=3","gravatar_id":"","url":"https://api.github.com/users/fpsunflower","html_url":"https://github.com/fpsunflower","followers_url":"https://api.github.com/users/fpsunflower/followers","following_url":"https://api.github.com/users/fpsunflower/following{/other_user}","gists_url":"https://api.github.com/users/fpsunflower/gists{/gist_id}","starred_url":"https://api.github.com/users/fpsunflower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpsunflower/subscriptions","organizations_url":"https://api.github.com/users/fpsunflower/orgs","repos_url":"https://api.github.com/users/fpsunflower/repos","events_url":"https://api.github.com/users/fpsunflower/events{/privacy}","received_events_url":"https://api.github.com/users/fpsunflower/received_events","type":"User","site_admin":false},"body":"Probably? Taisuke would know best. Its certainly a good place to start.\r\n\r\nCode LGTM otherwise.","created_at":"2016-09-29T19:39:44Z","updated_at":"2016-09-29T19:39:44Z","html_url":"https://github.com/OpenImageIO/oiio/pull/1502#discussion_r81217936","pull_request_url":"https://api.github.com/repos/OpenImageIO/oiio/pulls/1502","_links":{"self":{"href":"https://api.github.com/repos/OpenImageIO/oiio/pulls/comments/81217936"},"html":{"href":"https://github.com/OpenImageIO/oiio/pull/1502#discussion_r81217936"},"pull_request":{"href":"https://api.github.com/repos/OpenImageIO/oiio/pulls/1502"}}},"pull_request":{"url":"https://api.github.com/repos/OpenImageIO/oiio/pulls/1502","id":87376832,"html_url":"https://github.com/OpenImageIO/oiio/pull/1502","diff_url":"https://github.com/OpenImageIO/oiio/pull/1502.diff","patch_url":"https://github.com/OpenImageIO/oiio/pull/1502.patch","issue_url":"https://api.github.com/repos/OpenImageIO/oiio/issues/1502","number":1502,"state":"open","locked":false,"title":"UDIM get_image_info query for \"channels\" should succeed.","user":{"login":"lgritz","id":504179,"avatar_url":"https://avatars.githubusercontent.com/u/504179?v=3","gravatar_id":"","url":"https://api.github.com/users/lgritz","html_url":"https://github.com/lgritz","followers_url":"https://api.github.com/users/lgritz/followers","following_url":"https://api.github.com/users/lgritz/following{/other_user}","gists_url":"https://api.github.com/users/lgritz/gists{/gist_id}","starred_url":"https://api.github.com/users/lgritz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgritz/subscriptions","organizations_url":"https://api.github.com/users/lgritz/orgs","repos_url":"https://api.github.com/users/lgritz/repos","events_url":"https://api.github.com/users/lgritz/events{/privacy}","received_events_url":"https://api.github.com/users/lgritz/received_events","type":"User","site_admin":false},"body":"In general, ImageCache::get_image_info (or the TextureSystem equivalent, get_texture_info) fails for UDIM texture patterns, for all but the \"UDIM\" query (which means, \"is this a UDIM file\").\r\n\r\nThis is because the UDIM name is a pattern, not a concrete file. The specific file is not resolved until the texture() call itself, because the actual filename will depend on the st coordinates being looked up. The get_texture_info query is not for a particular coordinate.\r\n\r\nBut let's say that you are writing a shader and want different behavior or code paths depending on properties of the file, such as the number of channels. Those queries would fail.\r\n\r\nSo the purpose of this patch is to make the \"channels\" query to succeed. It will find the first file to match the pattern (the 0,0 corner may not exist -- the UDIM set is allowed to be sparse) and query that.  The big caveat is, this won't be helpful if the textures in the UDIM collection don't all have the same number of channels. So watch out for that if you want to throw caution to the wind and do queries on UDIM patterns.\r\n\r\nTo start with, since this is so inherently dangerous, \"channels\" is the only query we support this way. We may expand this set later, if there are other queries that (a) especially useful, and (b) make sense to constrain (or assume) to be identical for all individual textures in the same UDIM set.","created_at":"2016-09-29T19:23:00Z","updated_at":"2016-09-29T19:39:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8f823faf5a69ff703768a97d4b435f7e6ea0c34","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OpenImageIO/oiio/pulls/1502/commits","review_comments_url":"https://api.github.com/repos/OpenImageIO/oiio/pulls/1502/comments","review_comment_url":"https://api.github.com/repos/OpenImageIO/oiio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenImageIO/oiio/issues/1502/comments","statuses_url":"https://api.github.com/repos/OpenImageIO/oiio/statuses/d2123d536b433a8765116d2fc5e7ad11ed1cc922","head":{"label":"lgritz:lg-udim","ref":"lg-udim","sha":"d2123d536b433a8765116d2fc5e7ad11ed1cc922","user":{"login":"lgritz","id":504179,"avatar_url":"https://avatars.githubusercontent.com/u/504179?v=3","gravatar_id":"","url":"https://api.github.com/users/lgritz","html_url":"https://github.com/lgritz","followers_url":"https://api.github.com/users/lgritz/followers","following_url":"https://api.github.com/users/lgritz/following{/other_user}","gists_url":"https://api.github.com/users/lgritz/gists{/gist_id}","starred_url":"https://api.github.com/users/lgritz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgritz/subscriptions","organizations_url":"https://api.github.com/users/lgritz/orgs","repos_url":"https://api.github.com/users/lgritz/repos","events_url":"https://api.github.com/users/lgritz/events{/privacy}","received_events_url":"https://api.github.com/users/lgritz/received_events","type":"User","site_admin":false},"repo":{"id":1322330,"name":"oiio","full_name":"lgritz/oiio","owner":{"login":"lgritz","id":504179,"avatar_url":"https://avatars.githubusercontent.com/u/504179?v=3","gravatar_id":"","url":"https://api.github.com/users/lgritz","html_url":"https://github.com/lgritz","followers_url":"https://api.github.com/users/lgritz/followers","following_url":"https://api.github.com/users/lgritz/following{/other_user}","gists_url":"https://api.github.com/users/lgritz/gists{/gist_id}","starred_url":"https://api.github.com/users/lgritz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgritz/subscriptions","organizations_url":"https://api.github.com/users/lgritz/orgs","repos_url":"https://api.github.com/users/lgritz/repos","events_url":"https://api.github.com/users/lgritz/events{/privacy}","received_events_url":"https://api.github.com/users/lgritz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lgritz/oiio","description":"OpenImageIO","fork":true,"url":"https://api.github.com/repos/lgritz/oiio","forks_url":"https://api.github.com/repos/lgritz/oiio/forks","keys_url":"https://api.github.com/repos/lgritz/oiio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lgritz/oiio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lgritz/oiio/teams","hooks_url":"https://api.github.com/repos/lgritz/oiio/hooks","issue_events_url":"https://api.github.com/repos/lgritz/oiio/issues/events{/number}","events_url":"https://api.github.com/repos/lgritz/oiio/events","assignees_url":"https://api.github.com/repos/lgritz/oiio/assignees{/user}","branches_url":"https://api.github.com/repos/lgritz/oiio/branches{/branch}","tags_url":"https://api.github.com/repos/lgritz/oiio/tags","blobs_url":"https://api.github.com/repos/lgritz/oiio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lgritz/oiio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lgritz/oiio/git/refs{/sha}","trees_url":"https://api.github.com/repos/lgritz/oiio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lgritz/oiio/statuses/{sha}","languages_url":"https://api.github.com/repos/lgritz/oiio/languages","stargazers_url":"https://api.github.com/repos/lgritz/oiio/stargazers","contributors_url":"https://api.github.com/repos/lgritz/oiio/contributors","subscribers_url":"https://api.github.com/repos/lgritz/oiio/subscribers","subscription_url":"https://api.github.com/repos/lgritz/oiio/subscription","commits_url":"https://api.github.com/repos/lgritz/oiio/commits{/sha}","git_commits_url":"https://api.github.com/repos/lgritz/oiio/git/commits{/sha}","comments_url":"https://api.github.com/repos/lgritz/oiio/comments{/number}","issue_comment_url":"https://api.github.com/repos/lgritz/oiio/issues/comments{/number}","contents_url":"https://api.github.com/repos/lgritz/oiio/contents/{+path}","compare_url":"https://api.github.com/repos/lgritz/oiio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lgritz/oiio/merges","archive_url":"https://api.github.com/repos/lgritz/oiio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lgritz/oiio/downloads","issues_url":"https://api.github.com/repos/lgritz/oiio/issues{/number}","pulls_url":"https://api.github.com/repos/lgritz/oiio/pulls{/number}","milestones_url":"https://api.github.com/repos/lgritz/oiio/milestones{/number}","notifications_url":"https://api.github.com/repos/lgritz/oiio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lgritz/oiio/labels{/name}","releases_url":"https://api.github.com/repos/lgritz/oiio/releases{/id}","deployments_url":"https://api.github.com/repos/lgritz/oiio/deployments","created_at":"2011-02-02T23:16:23Z","updated_at":"2015-05-07T17:17:35Z","pushed_at":"2016-09-29T19:38:51Z","git_url":"git://github.com/lgritz/oiio.git","ssh_url":"git@github.com:lgritz/oiio.git","clone_url":"https://github.com/lgritz/oiio.git","svn_url":"https://github.com/lgritz/oiio","homepage":"http://www.openimageio.org","size":114132,"stargazers_count":5,"watchers_count":5,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":5,"default_branch":"master"}},"base":{"label":"OpenImageIO:master","ref":"master","sha":"dfa2fdf49f1b67058c00c76a9ab355c84d44e13e","user":{"login":"OpenImageIO","id":547887,"avatar_url":"https://avatars.githubusercontent.com/u/547887?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenImageIO","html_url":"https://github.com/OpenImageIO","followers_url":"https://api.github.com/users/OpenImageIO/followers","following_url":"https://api.github.com/users/OpenImageIO/following{/other_user}","gists_url":"https://api.github.com/users/OpenImageIO/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenImageIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenImageIO/subscriptions","organizations_url":"https://api.github.com/users/OpenImageIO/orgs","repos_url":"https://api.github.com/users/OpenImageIO/repos","events_url":"https://api.github.com/users/OpenImageIO/events{/privacy}","received_events_url":"https://api.github.com/users/OpenImageIO/received_events","type":"Organization","site_admin":false},"repo":{"id":1322284,"name":"oiio","full_name":"OpenImageIO/oiio","owner":{"login":"OpenImageIO","id":547887,"avatar_url":"https://avatars.githubusercontent.com/u/547887?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenImageIO","html_url":"https://github.com/OpenImageIO","followers_url":"https://api.github.com/users/OpenImageIO/followers","following_url":"https://api.github.com/users/OpenImageIO/following{/other_user}","gists_url":"https://api.github.com/users/OpenImageIO/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenImageIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenImageIO/subscriptions","organizations_url":"https://api.github.com/users/OpenImageIO/orgs","repos_url":"https://api.github.com/users/OpenImageIO/repos","events_url":"https://api.github.com/users/OpenImageIO/events{/privacy}","received_events_url":"https://api.github.com/users/OpenImageIO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenImageIO/oiio","description":"OpenImageIO","fork":false,"url":"https://api.github.com/repos/OpenImageIO/oiio","forks_url":"https://api.github.com/repos/OpenImageIO/oiio/forks","keys_url":"https://api.github.com/repos/OpenImageIO/oiio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenImageIO/oiio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenImageIO/oiio/teams","hooks_url":"https://api.github.com/repos/OpenImageIO/oiio/hooks","issue_events_url":"https://api.github.com/repos/OpenImageIO/oiio/issues/events{/number}","events_url":"https://api.github.com/repos/OpenImageIO/oiio/events","assignees_url":"https://api.github.com/repos/OpenImageIO/oiio/assignees{/user}","branches_url":"https://api.github.com/repos/OpenImageIO/oiio/branches{/branch}","tags_url":"https://api.github.com/repos/OpenImageIO/oiio/tags","blobs_url":"https://api.github.com/repos/OpenImageIO/oiio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenImageIO/oiio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenImageIO/oiio/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenImageIO/oiio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenImageIO/oiio/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenImageIO/oiio/languages","stargazers_url":"https://api.github.com/repos/OpenImageIO/oiio/stargazers","contributors_url":"https://api.github.com/repos/OpenImageIO/oiio/contributors","subscribers_url":"https://api.github.com/repos/OpenImageIO/oiio/subscribers","subscription_url":"https://api.github.com/repos/OpenImageIO/oiio/subscription","commits_url":"https://api.github.com/repos/OpenImageIO/oiio/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenImageIO/oiio/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenImageIO/oiio/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenImageIO/oiio/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenImageIO/oiio/contents/{+path}","compare_url":"https://api.github.com/repos/OpenImageIO/oiio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenImageIO/oiio/merges","archive_url":"https://api.github.com/repos/OpenImageIO/oiio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenImageIO/oiio/downloads","issues_url":"https://api.github.com/repos/OpenImageIO/oiio/issues{/number}","pulls_url":"https://api.github.com/repos/OpenImageIO/oiio/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenImageIO/oiio/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenImageIO/oiio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenImageIO/oiio/labels{/name}","releases_url":"https://api.github.com/repos/OpenImageIO/oiio/releases{/id}","deployments_url":"https://api.github.com/repos/OpenImageIO/oiio/deployments","created_at":"2011-02-02T23:03:28Z","updated_at":"2016-09-29T05:29:25Z","pushed_at":"2016-09-29T19:38:51Z","git_url":"git://github.com/OpenImageIO/oiio.git","ssh_url":"git@github.com:OpenImageIO/oiio.git","clone_url":"https://github.com/OpenImageIO/oiio.git","svn_url":"https://github.com/OpenImageIO/oiio","homepage":"http://www.openimageio.org","size":139491,"stargazers_count":472,"watchers_count":472,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":230,"mirror_url":null,"open_issues_count":83,"forks":230,"open_issues":83,"watchers":472,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenImageIO/oiio/pulls/1502"},"html":{"href":"https://github.com/OpenImageIO/oiio/pull/1502"},"issue":{"href":"https://api.github.com/repos/OpenImageIO/oiio/issues/1502"},"comments":{"href":"https://api.github.com/repos/OpenImageIO/oiio/issues/1502/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenImageIO/oiio/pulls/1502/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenImageIO/oiio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenImageIO/oiio/pulls/1502/commits"},"statuses":{"href":"https://api.github.com/repos/OpenImageIO/oiio/statuses/d2123d536b433a8765116d2fc5e7ad11ed1cc922"}}}}
{"actor":{"display_login":"fpsunflower"}}