Code Monkey home page Code Monkey logo

vscode-tinypng's Introduction

TinyPNG API VSCode Extension

This extension uses the API provided byTinyPNG to compress your JP(E)G and PNG images directly inside VSCode!

Installs Downloads Version

Features

Compression of single files

Inside the file explorer, use the entry in the context menu to compress a single file.

Context menu for single file compression

Compression of folders

As an addition to compress single files you can also compress all images inside a complete folder — including subfolders — aswell!

Select a folder and press the corresponding TinyPNG context menu entry.

Context menu for a complete folder

Requirements

You need to have an active TinyPNG API key, which you can find in your TinyPNG Developer Dashboard. You can provide the API key in your settings, see below.

!!!Be aware of TinyPNG API's pricing model! All compressions you do via this extension are counting in your account's compression count! You can see your currently and monthly compression count via command you can see below or inside the dashboard!!!

Compression Count command

Extension Settings

This extension contributes the following settings:

  • tinypng.apiKey: Your own TinyPNG API Key
  • tinypng.forceOverwrite: Force the extension to overwrite the source file with the compressed one.
  • tinypng.compressedFilePostfix: Postfix string that is appended to the compressed file, unless forceOverwrite is enabled. (default: ".min")

Known Issues/Limitations

Currently not supported API features are:

  • Image resizing
  • Preserving metadata
  • Saving compressed images to Amazon S3.

Note: This extension uses the TinyPNG own NodeJS Tinify API client. Thus issues you might notice in the extension are actual issues of this library.

Release Notes

Release notes can be found in the changelog.

Release process

  • Eventually vsce login
  • vsce publish
  • Updating Changelog via github_changelog_generator -u andi1984 -p vscode-tinypng -t <token>

Enjoy!

vscode-tinypng's People

Contributors

andi1984 avatar dependabot-preview[bot] avatar dependabot[bot] avatar hydrajump avatar nahuelpack avatar nieyuyao avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vscode-tinypng's Issues

expect many apikeys

now the apiKeys' type is the string.

expect that is any string[].

when it reaches the amount of 500, it can auto use the next key.

Lack of Windows support

error showed:
ENOENT: no such file or directory, open 'C:\c:\Users\User\multiplica\infonavit-projects\infonavit-private\src_images\demo\AcroRd32_2018-01-02_15-01-24.png'

the disk letter is repeat, I think VS put the X:\ preffix so is necesary cut from the beginin of tthe path the "x:"

API - code

This may sound stupid, but how do i provide the API code to activate the extension? Kind regards

[Future Request] Option for not overwriting file

Hello,

Great plugin. I have one useful idea.
The plugin currently compresses the file and replaces it. Overwriting is fine, but not always

I have two ideas (i'm not sure which one is better):

First idea:

  • Do not overwrite (create second file named <filename>_tifnified)

Second idea:

  • Create backup (backup before use and add <filename>_backup to the file name)

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.