tinify / tinify-nodejs

Node.js client for the Tinify API.
https://tinypng.com/developers
MIT License
414 stars 74 forks source link

I try tinify with the most simple way, but I always got nothing. #12

Closed qreal829475 closed 6 years ago

qreal829475 commented 6 years ago

hello, i try it like this:

const tinify = require("tinify");
tinify.key = "xxxxxx";

tinify.fromFile("abc.jpg").toFile("optimized.jpg");

But, i got nothing.

I don't know why it like this. I think I'll be crazy.

qreal829475 commented 6 years ago

So sorry. my friend solved this problem just now.

My key has problem. but I got nothing in console. Maybe it's a iusse. Hope your reply.

mattijsvandruenen commented 6 years ago

When you're using an incorrect API key you should get an "Credentials are invalid (HTTP 401/Unauthorized)" error though. Copy pasting those three lines to a script, and executing it with node gives me that error.

In any case, I'm happy to hear that you've found out what was causing you to not get a compressed image as result.