ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 13221


Ignore:
Timestamp:
Jan 2, 2010, 4:44:11 AM (13 years ago)
Author:
ebihara
Message:

[sfImageHandlerPlugin] fixed issue the sf_image_path() always display JPEG image

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/plugins/sfImageHandlerPlugin/trunk/lib/helper/sfImageHelper.php

    r10015 r13221  
    6060    unset($options['f']);
    6161  }
     62 elseif (is_callable(array($filename, 'getType')))
     63  {
     64    $f = str_replace('image/', '', $filename->getType());
     65  }
    6266  else
    6367  {
    64     $parts = explode('.', $filename);
     68    $parts = explode('_', $filename);
    6569    $f = array_pop($parts);
    66     if ($f !== 'jpg' || $f !== 'png' || $f !== 'gif')
    67     {
    68       $f = 'jpg';
    69     }
     70  }
     71
     72  if ($f !== 'jpg' && $f !== 'png' && $f !== 'gif')
     73  {
     74    $f = 'jpg';
    7075  }
    7176
     
    7883  }
    7984
    80   $filepath = 'img/'.$f.'/'.$size_dir_name.'/'.$filename;
     85  $filepath = 'img/'.$f.'/'.$size_dir_name.'/'.$filename.'.'.$f;
    8186  $options['raw_name'] = true;
    8287  return _compute_public_path($filepath, 'cache', $f, $absolute);
Note: See TracChangeset for help on using the changeset viewer.