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

doc: change example with respect to other convert options #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

atennert
Copy link

Input and output are usually defined at the end of the convert command. If '-' for stdin is not listed after the options, then for instance '-background none' will not work.

Input and output are usually defined at the end of the convert command. If '-' for stdin is not listed after the options, then for instance '-background none' will not work.
@atennert
Copy link
Author

I was wondering whether to also include an example for file type conversion or replace the current one. It would look like this:

// example using ImageMagick's convert
// setting "buffer: false" optional but recommended for heavy I/O
gulp.src('./src/images/*.{jpg,gif,svg}', {buffer: false})
    .pipe(spawn({
      cmd: 'convert',
      args: [
        '-background', 'none',
        '-resize', '50%',
        '-',
        'png:-'
      ],
      // optional
      opts: {cwd: '.'},
      filename: (base, ext) => `${base}-half.png`
    }))
    .pipe(gulp.dest('./dist/images'));

It looks more complicated than the current one though ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant