-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
are there any docs on the convert functionality? #40
Comments
We are planning to update the documentation on our website asap but we are still in the process of releasing the new functionality in all the other Tinify API clients. To answer your question, the example mentioned by you returns the smallest version of the image between webp and jpeg. The following options are available as a type:
.transform:
Hope this helps! |
It does! |
Question: how do you know which type of image has been generated? If it can be jpg or webp, how do you know which it is? |
We have some helper methods that you can use: content type (.mediaType()) or directly the extension as in the following example: const source = tinify.fromFile("unoptimized.jpg"); |
Nice! I was looking at the types you're exposing on convert(options: object): Source { tinify-nodejs/src/tinify/Source.ts Line 88 in 95e5288
Would you welcome a PR which made the type more explicit based on the details you've provided in this chat? |
Have raised a speculative PR here: #41 |
Thank you for the PR. We are planning to do the same for all our functions in the near future and we will review your changes in detail when we will get started. One thing I've noted is the wildcard in my original comment was / but in reality is */* . I did not realise that in these comments I need to escape some characters. Sorry for the confusion! |
Haha! No worries - I've updated the PR to reflect |
I can see the ability was added to convert images. Docwise I can't see anything, but I can see this code in the tests:
https://github.com/tinify/tinify-nodejs/pull/39/files#diff-887779faeffe0d98f0035c4daf646e3c83f535e4ae53943482026ea8b19f923bR91
Does this mean convert to
webp
fromjpeg
?The text was updated successfully, but these errors were encountered: