灯箱显示垃圾字元,而不是图片 [英] Lightbox displays garbage characters instead of image

查看:380
本文介绍了灯箱显示垃圾字元,而不是图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的网站上安装了灯箱脚本.当灯箱弹出时,显示的是垃圾字符,而不是较大的图像:

I have installed a lightbox script in my website. When lightbox pops up, but there are garbage characters displaying instead of the large version of the image:

����JFIF��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90 ��C     ��C    ����"�� ���}!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�������������������

这是什么?看起来与图片文件有关,但我不知道是什么原因导致了此问题...有什么建议吗?

What is this? It looks like it's relevant to the image file but I don't understand what causes this issue... Any suggestions?

这是图片的整个代码.

推荐答案

,在您使用GD库动态创建映像的php文件中,编写以下代码.

in the php file where you are creating the image dynamically using GD liabrary write following code.

header("content-type:image/jpg");

或者如果它是png图像,则

OR if it is a png image then

header("content-type:image/png");

从代码来看,它似乎是一个jpg文件.但是您应该知道格式.

From the code it seems to be a jpg file. But you should know the format.

基本上,这是php文件而不是灯箱中的问题.

Basically it is problem in php file rather than the lightbox.

这篇关于灯箱显示垃圾字元,而不是图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆