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

derivatives

  • fix url generation
File:
1 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);
Note: See TracChangeset for help on using the changeset viewer.