{"action":"created","issue":{"url":"https://api.github.com/repos/OpenImageIO/oiio/issues/1412","repository_url":"https://api.github.com/repos/OpenImageIO/oiio","labels_url":"https://api.github.com/repos/OpenImageIO/oiio/issues/1412/labels{/name}","comments_url":"https://api.github.com/repos/OpenImageIO/oiio/issues/1412/comments","events_url":"https://api.github.com/repos/OpenImageIO/oiio/issues/1412/events","html_url":"https://github.com/OpenImageIO/oiio/pull/1412","id":154346485,"number":1412,"title":"Fix jpegoutput aspect ratio","user":{"login":"aoblet","id":7293270,"avatar_url":"https://avatars.githubusercontent.com/u/7293270?v=3","gravatar_id":"","url":"https://api.github.com/users/aoblet","html_url":"https://github.com/aoblet","followers_url":"https://api.github.com/users/aoblet/followers","following_url":"https://api.github.com/users/aoblet/following{/other_user}","gists_url":"https://api.github.com/users/aoblet/gists{/gist_id}","starred_url":"https://api.github.com/users/aoblet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aoblet/subscriptions","organizations_url":"https://api.github.com/users/aoblet/orgs","repos_url":"https://api.github.com/users/aoblet/repos","events_url":"https://api.github.com/users/aoblet/events{/privacy}","received_events_url":"https://api.github.com/users/aoblet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-11T21:24:03Z","updated_at":"2016-05-17T22:43:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OpenImageIO/oiio/pulls/1412","html_url":"https://github.com/OpenImageIO/oiio/pull/1412","diff_url":"https://github.com/OpenImageIO/oiio/pull/1412.diff","patch_url":"https://github.com/OpenImageIO/oiio/pull/1412.patch"},"body":"X_density and Y_density were swapped.\r\n\r\n- PAR = xResolution/yResolution.\r\n- So if we set yResolution to a constant C, xResolution becomes PAR*C\r\n- We add + 0.5 for round."},"comment":{"url":"https://api.github.com/repos/OpenImageIO/oiio/issues/comments/219876211","html_url":"https://github.com/OpenImageIO/oiio/pull/1412#issuecomment-219876211","issue_url":"https://api.github.com/repos/OpenImageIO/oiio/issues/1412","id":219876211,"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},"created_at":"2016-05-17T22:43:06Z","updated_at":"2016-05-17T22:43:06Z","body":"Sorry for the delay. This particular bit of logic always makes my head hurt, so I procrastinated a bit in looking at this.\r\n\r\nI'm not convinced that it was wrong before. \r\n\r\nIf you have a pixel aspect ratio < 1, say 0.5, that means that pixels are tall and skinny, whereas a pixel aspect of 2.0, say, would have pixels wide and short, if you know what I mean.\r\n\r\nTall skinny pixels will have HIGHER xdensity than ydensity, because obviously there are more pixels per inch (or cm, whatever) horizontally than vertically, right?\r\n\r\nThat means that ydensity = xdensity * pixelaspect, as I had it before. Because aspect<1 should mean that ydensity < xdensity, and aspect > 1 implies that xdensity < ydensity.\r\n\r\nIf you think I'm wrong, please explain your logic, provide an example file for which our current software fails, or point me to a place in the JPEG/JFIF spec or libjpeg docs that says I've got this backwards. (Maybe I do.)\r\n"}}