I want to know is there a way to display .tiff files on the web page directly? As html can handle jpg,gif,bmp, but how about tiff file? I tried to use <img src=abc.tiff> it pops up the download box on the browser.

Thanks.

Recommended Answers

All 3 Replies

You can try changing the MIME type, which I believe you can do in PHP. Something like:

header("Content-Type: {$mime}");

Info: http://ca3.php.net/manual/en/function.header.php

Only works if the image is viewed on its own page, I believe.

In general tiffs can't be displayed and since they are significantly larger than normal files you wouldn't want to have them as a normal part of any website. If you are distributing the tiff files then it may be necessary to make a low resolution copy of each one to display.

Sarah

That's good advice from Sarah.

If you only want to display the image as part of the page, convert it to a JPEG (if a photo) or a GIF (if a line drawing or cartoon). If you only want to use the image for display purposes, it makes no logical sense to use a TIFF format. That will likely hurt the page performance. The same advice applies to BMPs. The file sizes are way too large and inefficient.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.