![]() ![]() ![]() You can upload any WebP, JPEG or PNG image to the Tinify API to compress it. Set the URL of your proxy server, which can optionally include credentials. You can instruct the API client to make all requests over an HTTP proxy. Always keep your API key secret! const tinify = require( "tinify") Īll requests will be made over an encrypted Get an API key by registering with your name andĮmail address. To use the API you must provide your API key. You can use the Node.js client by installing the npm packageĪnd adding it to your application’s dependencies: npm install -save tinify Languages make it very easy to interact with the Tinify API. Will override the key set by tinify_api().The Tinify API allows you to compress and optimize WebP, JPEG and PNG images. Provided with tinify_api(), any other key provided in the function call Required if the API key is set using tinify_api(). A string containing your TinyPNG API key. If NULL (the default), no resizing takes place. If using any other method, you must supply both a width AND If using "scale", you only need to provide width OR height, Method must be set to one of "scale", "fit", "cover", Reduce an image's dimensions and make an image smaller with TinyPNG API, not A named list with the elements method asĪ string, and width and/or height as numerics. ![]() The absolute file path of the newly tinified image file. Working directory at the time tinify() is called. If " rel", will return theįile path of the newly tinified image file, relative to the current If no project can be identified, returns NA. If " proj", will return the file path of the newly tinified imageįile relative to the Rstudio project directory (looking for an. ![]() On file names, amount of file size reduction (% and Kb), and the number of suffix is ignored whenīoolean, defaults to FALSE. New character string here to change the suffix from '_tiny' to your ownĬhoice. New file with the suffix '_tiny' and preserve the original file. TRUE to instead overwrite the original file, with the same file name. By default, tinify will createĪ new file with the suffix '_tiny' and preserve the original file. Can include sub-directories and must include the file extension (.pngīoolean, defaults to FALSE. To shrink, relative to the current working directory or as an absolute file A string detailing the path to the file you wish ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |