开发者

image rendering issue

开发者 https://www.devze.com 2022-12-11 02:19 出处:网络
I am running Apache/2.2.3 (CentOS). For some reason certain images, jpg, gif, or png will show up as byte code when accessed directly on the server. Firefox 3 and Safari both think the content type is

I am running Apache/2.2.3 (CentOS). For some reason certain images, jpg, gif, or png will show up as byte code when accessed directly on the server. Firefox 3 and Safari both think the content type is text/html. IE I believe has something built in to recognize it is an image and ignore the content type and renders the image correctly regardless. I can't s开发者_JS百科eem to find anyone else with this issue. An example of this can be found at

http://www.thedacs.com/admin/gp/userfiles/image/gp28_img_01.jpg

but the image below on same server the image is rendered correctly (use same path from above)

Fig3mod.jpg

The first image works fine in Photoshop CS, Illistrator, GIMP, Paint.net,and any other image editing software. I have tried everything when editing the images from trying multiple file formats to print screens and cropping to create a new image to lose old image meta data. Can anybody help?


You HTTP server is identifying the file as text/html.

This isn't a problem with the browser (except for IE, which ignores the http server and does whatever the heck it feels like, other browsers actually listen to the https server. If it says a file is text/html, they believe it), or with your image editors, but is a configuration problem with your instance of Apache.

I would guess this happens with all jpgs (and pngs, gifs etc).

If it's happening with all such files, then make sure you have a line in httpd.conf like

TypesConfig "/etc/mime.types"

Also make sure that file (/etc/mime.types) exists and has meaningful content.

If it's not happening for all such files, test to see if it's directory specific (i.e. happening for all files in the .../images/... directory. In this case you might have a.htaccess file altering the mime type configuration for that directory with an "AddType" directive, or other AddType directives in your httpd.conf or virtual host config files. Remove these erroneous directives.

0

精彩评论

暂无评论...
验证码 换一张
取 消