I have two questions: imagecreatefromjpeg of php and ajax.

Source: Internet
Author: User
Ask two questions: the imagecreatefromjpeg function of php and the function of ajax1 and imagecreatefromjpeg will crash and directly jump out of the current connection under what circumstances? The current situation is that I have a file of more than 500 K, and the file gets stuck every time the thumbnail is generated. No error is Prompted. a blank page is displayed. This problem does not occur for others larger than 1 MB. ask two questions: imagecreatefromjpeg of php and ajax.
1. under what circumstances will the imagecreatefromjpeg function cause a crash and directly jump out of the current connection?
The current situation is that I have a file of more than 500 K, and the file gets stuck every time the thumbnail is generated. No error is Prompted. a blank page is displayed. This problem does not occur for others that are larger than 1 MB.

Is there any other solution besides modifying php. ini?
2. when I use ajax:

JQuery. ajax ({
Type: "post ",
Url: "dialog. php? A = sift ",
Data: {"cid": n, "data": d },
DataType: "json ",
Success: function (data, textStatus ){
If (data. res = 0 ){
Alert (data. msg );
} Else {
/****** After successful ******/
}
}
});


Can I still pass a json Array to d? But why is Stack Overflow reported after I pass it?
------ Solution --------------------
1. when the total number of pixels of an image exceeds the preset value of GD
However, I have not seen any description about the upper limit. in the past, php4 seemed to have a upper limit of 1024*768.
But you can test it yourself.

Ini_set can dynamically set variables that can be modified


2. {"cid": n, "data": d}
If d = {"cid": n, "data": d}
It must be "Stack Overflow" because it is recursive.
Jq is sent only after the js object is constructed into a string.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.