Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/02/2005, 12:09
Avatar de Reynier
Reynier
 
Fecha de Ingreso: noviembre-2002
Ubicación: Por ahí en algún sitio
Mensajes: 1.844
Antigüedad: 24 años
Puntos: 1
Por que no me crea las imagenes

Miren este script:
Código PHP:
global $dirthumb;
  
$path = getcwd();
  
$pathtodir = substr(substr($path,0,-1),0,strrpos($path,"\\"));
  
$files = array();
  if (
$handle = opendir($pathtodir.$dirthumb)) {
   while (
false !== ($file = readdir($handle))) {
    if (
$file != "." && $file != "..") {
     if (
eregi("\.jpe?g$", $file) || eregi("\.gif$", $file) || eregi("\.png$", $file)){
      
$files[] = $file;
     }
    }
   }
   
closedir($handle);
  }
  
sort($files);
  foreach (
$files as $image) {
   if(
file_exists($pathtodir.$dirthumb.$image)){
    
$size = getimagesize($pathtodir.$dirthumb.$image);
    
$width  = $size[0];
    
$height = $size[1];
    
$im = imagecreatefromjpeg($pathtodir.$dirthumb.$image);
    
$img = imagecreatetruecolor($width,$height);
    
imagejpeg($im, $pathtodir.$dirthumb.$image, 100);
    
imagedestroy($im);
   }
  } 
el directorio donde estan las imagenes tiene contenido porque el arreglo $files[] se me llena esta vez con 3 ficheros que he comprobado los nombres y son los que estan en el directorio, pero sorpresa en el navegador no me salen las imagenes alguna ayuda al respecto.
Salu2
__________________
Ing. Reynier Pérez Mira