server icon indicating copy to clipboard operation
server copied to clipboard

Icons for font files are incorrect in Files app

Open Mikescops opened this issue 5 years ago • 5 comments

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Upload a file that is .ttf or .woff
  2. See the the icon displayed in files app (same as pictures)

Expected behaviour

Have an icon that represent font formats

Actual behaviour

Icon displayed is a "picture" icon

Server configuration

Nextcloud version: 20.0.2

Screenshot

image

Mikescops avatar Dec 08 '20 08:12 Mikescops

What needs to be done:

Icons are stored here: core/img/filetypes

A mapping for mimetypes: https://github.com/nextcloud/server/blob/master/resources/config/mimetypealiases.dist.json

You either change the existing mapping (e.g. "application/font-woff": "image" to "application/font-woff": "font") or remove the aliases (to fallback to the default resolving).

https://github.com/nextcloud/server/blob/fda6ffc866cf8c5d3579fe95d1731ab747894002/lib/private/Files/Type/Detection.php#L348

Code to resolve a mime type to an icon. It first checks if there is an alias for the mimetype and looks for a file with the mime type name then.

kesselb avatar Dec 08 '20 10:12 kesselb

thanks @kesselb i'll do it then

@jancborchardt do you mind creating an icon for font types?

Mikescops avatar Dec 08 '20 13:12 Mikescops

Hey I am a first time contributor.. can I work on this?

ananyak19 avatar Nov 27 '22 10:11 ananyak19

Hi @kesselb ,

I'm trying to attempt this by updating the entry in mimetypealiases.dist.json. However, I got a message in the terminal when running ./occ maintenance:mimetype:update-js: Screen Shot 2023-06-20 at 9 56 49 PM

So I tried to omit the rest after "maintenance" and rerun the command, and I got this: Screen Shot 2023-06-20 at 9 58 11 PM I thought maybe it's not worth it to do trial and error after the last question that the terminal returned, so I terminated the terminal. Which direction should I take this?

@Mikescops Did you get this too when attempting to solve this issue?

JeaNugroho avatar Jun 21 '23 03:06 JeaNugroho

Install nextcloud to use the command maintenance:mimetype:update-js.

kesselb avatar Jun 21 '23 08:06 kesselb