请问2个有关问题:php的imagecreatefromjpeg和一个ajax

WBOY
Release: 2016-06-13 12:49:29
Original
820 people have browsed it

请教2个问题:php的imagecreatefromjpeg和一个ajax
1,imagecreatefromjpeg这个函数在什么情况下才会导致崩溃直接跳出当前连接?
现在的情况是我有一个500多K的文件,在生成缩略图的时候每次到了这个文件就直接卡住了。然后不提示任何错误,直接空白页。其他大于1M的也没出这个问题。

请问除了修改php.ini还有没有其他的解决方案?
2,我在使用ajax的时候:

<br />
jQuery.ajax({<br />
        type: "post",<br />
        url: "dialog.php?a=sift",<br />
        data: {"cid":n,"data":<span style="color: #FF0000;">d</span>},<br />
        dataType: "json",<br />
        success: function(data,textStatus){<br />
            if(data.res==0){<br />
                alert(data.msg);<br />
            }else{<br />
                /******成功后******/ <br />
           }<br />
        }<br />
    });<br />
Copy after login


请问这里的d,我是否仍旧可以传递一个json数组过去呢?可是为什么我传递过去之后就提示堆栈溢出呢?


------解决方案--------------------
1、当图片的像素总数超过 GD 预设的范围时
不过没有看到过有关上限的说明,以前用 php4 时好像有 1024*768 的上限。
不过你可以自己试验一下

ini_set 可以动态设置允许修改的变量


2、{"cid":n,"data":d}
如果 d = {"cid":n,"data":d} 这样的话
肯定是要“堆栈溢出”的,因为递归了
jq 是要把 js 对象构造成字符串后,才发送的
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!