The Wayback Machine - https://web.archive.org/web/20200917163159/https://github.com/axe312ger/sqip/issues/91
Skip to content
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

document what the node api & cli return #91

Closed
axe312ger opened this issue Jun 20, 2019 · 0 comments
Closed

document what the node api & cli return #91

axe312ger opened this issue Jun 20, 2019 · 0 comments
Labels
Milestone

Comments

@axe312ger
Copy link
Owner

@axe312ger axe312ger commented Jun 20, 2019

node

{
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 188">...</svg>',
  metadata: {
    originalWidth: 1024,
    originalHeight: 640,
    palette: {
      // https://github.com/akfish/node-vibrant#vibrantswatch
      Vibrant: [Swatch],
      DarkVibrant: [Swatch],
      LightVibrant: [Swatch],
      Muted: [Swatch],
      DarkMuted: [Swatch],
      LightMuted: [Swatch]
    },
    width: 300,
    height: 188,
    type: 'svg',
    dataURI: "data:image/svg+xml,...",
    dataURIBase64: 'data:image/svg+xml;base64,...'
  }
}

CLI

Fully featured

$ sqip -i __tests__/fixtures/beach.jpg
Processing: __tests__/fixtures/beach.jpg
[Preview image (iTerm2 users only)]
┌───────────────┬────────────────┬───────┬────────┬──────┐
│ originalWidth │ originalHeight │ width │ height │ type │
├───────────────┼────────────────┼───────┼────────┼──────┤
│ 1024          │ 640            │ 300   │ 188    │ svg  │
└───────────────┴────────────────┴───────┴────────┴──────┘
┌─────────┬─────────────┬──────────────┬─────────┬───────────┬────────────┐
│ Vibrant │ DarkVibrant │ LightVibrant │ Muted   │ DarkMuted │ LightMuted │
├─────────┼─────────────┼──────────────┼─────────┼───────────┼────────────┤
│ #dd852f │ #be4e0c     │ #f2b17a      │ #5c8fa4 │ #694e35   │ #cfc8b7    │
└─────────┴─────────────┴──────────────┴─────────┴───────────┴────────────┘

non-TTY & --parseable-output input flag

$ sqip -i __tests__/fixtures/beach.jpg --parseable-output
Processing: __tests__/fixtures/beach.jpg
originalWidth originalHeight width height type
1024          640            300   188    svg
Vibrant DarkVibrant LightVibrant Muted   DarkMuted LightMuted
#dd852f #be4e0c     #f2b17a      #5c8fa4 #694e35   #cfc8b7

--silent flag

$ sqip -i __tests__/fixtures/beach.jpg --silent
@axe312ger axe312ger added this to the 1.0.0 milestone Jun 20, 2019
@axe312ger axe312ger changed the title document what the node api returns document what the node api & cli return Jun 20, 2019
@axe312ger axe312ger closed this in 15d3bf2 Dec 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.