Formats

My browser tab opens almost anything now

Once slides worked without a server, I got curious about what else a tab can open by itself. Old Word files, iPhone photos, mail, ebooks, archives.

· 2 min read

Once decks worked without a server, I got greedy. If a browser tab can draw a PowerPoint file by itself, what else can it open?

The answer is turning into a free file viewer, open.kamali.ai: drop in almost anything and it opens in the tab. Nothing gets uploaded, because nothing needs to be.

Old Word and PowerPoint files

This part started with a simple question: how hard is it to render old .doc files? Hasn't anyone reverse engineered those?

It turns out Microsoft did it for us. The old binary formats are described in Microsoft's own open specifications: one for the container, one for Word documents, one for PowerPoint, one for the drawings inside them. They're long and dry, but complete.

So old .doc and .ppt files now get converted in the browser into modern .docx and .pptx, and drawn by the same code as everything else. Text, formatting, styles, lists, tables, pictures, floating shapes, headers and footers, notes. Even old form fields stay fields, so you can still fill them in.

I checked it on a real archive of old documents against the server conversion, and then took LibreOffice off the servers completely. That felt good.

iPhone photos, with the phone's own decoder

HEIC, the format iPhones save photos in, is a licensing headache. Shipping your own decoder isn't something you want to do.

But most devices already have a hardware HEVC decoder for video, and the browser can reach it through WebCodecs. A HEIC photo is basically one frame of HEVC video. So the tab hands that frame to the device's own decoder and gets pixels back. This week it also started reading the HDR gain map and the depth picture iPhones hide in the file.

Everything else

The list keeps growing, mostly because each format is a small, fun puzzle:

  • mail files (.msg, RTF bodies)
  • Photoshop files and camera raws
  • ebooks (EPUB, MOBI, FB2, DjVu)
  • archives (ZIP, 7z, RAR), including a film stored uncompressed inside a RAR, played straight from where it sits without unpacking
  • PDF and Word forms you can fill in and save
  • CAD drawings (DXF)

The rule I keep coming back to: if the browser or the device can already do the hard part, use it. If not, write it from the spec. Don't ship a whole office suite to open one file.