They say it was easy to do your stuff in PHP. Well, I have no clue how to do it. This is my (supposed to be a) function: 1. Read a jpeg 2. Convert the quality for $x amount to reduce space. 3. Base64 it 4. Check image size. 4. a. If image size > MAX_LEN then go to step (2) with $x lowered. 4. b. else encode with JSON then send it to client. The objective is to have a BASE64 image with size bound to a certain size. Already in my knowledge: 1. BASE64 en/decoding 2. Webservice and JSON stuff. 3. Convert via ImageMagicK Not in my knowledge rite now: 1. Read/Write a file. 2. File length. Comments are welcome.
A place where I don't know what I said.