Giter Site home page Giter Site logo

ascii's Issues

online demo?

Anyone have an online demo with simple upload image form?

TypeError: Ascii is not a constructor

Using the code in the readme.md file, it writes the error.

`
var pic = new Ascii('https://i.imgur.com/rNd3mIH.png');
^

TypeError: Ascii is not a constructor
at Object. (C:\Users\Daniel.DESKTOP-HNMIRLQ\Desktop\random projects\image to ascii\index.js:2:11)
?[90m at Module._compile (node:internal/modules/cjs/loader:1101:14)?[39m
?[90m at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)?[39m
?[90m at Module.load (node:internal/modules/cjs/loader:981:32)?[39m
?[90m at Function.Module._load (node:internal/modules/cjs/loader:822:12)?[39m
?[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)?[39m
?[90m at node:internal/main/run_main_module:17:47?[39m
`

TypeError: Ascii is not a constructor

TypeError: Ascii is not a constructor
at download.image.then (/home/quickbot/cmd/asciiimage.js:15:19)
at

my code
`
let attachment = message.attachments.first().url;
const options = {
url: attachment,
dest: 'image' // Save to /path/to/dest/image.jpg
}
download.image(options)
.then(({ filename, image }) => {
let pic = new Ascii(image/filename);
pic.convert(function(err, result) {
message.channel.send(result);
})
}).catch((err) => {
message.channel.send("Error occured, please retry.");
console.log(err);
});

Possible to use buffer as input?

I want to render an ASCII representation of an image stored as a nodejs buffer. Will this library work for this purpose? How would I bypass the file read operation and pass a buffer in directly?

Making it work with external URL ?

Heyo

Awesome project, love it! it works as expected!
Just a question tho, what if I want to make it work with external files ?
Like, giving it an url as url parameter.

This would be rad.

Thanks!

TypeError: Ascii is not a constructor

When I tried out the example in the README just get an error

/home/agirorn/code-play/logo/logo.js:2
var pic = new Ascii('logo.png');
          ^

TypeError: Ascii is not a constructor
    at Object.<anonymous> (/home/agirorn/code-play/logo/logo.js:2:11)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
    at internal/main/run_main_module.js:17:11
➜  logo node
Welcome to Node.js v12.10.0.
Type ".help" for more information.
> var Ascii = require('ascii');
undefined
> Ascii.toString()
'[object Object]'
> 

can't run this demo

[root@localhost demo]# node index.js

/root/project/ascii-master/index.js:37
ctx.drawImage(pic, 0, 0, pic.width, pic.height);
^
Error: Image given has not completed loading
at /root/project/ascii-master/index.js:37:17
at /root/project/ascii-master/index.js:21:13
at fs.js:266:14
at Object.oncomplete (fs.js:107:15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.