4
submitted 1 year ago* (last edited 1 year ago) by jackpot@lemmy.ml to c/asklemmy@lemmy.ml

(btw yes you can add new categories)

if you could standardise one file format for a task, what would it be:

  1. photos .jxl
  2. open domain image data .exr
  3. videos .av1
  4. lossless audio .flac
  5. lossy audio .opus
  6. subtitles srt/ass
  7. fonts .otf
  8. container mkv (doesnt contain .jxl)
  9. plain text utf-8 (many also say markup but disagree on the implementation)
  10. documents .odt
  11. archive files .tar.zst (this one is causing a bloodbath so i picked randomly)
  12. configuration files toml
  13. typesetting typst
  14. interchange format .ora
  15. models .gltf / .glb
  16. daw session files .dawproject
  17. otdr measurement results .xml
top 13 comments
sorted by: hot top controversial new old
[-] Tolookah@discuss.tchncs.de 10 points 1 year ago

I don't see a need, extensions are there for helping software more than helping people.

[-] Anonymouse@lemmy.world 4 points 1 year ago

It's actually the opposite. To my knowlegde, Windows is the only OS that I've used that uses the file extension to determine the contents, but then they hide it from the user. So maybe file extensions are only for windows?

[-] Tolookah@discuss.tchncs.de 2 points 1 year ago* (last edited 1 year ago)

How does osx know how to open a PDF not named .PDF?

[-] hedgehog@ttrpg.network 4 points 1 year ago

The standard system in macOS is based on a Uniform Type Indicator, or UTI, like public.plain-text for a plain text file, and public.jpeg for a JPEG image.

To determine the file type, macOS uses MIME types when downloading from the Internet, can still use old Classic Mac OS four-character type codes, and ultimately relies on UTIs.

To get the UTI of a given file, use the mdls (meta data list, part of Spotlight) command in the Terminal.

Check out https://en.m.wikipedia.org/wiki/Uniform_Type_Identifier for more info.

PDFs have a MIME type of application/pdf per the spec, but you might still encounter some with MIME types like application/x-pdf. MacOS reads the MIME type of a file, then assigns the com.adobe.pdf UTI (if it wasn’t already assigned by another Mac application).

[-] Tolookah@discuss.tchncs.de 1 points 1 year ago

Huh, TIL. Thanks!

[-] Synthead@lemmy.world 3 points 1 year ago* (last edited 1 year ago)
[-] jackpot@lemmy.ml 2 points 1 year ago
[-] Synthead@lemmy.world 2 points 1 year ago

The Freedesktop Foundation has already categorized a ton of stuff and more.

[-] jackpot@lemmy.ml 2 points 1 year ago

could you link the index apologies

[-] Synthead@lemmy.world 2 points 1 year ago
[-] jackpot@lemmy.ml 2 points 1 year ago

mate i am so confused sorry

[-] Synthead@lemmy.world 2 points 1 year ago* (last edited 1 year ago)

Here's an example of a PNG:

https://gitlab.freedesktop.org/xdg/shared-mime-info/-/blob/b7db17480af0aeeb6df5668e8d10e275527d2825/data/freedesktop.org.xml.in#L5345-5353

This says that PNG files...

  • Have a mime type of image/png
  • Have a full name of "PNG image"
  • Have an acronym of "PNG"
  • Have an expanded acronym of "Portable Network Graphics"
  • From byte 0, all PNG files have "\x89PNG\r\n\x1A\n" in the file content
  • Match a file glob pattern of "*.png" (case insensitive)

There are hundreds of entries like this in the XML with formal categorization :)

It sounds like you're trying to approach a solved problem, though. Why are you building a file list, and what are you going to use it for? What are you ultimately trying to do?

[-] jackpot@lemmy.ml 2 points 1 year ago

im trying to find the 'best' format for each category

this post was submitted on 05 Oct 2023
4 points (62.5% liked)

Asklemmy

44267 readers
948 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy 🔍

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~

founded 5 years ago
MODERATORS