My project is an image processing script using php, JavaScript and imagick (or imagemagick).
Currently, the user can change the image properties using a browser, which jscript then sends an Ajax call to my php script to process the changes, save the image and send the file path and response back to the browser, so jscript can then update the img tag.
I want to make this process faster if possible.
Ideally, the php script handler will be able to output raw image data right after its processed changes with the corresponding mime header, but this cannot be done, since the same file should send a json response.
Any opinions and suggestions are welcome.
EDIT: I should have mentioned that I have tried so far:
Due to the large number of operations available to change the image, telling my php script what needs to be changed using the url string, for example <img src='image.php?id=132&layer1=flip' /> , url often exceeded the recommended maximum number characters . Otherwise, that would be perfect.
I also tried sending the base64 source data back and processing it, and although I didnβt completely solve it, it got its flaws - adding base 64 data to src <img> not supported naturally in all browsers.
source share