Forum Discussion
_anomDiebolt_
7 years agoQrew Elite
Here is a screenshot of a non-theoretical, practical and working demo:
With script I alter QuickBase's file attachment control to only browse for images:
However, to save the processed image all you have to do is call canvas.toBlob() and submit the blob using FormData API.
While the image is in the <canvas> it is possible to resize it, add a watermark or any other processing you desire. You can also extract any EXIF data from the image and slot it into extra fields on the form.
BTW, the girl in the photo is named Zoe and she is famous:
Know Your Meme ~ Disaster Girl
If you need this non-theoretical feature feel free to contact me off-world using the information in my profile:
https://getsatisfaction.com/people/dandiebolt
With script I alter QuickBase's file attachment control to only browse for images:
<input type="file" size="40" name="_fid_8" id="_fid_8" accept="image/*">When an image is selected, it is previewed to the spot on the form indicated by "Image" and displayed in a <canvas> item indicated by the spot on the form indicated by "Processed". Once the <canvas> loads I automatically flip and rotate the <canvas> and initiate the download of the processed image. Unfortunately I can't upload the processed image at this time because of my file storage quota.
However, to save the processed image all you have to do is call canvas.toBlob() and submit the blob using FormData API.
While the image is in the <canvas> it is possible to resize it, add a watermark or any other processing you desire. You can also extract any EXIF data from the image and slot it into extra fields on the form.
BTW, the girl in the photo is named Zoe and she is famous:
Know Your Meme ~ Disaster Girl
If you need this non-theoretical feature feel free to contact me off-world using the information in my profile:
https://getsatisfaction.com/people/dandiebolt
_anomDiebolt_
7 years agoQrew Elite
I think you are misunderstanding the workflow. The script "calculates" something called a blob representing the rotated image which can be submitted to QuickBase directly using the FormData API. The only reason I download the blob is because I can't allow the image to be saved to QuickBase as my file quota will be quickly exceeded. So I am just generating "proof" that the modified image can be created. The blob is a full fidelity binary representation of the processed image. The code I am using is the standard and accepted way of manipulating images client-side (ie in your browser).
I think the difficulty in understanding this is due to the fact that historically the only thing you could do with a file (text, image, pdf etc) was upload it to the server unchanged. Today their are capabilities to fully manipulate both text and binary files both for upload, download or to extract information such as EXIF data or even OCR. This would have been unheard of years ago but browsers have greatly advanced and anything an installed application or a server side application can do can largely be done client-side in the browser. This is not an exaggeration.
I think the difficulty in understanding this is due to the fact that historically the only thing you could do with a file (text, image, pdf etc) was upload it to the server unchanged. Today their are capabilities to fully manipulate both text and binary files both for upload, download or to extract information such as EXIF data or even OCR. This would have been unheard of years ago but browsers have greatly advanced and anything an installed application or a server side application can do can largely be done client-side in the browser. This is not an exaggeration.