Repository navigation
fix(theming): render touch icon and favicon from the uploaded favicon - #66822
jiri001meitner wants to merge 1 commit into
Conversation
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
dcdb666 to
1793eb9
Compare
An uploaded favicon was served as it is, so the touch icon of an SVG favicon was sent as application/octet-stream and browsers rejected it. The favicon was rasterized at the intrinsic size of the SVG image, and the web app manifest declared types and sizes that did not match. - The touch icon is rendered from the uploaded favicon. A square favicon with opaque edges, already designed as a tile, fills the icon and its rounded corners get the edge color. Other favicons are rendered like the app icons on the primary color, as iOS fills transparency with black. - An SVG favicon is rendered at 512 px. A raster favicon is not enlarged, the icon is at most 512 px. If the icon would be smaller than the 144 px required for installable web apps, the generated touch icon is used, as when the favicon cannot be rendered. - The web app manifest uses the uploaded favicon without a background, as only iOS fills transparency and it uses the touch icon. An SVG favicon is listed as SVG first, followed by a PNG image for browsers without SVG icons, served by the new manifest-icon endpoint. A raster favicon is listed as this PNG image only, at its own size up to 512 px. The touch icon is listed if the favicon cannot be used. - An SVG favicon is sent as SVG, browsers render it more reliably than ImageMagick. A raster favicon is converted to a square ICO file with 16 to 128 px images without upscaling, an uploaded ICO file is kept. - The largest image of an ICO file or an animation is used. A fully transparent rendering counts as failed, and failed renderings are cached. - Without Imagick, the uploaded favicon is sent with its MIME type. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Jiří Meitner <1045987+jiri001meitner@users.noreply.github.com>
1793eb9 to
ec99679
Compare
Summary
An uploaded favicon was served by the touch icon endpoint as is, so an SVG favicon was sent as
application/octet-stream. Browsers did not display it, the web app manifest icon failed, and Chrome did not offer to install Nextcloud. The favicon itself was rasterized from the SVG at its intrinsic size (often 16 or 24 px), and the manifest declared types and sizes that did not match what was served.Touch icon (
/apps/theming/icon, used asapple-touch-icon):Favicon (
/apps/theming/favicon):Web app manifest:
sizes: any), followed by a transparent 512 px PNG image for browsers without SVG icons; Chrome on desktop installs the app with the SVG icon and does not fetch the PNG image/apps/theming/manifest-iconHow to verify:
curl -sIon/apps/theming/favicon,/apps/theming/iconand/apps/theming/manifest-icon:image/svg+xml,image/png,image/png(before:image/x-iconandapplication/octet-stream)./apps/theming/manifest/corelists the SVG icon (sizes: any) and the 512 px PNG icon; Chrome offers to install Nextcloud.Not covered here:
core/img/manifest.jsonis used since Nextcloud 32, so the themed icon and name do not reach a web app installed from there: [Bug]: PWA (when installed from login screen) - force renamed to 'Nextcloud' instead of custom server name #56135, addressed by the draft Fix inconsistency: Use themed manifest for PWA installations to avoid breaking user theming #58557.nextcloudDocker image) renders some SVG files incompletely; fixes are proposed in Render text from Cairo-exported SVG in the internal SVG renderer ImageMagick/ImageMagick#9126, Resolve currentColor from the inherited color property in the MSVG coder ImageMagick/ImageMagick#9127, Keep the aspect ratio of the view box in the MSVG coder ImageMagick/ImageMagick#9128 and Parse font family lists with family names that contain spaces ImageMagick/ImageMagick#9129 (open). The favicon and the SVG manifest icon are not affected as they are sent as SVG; a touch icon that renders fully transparent falls back to the generated one.TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)
The code, tests and this description were drafted with Claude Code (claude-opus-5-5), which also tested the change on live instances in Chrome and Firefox.