Προς το περιεχόμενο

Thumbnails kai PHP


mixalis8

Προτεινόμενες αναρτήσεις

Δημοσ.

<?php

// The file you are resizing

$file = 'yourfile.jpg';

 

//This will set our output to 45% of the original size

$size = 0.45;

 

// This sets it to a .jpg, but you can change this to png or gif

header('Content-type: image/jpeg');

 

// Setting the resize parameters

list($width, $height) = getimagesize($file);

$modwidth = $width * $size;

$modheight = $height * $size;

 

// Resizing the Image

$tn = imagecreatetruecolor($modwidth, $modheight);

$image = imagecreatefromjpeg($file);

imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height);

 

// Outputting a .jpg, you can make this gif or png if you want

//notice we set the quality (third value) to 100

imagejpeg($tn, null, 100);

?>

 

den leitourgi o kodikas aftos...... basiak ston kodika afto den exei orisma opou tha dinis to onoma tou output file..... mipos einai allos kodikas pou ftiaxni thumbnails????

 

ligi boithia pedia

Δημοσ.

exo mia class pou sou kanei standar tha sthn kano post edo otan gyrsiso apo diakopes (gyrnao 24 tou mhnos) an eos tis 25 den exo kanei to post kai an akoma thes thn class ayth sthle mou ena pm gia na thn kano (blaipes fortono to kefali me ena soro kai den mporo na ta thymamai ola :P)

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...