Subversion-Projekte lars-tiefland.content-management

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?
2
	function imageConvert($path="/web/apache/pq-media.de/images/Bild_1")
3
	{
4
		$original=$path."/original";
5
		$handle=opendir($original);
6
 
7
		while ($image = readdir ($handle))
8
		{
9
			if (is_file ($original."/".$image))
10
			{
11
				$image = str_replace(" ", "\ ", $image);
12
				$image = str_replace("(", "\(", $image);
13
				$image = str_replace(")", "\)", $image);
14
 
15
				$cmd = array
16
						(
17
							"convert -scale 180x180 $original/$image $path/180x180/$image",
18
							"convert -scale 120x120 $original/$image $path/120x120/$image",
19
							"convert -scale 80x120 $original/$image $path/80x120/$image",
20
							"convert -scale 30x30 $original/$image $path/30x30/$image",
21
							"rm $original/$image"
22
						);
23
				foreach($cmd as $exec)
24
				{
25
					echo $exec."\n";
26
					exec($exec);
27
				}
28
 
29
			}
30
		}
31
		closedir($handle);
32
	}
33
	imageConvert();
34
?>