Tema: imagenes
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/09/2011, 11:38
Avatar de Patriarka
Patriarka
 
Fecha de Ingreso: enero-2011
Ubicación: Moreno, Buenos Aires, Argentina
Mensajes: 2.851
Antigüedad: 13 años, 4 meses
Puntos: 288
imagenes

Hola gente,
tengo una imagen con datos IPTC cargados y no logro extraer los datos datos.
use estos ejemplos del manual http://www.php.net/manual/es/function.iptcparse.php y no me dan buenos resultados, mas bien errores.

Instale el EXIF VIEWER de firefox y ahi si puedo ver toda la informacion.

Como puedo extraer esa misma informacion con PHP?

hice esto:
Código PHP:
Ver original
  1. var_dump($imageIPTC);  //path de imagen ok
  2.  
  3.         function output_iptc_data( $image_path ) {
  4.             $size = getimagesize ( $image_path, $info);
  5.             var_dump($info);  //DEVUELVE algo asi: Photoshop CS3 Windows2011:05:08 09:25:28�0221��(�HH����Adobed���         ����� ���  s!1AQa"q�2���B#�R��3b�$r��%C4S���cs�5D'���6Tdt���&� ��EF��V�U( y muchos caracteres raros
  6.              if(is_array($info)) {
  7.                 $iptc = iptcparse($info["APP13"]);
  8.                 foreach (array_keys($iptc) as $s) { //LINEA 220
  9.                   // devuelve este error: Warning: array_keys() [function.array-keys]: The first argument should be an array in save.php on line 220
  10.                   //Warning: Invalid argument supplied for foreach() in save.php on line 220
  11.                     $c = count ($iptc[$s]);
  12.                     for ($i=0; $i <$c; $i++)
  13.                     {
  14.                         echo $s.' = '.$iptc[$s][$i].'<br>';
  15.                     }
  16.                 }
  17.             }
  18.         }
  19.         $size = getimagesize($imageIPTC, $info);
  20.          output_iptc_data($imageIPTC);

gracias

Última edición por Patriarka; 04/09/2011 a las 11:45