Changeset 12779 for extensions


Ignore:
Timestamp:
Dec 22, 2011, 6:25:44 AM (13 years ago)
Author:
rvelices
Message:

derivatives

  • fix url generation
Location:
extensions/derivatives
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/derivatives/i.php

    r12778 r12779  
    125125  $pos!== false || ierror('Missing .', 400);
    126126  $ext = substr($req, $pos);
     127  $page['derivative_ext'] = $ext;
    127128  $req = substr($req, 0, $pos);
    128129
     
    278279header('Connection: close');
    279280
    280 // todo send the right headers
    281 header("Content-Type: image/jpeg");
     281$ctype="application/octet-stream";
     282switch (strtolower($page['derivative_ext']))
     283{
     284    case "jpe": case "jpeg":
     285    case "jpg": $ctype="image/jpeg"; break;
     286    case "png": $ctype="image/png"; break;
     287    case "gif": $ctype="image/gif"; break;
     288}
     289header("Content-Type: $ctype");
    282290
    283291fpassthru($fp);
  • extensions/derivatives/include/derivative.inc.php

    r12778 r12779  
    183183      $rel_url = 'i';
    184184      if ($conf['php_extension_in_urls']) $rel_url .= '.php';
    185       if (!$conf['question_mark_in_urls']) $rel_url.= '?';
    186       $rel_url .= $loc;
     185      if ($conf['question_mark_in_urls']) $rel_url .= '?';
     186      $rel_url .= '/'.$loc;
    187187    }
    188188    else
Note: See TracChangeset for help on using the changeset viewer.