summaryrefslogtreecommitdiff
path: root/albumart.php
blob: c2551fd9658a347fe37446fd59fc356fd617fec0 (plain)
1
2
3
4
5
6
7
8
9
10
11
<?php

$songs = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/content/songs.json"), true);

if (!isset($_GET["i"]) || !isset($songs[$_GET["i"]])) {
    die();
}

header("Content-Type: image/jpeg");
header("Content-Length: " . filesize($_SERVER['DOCUMENT_ROOT'] . "/assets/content/" . $_GET["i"] . ".jpg"));
readfile($_SERVER['DOCUMENT_ROOT'] . "/assets/content/" . $_GET["i"] . ".jpg");