Thumbnail af .wmv
Hej, jeg har fundet et PERFEKT resize script til at kunne lave thumbnails af billeder så siden loader hurtigere mm.Da jeg har frit adgang til at modificere scriptet som jeg har lyst til vil jeg gerne kunne lave thumbnails af .wmv filer og andre video filer som bruges på sjove sider.
Her er scriptet:
</form>
<?php
if(isset($_POST['submit'])){
if (isset ($_FILES['new_image'])){
$imagename = $_FILES['new_image']['name'];
$source = $_FILES['new_image']['tmp_name'];
$target = "billeder/".$imagename;
move_uploaded_file($source, $target);
$imagepath = $imagename;
$save = "billeder/" . $imagepath; //This is the new file you saving
$file = "billeder/" . $imagepath; //This is the original file
list($width, $height) = getimagesize($file) ;
$modwidth = 450;
$diff = $width / $modwidth;
$modheight = $height / $diff;
$tn = imagecreatetruecolor($modwidth, $modheight) ;
$image = imagecreatefromjpeg($file) ;
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ;
imagejpeg($tn, $save, 60) ;
$save = "billeder/thumb_" . $imagepath; //This is the new file you saving
$file = "billeder/" . $imagepath; //This is the original file
list($width, $height) = getimagesize($file) ;
$modwidth = 60;
$diff = $width / $modwidth;
$modheight = $height / $diff;
$tn = imagecreatetruecolor($modwidth, $modheight) ;
$image = imagecreatefromjpeg($file) ;
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ;
imagejpeg($tn, $save, 100) ;
echo "Large image: <img src='billeder/".$imagepath."'><br>";
echo "Thumbnail: <img src='billeder/thumb_".$imagepath."'>";
}
}
?>
Jeg har ingen idé om hvor meget der skal modificeres, men eftersom scriptet virker perfekt ville jeg gerne bare ændre i det og ikke finde noget nyt mm.
