Changeset 6473 for trunk


Ignore:
Timestamp:
Jun 6, 2010, 12:13:42 PM (14 years ago)
Author:
rvelices
Message:
  • quick fix (maybe not the cleanest) of regression 2.0 -> 2.1 when displaying metadata on picture page (event called with different input)
Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_metadata.inc.php

    r6363 r6473  
    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
  • trunk/include/picture_metadata.inc.php

    r6363 r6473  
    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  {
Note: See TracChangeset for help on using the changeset viewer.