gitwtfhub

wtf is node-midec?

sapphi-red/node-midec — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2021-06-09

1GoAudience · developerComplexity · 2/5DormantSetup · easy

TL;DR

A lightweight WebAssembly library that tells you whether an image file (GIF, APNG, WebP, HEIF/AVIF) is animated or static.

Mindmap

mindmap
  root((repo))
    What it does
      Detects animated images
      Supports many formats
      Runs via WebAssembly
    Tech stack
      Go
      WebAssembly
      JavaScript
    Use cases
      Show play button on GIFs
      Validate uploads
      Optimize image delivery
    Audience
      Web developers
      Backend developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Detect whether an uploaded image is animated so you can show a play button icon.

REASON 2

Validate and categorize animated vs static images on the server before storing them.

REASON 3

Optimize delivery differently for static images versus animated GIFs or WebP files.

REASON 4

Check APNG, animated WebP, or HEIF/AVIF files for animation without external services.

What's in the stack?

GoWebAssemblyJavaScriptNode.js

How it stacks up

sapphi-red/node-midecaegrail/aegrail-engineaeneasr/form
Stars111
LanguageGoGoGo
Last pushed2021-06-092019-03-08
MaintenanceDormantDormant
Setup difficultyeasyhardeasy
Complexity2/55/52/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

README is minimal, check the GitHub repo directly for supported formats and edge cases.

Wtf does this do

This repository provides a simple tool for detecting whether an image file is animated or static. It works with several modern image formats including animated GIFs, APNG (animated PNG), animated WebP, and animated HEIF/AVIF files. The benefit: instead of trying to parse image files yourself or relying on external services, you get a lightweight library that runs directly in your JavaScript application. The library is built using WebAssembly, which is a compact, fast binary format that browsers and Node.js can execute. The original detection logic was written in Go, then converted to WebAssembly so it can run anywhere JavaScript runs, whether that's in a web browser, a Node.js server, or anywhere else. You feed it a file's raw bytes and ask "is this animated?" and it returns a simple true or false answer. Using it is straightforward: you import the isAnimated function, load a file's contents as binary data, pass it to the function, and get back whether the image is animated. This is useful for web applications that need to handle images differently based on whether they're static or animated, for example, showing a play button only on animated images, or optimizing delivery of static images differently than videos. It's also handy for image upload systems that want to validate or categorize files on the server side before storing them. The project is a JavaScript wrapper around existing Go code, meaning it benefits from the reliability of an already-tested detector while making it accessible to JavaScript developers. The README doesn't include extensive documentation beyond a basic example, so you'd want to check the GitHub repository directly for more details on supported formats or edge cases.

Yoink these prompts

Prompt 1
Show me how to use the isAnimated function from node-midec to check an uploaded file.
Prompt 2
Help me integrate node-midec into a Node.js image upload endpoint to reject or flag animated files.
Prompt 3
Explain how node-midec detects animation across GIF, APNG, WebP, and AVIF formats.
Prompt 4
How do I use this WebAssembly library in the browser to check if a dropped image file is animated?

Frequently asked questions

wtf is node-midec?

A lightweight WebAssembly library that tells you whether an image file (GIF, APNG, WebP, HEIF/AVIF) is animated or static.

What language is node-midec written in?

Mainly Go. The stack also includes Go, WebAssembly, JavaScript.

Is node-midec actively maintained?

Dormant — no commits in 2+ years (last push 2021-06-09).

How hard is node-midec to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is node-midec for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.