Skip to content

Commit eddfede

Browse files
tai2bencevans
authored andcommitted
feat(linux): infer file type from filename.
1 parent f51db95 commit eddfede

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/linux/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,11 @@ function linuxSnapshot (options = {}) {
143143
encoding: 'buffer',
144144
maxBuffer: maxBuffer(screens)
145145
}
146+
const extension = path.extname(filename) || '.jpeg'
147+
const filetype = extension.substr(1)
146148

147149
exec(
148-
`import -silent -window root -crop ${screen.crop} -screen jpeg:${filename} `,
150+
`import -silent -window root -crop ${screen.crop} -screen ${filetype}:${filename} `,
149151
execOptions,
150152
(err, stdout) => {
151153
if (err) {

0 commit comments

Comments
 (0)