INNER CODE UNIT · Python

_is_video_name

Nour833/StegoForge · web/app.py:48

def _is_video_name(name: str) -> bool:
    ext = Path(name).suffix.lower()
    return ext in {".mp4", ".webm"}


def _is_video_method(method: str | None) -> bool:
    return method in {"video-dct", "video-motion"}


# Magic bytes → (mime, extension)
_MAGIC_MAP = [
    (b"\x89PNG",           "image/png",        ".png"),
    (b"\xff\xd8\xff",      "image/jpeg",       ".jpg"),
    (b"GIF8",              "image/gif",        ".gif"),
    (b"BM",                "image/bmp",        ".bmp"),
    (b"II*\x00",           "image/tiff",       ".tiff"),
    (b"MM\x00*",           "image/tiff",       ".tiff"),
    (b"RIFF",              "audio/wav",        ".wav"),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…