Olá, pessoal Não to muito familiar com PHP OOP ainda e por isso não sei como fazer isso funcionar: tem o resizeImage e o resizeDir. A segunda chama a primeira mas no service browser tah dando erro. Alguém pode me ajudar?
function resizeImage($filename, $tamanho,
$destdir) {
//Tamanho é o tamanho do maior lado.
$width=$tamanho;
$height=$tamanho;
if (!file_exists($destdir)) {
mkdir($destdir);
}
list($width_orig, $height_orig) =
getimagesize($filename);
$ratio_orig = $width_orig/$height_orig;
if ($width/$height > $ratio_orig) {
$width = $height*$ratio_orig;
} else {
$height = $width/$ratio_orig;
}
// Resample
$image_p = imagecreatetruecolor($width,
$height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0,
0, $width, $height, $width_orig, $height_orig);
// Output
imagejpeg($image_p, $destdir.'/'.$filename,
100);
}
function resizeDir($origem, $destino, $tamanho) {
// if ($handle = opendir($origem)) {
// while ($file = readdir($handle)) {
// if(!is_dir($file)) {
//resizeImage($origem.'/'.$file, $destino, 200);
// }
resizeImage('teste2.jpg', 200, 'thumbs');
// }
// closedir($handle);
// }
}
logosi
André Tapxure Gabriel, Ms.
email:[EMAIL PROTECTED]
msn:[EMAIL PROTECTED]
(62)8405-4960
--~--~---------~--~----~------------~-------~--~----~
Recebeu esta mensagem porque está inscrito em Grupo "Mailing List da Comunidade
Portuguesa de Desenvolvimento de RIAs - www.riapt.org" do Grupos Google.
Para enviar mensagens para este grupo, envie um email para
[email protected]
Para anular a inscrição neste grupo, envie um email para [EMAIL PROTECTED]
Para mais opções, visite este grupo em
http://groups.google.com/group/riapt?hl=pt-PT
-~----------~----~----~----~------~----~------~--~---
<<attachment: image001.gif>>
