{"action":"opened","issue":{"url":"https://api.github.com/repos/w3c/mediacapture-worker/issues/43","repository_url":"https://api.github.com/repos/w3c/mediacapture-worker","labels_url":"https://api.github.com/repos/w3c/mediacapture-worker/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/w3c/mediacapture-worker/issues/43/comments","events_url":"https://api.github.com/repos/w3c/mediacapture-worker/issues/43/events","html_url":"https://github.com/w3c/mediacapture-worker/issues/43","id":135327354,"number":43,"title":"Call mapDataInto() on an ImageBitmap which was created with a cropping area that is outside of the source image.","user":{"login":"kakukogou","id":1995769,"avatar_url":"https://avatars.githubusercontent.com/u/1995769?v=3","gravatar_id":"","url":"https://api.github.com/users/kakukogou","html_url":"https://github.com/kakukogou","followers_url":"https://api.github.com/users/kakukogou/followers","following_url":"https://api.github.com/users/kakukogou/following{/other_user}","gists_url":"https://api.github.com/users/kakukogou/gists{/gist_id}","starred_url":"https://api.github.com/users/kakukogou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kakukogou/subscriptions","organizations_url":"https://api.github.com/users/kakukogou/orgs","repos_url":"https://api.github.com/users/kakukogou/repos","events_url":"https://api.github.com/users/kakukogou/events{/privacy}","received_events_url":"https://api.github.com/users/kakukogou/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/w3c/mediacapture-worker/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"kakukogou","id":1995769,"avatar_url":"https://avatars.githubusercontent.com/u/1995769?v=3","gravatar_id":"","url":"https://api.github.com/users/kakukogou","html_url":"https://github.com/kakukogou","followers_url":"https://api.github.com/users/kakukogou/followers","following_url":"https://api.github.com/users/kakukogou/following{/other_user}","gists_url":"https://api.github.com/users/kakukogou/gists{/gist_id}","starred_url":"https://api.github.com/users/kakukogou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kakukogou/subscriptions","organizations_url":"https://api.github.com/users/kakukogou/orgs","repos_url":"https://api.github.com/users/kakukogou/repos","events_url":"https://api.github.com/users/kakukogou/events{/privacy}","received_events_url":"https://api.github.com/users/kakukogou/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2016-02-22T06:14:02Z","updated_at":"2016-02-22T06:14:02Z","closed_at":null,"body":"WHATWG spec allows users to pass cropping area while creating an `ImageBitmap`.\r\n```\r\ninterface ImageBitmapFactories {\r\n  Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image);\r\n  Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh);\r\n};\r\n```\r\nAnd for those pixels that are outside of the source image, fill them as transparent black. [Spec.](https://html.spec.whatwg.org/multipage/webappapis.html#cropped-to-the-source-rectangle)\r\n\r\n> If either sw or sh are negative, then the top-left corner of this rectangle will be to the left or above the (sx, sy) point. If any of the pixels on this rectangle are outside the area where the input bitmap was placed, then they will be transparent black in output.\r\n\r\nThis is reasonable since the `ImageBitmap` is used to be drawn onto canvas. However, we are now extending the `ImageBitmap` to be accessible in several kinds of format (via  `mapDataInto` method) and some formats do not support alpha-channel (for example, YUV444P), so we are not able to return \"transparent black\" in these formats.\r\n\r\n@ChiahungTai proposes that we should throw if users call `mapDataInto` on an `ImageBitmap` which was created with cropping area that is outside the original source image. With this error message, users should then create another `ImageBitmap` with a cropping area that is completely inside the source image.\r\n\r\n@rocallahan, @anssiko  and @smaug----, may I have your comments on this bug?"}}