Foros del Web » Programación para mayores de 30 ;) » Programación General »

Problema con acturalizar imagenes

Estas en el tema de Problema con acturalizar imagenes en el foro de Programación General en Foros del Web. hola pora alli me consegui este cosido de Axis Código: #!c:/Perl/bin/perl.exe -w # # require 'stat.pl'; ######################################################### # Path to where the image file is ...
  #1 (permalink)  
Antiguo 24/09/2004, 20:49
Avatar de GeoAvila
Colaborador
 
Fecha de Ingreso: diciembre-2003
Ubicación: Antigua Guatemala
Mensajes: 4.032
Antigüedad: 20 años, 4 meses
Puntos: 53
Problema con acturalizar imagenes

hola pora alli me consegui este cosido de Axis
Código:
 #!c:/Perl/bin/perl.exe -w
 #
 #
 require 'stat.pl';
 #########################################################
 # Path to where the image file is stored
 $DIR = "C:/Archivos de programa/Apache Group/Apache2/htdocs/";
 #Filename the image is stored as
 $fileName = "cam0.jpg";
 #Maximum of images/s sent
 $freq = 2;
 #Max number of images to send on a connection
 $maxImages = 2900;
 #Max number of seconds until update is considered stopped
 #(ie the camera is no longer updating the image)
 $maxNoUpdate = 30;
 #########################################################
 $con_type = "jpeg";
 # Unbuffer the output so it streams through faster and better.
 $| = 1;
 # No input record separator when reading from file via <>.
 undef $/;
 # Print HTTP headers...
 # NOTE: If your web server returns "Error, faulty header"
 # The Line below must be commented away since your web server includes the
 # HTTP/1.0 200 OK on its own.
 print "HTTP/1.0 200 OK\n";
 print "Content-type: multipart/x-mixed-replace; boundary=--myboundary\n\n";
 print "--myboundary\n";
 $rounds=0;
 #max 400 images
 while ($rounds < $maxImages)
 {
 $rounds = $rounds +1;
 $basefile = $DIR . $fileName;
 @fstat = stat($basefile);
 # If the same image time stamp is on the image file for more then
 # X seconds then I presume that the image is no longer updated and will
 # End the connection
 if ($fstat[$ST_MTIME] ne $oldimagetime)
 {
 $sameCount = 0;
 $oldimagetime = $fstat[$ST_MTIME];
 }
 #We may send the same image multiple times but there is a strict limit
 if ($sameCount > ($maxNoUpdate * $freq))
 {
 die;
 }
 $sameCount = $sameCount +1;
 $rounds=$rounds +1;
 print "Content-type: image/$con_type\n\n";
 # This is where we act
 open(PIC,"$basefile");
 print STDOUT <PIC>;
 close(PIC);
 print "\n\n--myboundary\n";
 # Pause for 1/$freq seconds, if this time is more then a second
 # we recomend you replace with sleep(NbrOfSeconds)
 select(undef,undef,undef,(1/$freq));
 }
el cual sirve para acutalizar imagenes lo tenia en unix ahora lo quise montar en guindow$ y bueno ahora las imagenes aparecen distorcionadas, alguien tien alguna idea de porque...
les agradecería mucho su ayuda gracias...
__________________
* Antes de preguntar lee las FAQ, y por favor no hagas preguntas en las FAQ
Sitio http://www.geoavila.com twitter: @GeoAvila
  #2 (permalink)  
Antiguo 25/09/2004, 10:43
 
Fecha de Ingreso: mayo-2003
Mensajes: 328
Antigüedad: 21 años
Puntos: 0
Hola:

Es que tienes que usar el BINMODE. En Windows es necesario que hagas eso.

Tienes que usar el siguiente código:

Código:
open(PIC,"$basefile");
      binmode(PIC); #<-----------NUEVA LINEA
  print STDOUT <PIC>;
 close(PIC);
SALUDOS
__________________
Uriel Lizama, Perl Developer

Aprende Perl en Perl en Español.
  #3 (permalink)  
Antiguo 25/09/2004, 13:19
Avatar de GeoAvila
Colaborador
 
Fecha de Ingreso: diciembre-2003
Ubicación: Antigua Guatemala
Mensajes: 4.032
Antigüedad: 20 años, 4 meses
Puntos: 53
gracias pero igual la imagen sigue estorcionada...
__________________
* Antes de preguntar lee las FAQ, y por favor no hagas preguntas en las FAQ
Sitio http://www.geoavila.com twitter: @GeoAvila
  #4 (permalink)  
Antiguo 29/09/2004, 12:38
Avatar de monoswim
$moderador{'Esteban'}
 
Fecha de Ingreso: febrero-2002
Ubicación: Buenos Aires - Argentina
Mensajes: 8.762
Antigüedad: 22 años, 3 meses
Puntos: 90
oye, sabes algo de cabeceras http como ser

Content-Type: image/gif; name="invpix.gif"
Content-Transfer-Encoding: base64
Content-Location: http://www.cadenaglobal.com/images/invpix.gif

Porque mandar un mail a travez del sendmail y que tenga una imagen en el mismo mensaje, o al menos un archivo adjunto.

Saludos
__________________
Esteban Quintana
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:39.