PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Images » Image_Transform » Bug #1318

Incorrect content info / file extension info.

Details

Submitted2004-04-30 07:56 UTC
Fromcardoe at cardoe dot com
Assignedreywob
StatusClosed
PackageImage_Transform
PHP VersionIrrelevant
OSLinux
Roadmaps(Not assigned)

Comments

[2004-04-30 07:56 UTC] cardoe at cardoe dot com

Description:
------------
When you run the below code in Firefox or Mozilla it asks you what you want to do with the file which is of type: PHP Script. It should really say it's a tiff file instead of saying it's a PHP Script. It however is offering to open it up in Gimp and it does open properly so it's really just a matter of that display info...

On line 230 in Image/Transform/Driver/IM.php the following should be added below the header('Content-type: image/' . $type); call.

header ('Content-Disposition: inline; filename=image.' . $type );

This causes the browser to display more correct info and use the file name "image.tiff" as the temp name instead of "myscript.php"

Other drivers display() methods might need this as well, I only use Image Magick so that's the only one I know.

Reproduce code:
---------------
<?php
require_once("Image/Transform.php");
$docImage = &Image_Transform::factory("IM");
$docImage->load("mypicture.png");
$docImage->display("tiff");
?>

Expected result:
----------------
The browser to recognize it as a Tiff instead of a PHP script.

Actual result:
--------------
Browser recognized it as a PHP Script.