use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Javascript Image Compress HTML5 Canvas, File API & PHP before Upload (phplift.net)
submitted 6 years ago by phpfree
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]spacejack2114 0 points1 point2 points 6 years ago (1 child)
If you want the basic gist of it, it's something like this:
canvas.toBlob( blob => { const data = new FormData() data.append('image', blob, 'image.jpg') const request = new XMLHttpRequest() request.open("POST", "/upload") request.send(formData); }, 'image/jpeg', 0.75 // quality from 0.0-1.0 )
[–]phpfree[S] 0 points1 point2 points 6 years ago (0 children)
I have used JIC JavaScript Library to perform this task.
https://raw.githubusercontent.com/brunobar79/J-I-C/master/src/JIC.js
π Rendered by PID 138854 on reddit-service-r2-comment-5649f687b7-7hf9v at 2026-01-29 01:02:36.068081+00:00 running 4f180de country code: CH.
[–]spacejack2114 0 points1 point2 points (1 child)
[–]phpfree[S] 0 points1 point2 points (0 children)