plugins/gallery/fetcher.php
changeset 28 36ea553da7ba
parent 27 3d8ec1f7d191
child 30 689b095d02cf
equal deleted inserted replaced
27:3d8ec1f7d191 28:36ea553da7ba
    97       if ( empty($width) || empty($height) || $width > 2048 || $height > 2048 )
    97       if ( empty($width) || empty($height) || $width > 2048 || $height > 2048 )
    98       {
    98       {
    99         die('Bad width or height');
    99         die('Bad width or height');
   100       }
   100       }
   101       
   101       
       
   102       $ext = get_file_extension($row['img_filename']);
       
   103       
   102       $src_filename  = ENANO_ROOT . '/files/' . $row['img_filename'];
   104       $src_filename  = ENANO_ROOT . '/files/' . $row['img_filename'];
   103       $dest_filename = ENANO_ROOT . '/cache/' . $row['img_filename'] . "-embed-$width-$height.$ext";
   105       $dest_filename = ENANO_ROOT . '/cache/' . $row['img_filename'] . "-embed-$width-$height.$ext";
   104       $filename =& $dest_filename;
   106       $filename =& $dest_filename;
   105       $ext = get_file_extension($filename);
       
   106       
   107       
   107       if ( !file_exists($dest_filename) )
   108       if ( !file_exists($dest_filename) )
   108       {
   109       {
   109         if ( !scale_image($src_filename, $dest_filename, $width, $height, false) )
   110         if ( !scale_image($src_filename, $dest_filename, $width, $height, false) )
   110         {
   111         {