Skip to content

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

Open
atennert wants to merge 1 commit intohparra:masterfrom
atennert:doc/change-example-with-respect-to-other-convert-options
Open

doc: change example with respect to other convert options#17
atennert wants to merge 1 commit intohparra:masterfrom
atennert:doc/change-example-with-respect-to-other-convert-options

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