This repository was archived by the owner on Dec 12, 2025. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathimage.php
More file actions
88 lines (83 loc) · 2.49 KB
/
Copy pathimage.php
File metadata and controls
88 lines (83 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
/*********************************************************
* @desc: Listen music web database 2.0
* @authors: Angel Calleja (code injection 2008-2009)
* Cyril Russo (code injection 2009)
* http://www.thehandcoders.com (code injection 2008)
* @url: http://www.raro.dsland.org
* @license: licensed under GPL licenses
* http://www.gnu.org/licenses/gpl.html
* @comments:
**********************************************************/
include_once("includes/listen_art.php");
$saveart=FALSE;
$url = $GLOBALS["http_url"].$GLOBALS["uri_path"];
If(isset($_GET["id"])){$album_id = $_GET["id"];}
$thumb = (isset($_GET["thumb"]) ? $_GET["thumb"] : "");
// Decide what size this image is
switch ($thumb) {
case "1":
$size = array("height" => 80, "width" => 80);
break;
case "2":
$size = array("height" => 128, "width" => 128);
break;
case "3":
$size = array("height" => 50, "width" => 50);
break;
case "4":
$size = array("height" => 60, "width" => 60);
break;
case "5":
$size = array("height" => 230, "width" => 230);
break;
default:
$size = array("height" => 275, "width" => 275);
break;
}
if(isset($_GET["filename"]))
{
$art=getID3_img($_GET["filename"]);
} else
{
// Attempt to pull art from the database
$art = get_db_art($album_id);
if(empty($art["raw"])){
$art=get_folder_art($album_id);
if (isset($art["file"])) {
$art["raw"] =file_get_contents($art["file"]);
} else {
$art = get_id3_art($album_id);
if(empty($art["raw"]))
{
$art = get_lastfm_art($album_id);
if (isset($art["file"]))
{
$art["raw"] =file_get_contents($art["file"]);
$saveart=TRUE;
}
}
}
//if we have art, make a thumbnail and
//stick both in the database and if is captured from lasfm it will be wrote in folder
}
if($saveart)
{
if (!file_exists($art["localpath"]))
{
$art["raw"] = (img_resize($art, array("height" => 230, "width" => 230), end(explode("/", $art["mime"]))));
file_put_contents($art["localpath"], $art["raw"]);
}
}
}
if (!isset($art["mime"]))
$art = array("mime" => "image/gif", "raw" => file_get_contents($url . "/images/blankalbum.gif"));
if (!empty($_REQUEST["thumb"]))
$art["raw"] = (img_resize($art, $size, end(explode("/", $art["mime"]))));
header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-type: ". $art["mime"]);
echo $art["raw"];
?>