Re: [w3c/manifest] Example suggests that `icons` `sizes` mean a minimum size, but normative text doesn't support that (#925)

@mgiuca wrote:
> But you do allow icons of size X to be used where <X is desired (by the above description)

That's correct. My assumption was that the size specified in the manifest is exact, but for the purposes of my algorithm (not part of the manifest processing algorithm but rather a helper for the UI) the match with the target size doesn't need to be exact. Its purpose is to find the closest match possible.

---

Thanks for the drive-by review. I miss having a team who can do code reviews and catch my silly mistakes!

> You might want to update 'badge' to 'monochrome' as we've changed that in the spec.

Yeah thanks for the heads up, I had seen the discussion. Quite a lot has changed in the spec since I implemented this in October last year!

> But really the intent of this check seems to be "if an icon is being used for some other special purpose, ignore it". Really, then, the check should be "if the icon has an explicit purpose and does not include "any"".

Good catch. I hadn't realised it was common for icons to specify more than one purpose.

> I think you forgot Number().

Oops.

> It seems to look for either the smallest icon >= target size, or the largest icon <= target size, biased by whichever it sees first of smaller or larger.

Good catch.

I think I've fixed all these issues in https://github.com/webianproject/shell/pull/230 but really I need to add some unit tests to make sure all the corner cases are covered! I'm also pretty sure this algorithm could be optimised by just sorting the list first...

Feel free to file any further [issues](https://github.com/webianproject/shell/issues) you find. (I'm not actively working on that repo as it's a bit of a side project, but am planning to use that code in [another one](https://github.com/krellian/kiosk) so these issues are all relevant.)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/925#issuecomment-662975941

Received on Thursday, 23 July 2020 12:23:17 UTC