Skip to content

Conversation

@elsiehupp
Copy link
Member

@elsiehupp elsiehupp commented Jan 24, 2021

The default favicon-touch renders incorrectly in Firefox:

Screen Shot 2021-01-24 at 3 11 44 AM

(shown on Mac, but also applicable on Linux and iOS)

This is because the apple-touch-icon specification (to the extent that it exists) expects the image referenced in <link rel='apple-touch-icon' href='favicon-touch.png'> to have squared corners. An icon with rounded corners is only expected by <link rel='apple-touch-icon-precomposed' href='favicon-touch.png'>. When a favicon is referenced without the -precomposed, Apple devices will go ahead and apply the rounded-corner mask to an image with square corners.

Note that the DigitalOcean and NYTimes apple-touch-icon images flanking the Nextcloud icon in the above screenshot both have square corners:

digitalocean nytimes

And, yes, they look fine in Safari (aside from the text wrapping):

Screen Shot 2021-01-24 at 3 38 33 AM

The current recommendation seems to be that icons referenced as apple-touch-icon have a resolution of 180px x 180px (the size of the DigitalOcean icon), though previously it was 144px x 144px (the size of the NYTimes icon). Firefox and Chrome on desktop seem to render icons at 192px x 192px, so it might actually be safer to default to that. Or something. The <link rel ...> tag can actually specify a large set of variations for a wide variety of circumstances.

There are plenty of other mindnumbing subtleties to getting a favicon to render correctly in every possible circumstance, and I am getting my information from realfavicongenerator.net. Nextcloud could plausibly integrate the Real Favicon Generator API in order to cover all its bases, but that's kind of above my pay grade at the moment, lol.

The changes I've made here are the bare minimum that should (hopefully) make the default Nextcloud favicon render correctly in Firefox (i.e. with the correct corner radius).

Oh, and I apparently neglected to sign my git commits, so... uh... let me know if and how I should fix that. Thanks! The "Details" link explained to me.

elsiehupp and others added 3 commits January 24, 2021 03:50
`apple-touch-icon` expects squared corners; only `apple-touch-icon-precomposed` expects pre-rounded corners. iOS and browsers apply their own corner radii to `apple-touch-icon`.

Signed-off-by: Elsie Hupp <github@elsiehupp.com>
removed rounded corners and increased size (exported from SVG)

Signed-off-by: Elsie Hupp <github@elsiehupp.com>
Updated dimensions of favicon-touch.png

Signed-off-by: Elsie Hupp <github@elsiehupp.com>
@elsiehupp elsiehupp force-pushed the favicon-touch-corners branch from 2ecaf4c to 7f54eaf Compare January 24, 2021 08:51
@elsiehupp
Copy link
Member Author

One thing I should clarify is that I don't know what manifest.json does, and I did not go through the effort of building and testing the cloned repository, so my change to manifest.json is just an educated guess.

@rullzer rullzer added the 3. to review Waiting for reviews label Jan 25, 2021
@rullzer
Copy link
Member

rullzer commented Jan 25, 2021

Thanks. @jancborchardt and co please have a look.

@marcoambrosini
Copy link
Member

Thanks for that @elsiehupp :)

@elsiehupp
Copy link
Member Author

FWIW it might be possible and/or better to have favicon-touch be 192px x 192px (for Firefox, Chrome, and Android), but I haven't been able to test anything because, again, I'm running nextcloud-snap. Here's a tentative 192px x 192px PNG if you'd like to test it:

favicon-touch

Getting hi-res favicons working in every possible scenario is kind of a rabbit hole, not to mention getting hi-res favicons auto-generated from a single image, like Nextcloud is apparently able to do with custom logos...

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks a lot @elsiehupp! :)

@jancborchardt jancborchardt merged commit e207b94 into nextcloud:master Feb 11, 2021
@welcome
Copy link

welcome bot commented Feb 11, 2021

Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22

@jancborchardt jancborchardt added bug design Design, UI, UX, etc. labels Feb 11, 2021
@jancborchardt jancborchardt added this to the Nextcloud 22 milestone Feb 11, 2021
@jancborchardt
Copy link
Member

/backport to stable21

@jancborchardt
Copy link
Member

By the way @elsiehupp we are always looking for more design contributors! :) If you are interested, maybe some of the design bugs are interesting to check out? https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3Adesign+label%3Abug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug design Design, UI, UX, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants