Found an issue with imagecache_transfer();

mime_content_type(); was returning text/plain for all my PNG images. However ImageAPI and getimagesize() were returning the correct mime type image/png. Since imagecache requires ImageAPI would it not make sense to use their function to find the file mime type.

Sorry I would write a patch but here is the code I changed mine to. Works great for me.

function imagecache_transfer($path) {
  if (function_exists('imageapi_image_open')) {
    $image = imageapi_image_open($path);
    $mime =  $image->info['mime_type'];
  }
  else {
    $size = getimagesize($path);
    $mime = $size['mime'];
  }
Files: 
CommentFileSizeAuthor
#5 patch.patch652 bytesjdelaune
#1 imagecache.patch491 bytesjdelaune

Comments

Status:Active» Needs review
StatusFileSize
new491 bytes

Here is a patch if needed

which imageapi toolkit are you using?

gd2? is that what you mean?

I think it should be stripped down to just:

<?php
$size
= getimagesize($path);
$mime = $size['mime'];
?>

StatusFileSize
new652 bytes

Stripped out one line more. Can add it back but I don't think it's needed.

Status:Needs review» Fixed

thanks, committed to HEAD.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.