Changeset 6474

Show
Ignore:
Timestamp:
06/06/10 12:14:26 (3 years ago)
Author:
rvelices
Message:

merge r6473 from trunk to branch 2.1
- quick fix (maybe not the cleanest) of regression 2.0 -> 2.1 when displaying metadata on picture page (event called with different input)

Location:
branches/2.1/include
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/2.1/include/functions_metadata.inc.php

    r6364 r6474  
    118118  if ($exif = @read_exif_data($filename)) 
    119119  { 
    120     foreach ($map as $key => $field) 
    121     { 
    122       if (strpos($field, ';') === false) 
    123       { 
    124         if (isset($exif[$field])) 
    125         { 
    126           $result[$key] = $exif[$field]; 
    127         } 
    128       } 
    129       else 
    130       { 
    131         $tokens = explode(';', $field); 
    132         if (isset($exif[$tokens[0]][$tokens[1]])) 
    133         { 
    134           $result[$key] = $exif[$tokens[0]][$tokens[1]]; 
    135         } 
    136       } 
    137     } 
     120                if ($map != null) 
     121                { 
     122                        foreach ($map as $key => $field) 
     123                        { 
     124                                if (strpos($field, ';') === false) 
     125                                { 
     126                                        if (isset($exif[$field])) 
     127                                        { 
     128                                                $result[$key] = $exif[$field]; 
     129                                        } 
     130                                } 
     131                                else 
     132                                { 
     133                                        $tokens = explode(';', $field); 
     134                                        if (isset($exif[$tokens[0]][$tokens[1]])) 
     135                                        { 
     136                                                $result[$key] = $exif[$tokens[0]][$tokens[1]]; 
     137                                        } 
     138                                } 
     139                        } 
     140                } 
     141                else 
     142                { 
     143                        $result = $exif; 
     144                } 
    138145  } 
    139146 
  • branches/2.1/include/picture_metadata.inc.php

    r6364 r6474  
    3030if (($conf['show_exif']) and (function_exists('read_exif_data'))) 
    3131{ 
    32   $exif_mapping = array(); 
    33   foreach ($conf['show_exif_fields'] as $field) 
    34   { 
    35     $exif_mapping[$field] = $field; 
    36   } 
    37  
    38   $exif = get_exif_data($picture['current']['image_path'], $exif_mapping); 
     32  $exif = get_exif_data($picture['current']['image_path'], null); 
    3933  if (count($exif) == 0 and $picture['current']['has_high']) 
    4034  { 
    41     $exif = get_exif_data($picture['current']['high_url'], $exif_mapping); 
     35    $exif = get_exif_data($picture['current']['high_url'], null); 
    4236  } 
    43    
    4437  if (count($exif) > 0) 
    4538  {