betamax / getimagedata Goto Github PK
View Code? Open in Web Editor NEWCross domain getImageData work around and jQuery plugin
Home Page: http://www.maxnov.com/getimagedata/
Cross domain getImageData work around and jQuery plugin
Home Page: http://www.maxnov.com/getimagedata/
Is there a good reason for setting width and height of the image from JSON? At this point it'll only take very shortly until the browser has parsed the size. So there wouldn't be a need to have imagemagick on the server, which should reduce load a bit.
I'm using node v0.6.10 and the responseBodyStream: bl does not seem to work in the request options (line 57) so what I did was add an encoding option set to null, and changed the image = new Buffer(bl.toString(), binary) to image = new Buffer(body). and I could get the image I needed. Below is a snippet of the code I used:
request({ uri:url, responseBodyStream: bl, encoding:null}, function (error, response, body) {
// If the request was OK
if (!error && response.statusCode == 200) {
// Check if the mimetype says it is an image
var mimetype = response.headers["content-type"];
if(mimetype == "image/gif" || mimetype == "image/jpeg" ||
mimetype == "image/jpg" || mimetype == "image/png" ||
mimetype == "image/tiff") {
// Create the prefix for the data URL
var type_prefix = "data:" + mimetype + ";base64,",
// Get the image from the response stream as a string and convert it to base64
image = new Buffer(body),
image_64 = image.toString('base64');
...
I had to change it because nothing was being written to the temporary file created.
Also instead of using encode(args.url) and decode(req.param("url")). I used encodeURIComponent(args.url) and decodeURIComponent(req.param("url")).
It looks like the appspot site used for img-to-json is no longer operational...
http://puu.sh/8lNIO.png
Attempting to run the first example listed on your site verbatim: http://www.maxnov.com/getimagedata/
results in a "TypeError: O is undefined"
on line 27 of https://rawgithub.com/betamax/getImageData/master/jquery.getimagedata.js
Please consider adding the following features:
Are there any directions for getting getImageData.py running on GAE?
Hi, sorry for bad English. I think i'ts bad to store this library in yours.
ps. Just made you library to work with jquery-file-upload. Cool! Thanks for good work.
In iOS, after tapping on a hyperlink, its grayscale image (canvas) disappears, and that's the correct behavior. However, canvases of other hyperlinks incorrectly disappear, too.
Please try it using the live example page. It may be unnoticeable when there is only one such hyperlink, but it becomes noticeable when there are ten or more.
And tapping on other regular hyperlinks (which don't implement this grayscale effect) causes the same issue.
I'm trying to get this working on my own server but I always get a 400(Bad Request)
Here's my code
$.getImageData({
url: soundcloud.artwork_url,
server: "http://127.0.0.1:3000/",
success: function(image) {
console.log(image);
},
error: function(xhr, text_status) {
console.log(xhr, text_status);
}
});
Any idea as to what could be causing this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.