Tema: imagenes
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/09/2011, 13:11
Avatar de andresdzphp
andresdzphp
Colaborador
 
Fecha de Ingreso: julio-2011
Ubicación: $this->Colombia;
Mensajes: 2.749
Antigüedad: 13 años, 7 meses
Puntos: 793
Respuesta: imagenes

No entiendo para que haces 2 bucles y das tanta vuelta para mostrar un array, desde que la imagen tenga APP13 te va a mostrar su información. ¿Estás seguro que tiene APP13? Podrías compartir la imagen?

Código PHP:
Ver original
  1. <?php
  2. $imageIPTC = 'imagen.jpg';
  3.  
  4. function output_iptc_data($image_path) {
  5.     $size = getimagesize($image_path, $info);
  6.     if (is_array($info)) {
  7.         if (isset($info["APP13"])) {
  8.             $iptc = iptcparse($info["APP13"]);
  9.             foreach ($iptc as $c => $v) {
  10.                 echo $c . ' ' . $v[0] . '<br />';
  11.             }
  12.         } else {
  13.             echo 'La imagen no tiene APP13';
  14.         }
  15.     }
  16. }
  17.  
  18. output_iptc_data($imageIPTC);
  19. ?>

Intentaste con exif ?

Código PHP:
Ver original
  1. <?php
  2. $exif = exif_read_data('imagen.jpg', 0, true);
  3. foreach ($exif as $clave => $seccion) {
  4.     foreach ($seccion as $c => $v) {
  5.         echo "<b>$c</b> $v <br />";
  6.     }
  7. }
  8. ?>

La clase Image IPTC de PEAR también sirve: http://pear.php.net/package/Image_IPTC/download

Código PHP:
Ver original
  1. <?php
  2. $iptc = new Image_IPTC('a.jpg');
  3. echo '<pre>';
  4. var_dump($iptc->getAllTags());
  5. echo '</pre>';

Saludos.
__________________
Si sabemos como leer e interpretar el manual será mucho más fácil aprender PHP. En lugar de confiar en ejemplos o copiar y pegar - PHP

Última edición por andresdzphp; 04/09/2011 a las 14:16