Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

😺 dcraw with a little added r

NotificationsYou must be signed in to change notification settings

catdad/dcrawr

Repository files navigation

The extra R is becuase it's extra cute 😺

travisnpm-downloadsnpm-versiondm-david

CLI

This module can be used as a CLI, with all of the exact same functionality as DCRAW itself. You can either install it globally:

npm install --global dcrawr# print helpdcrawr# convert an imagedcrawr -w -W IMG_1234.CR2

Or you can use it directly thoughnpx:

# convert an imagenpx dcrawr -w -W IMG_1234.CR2

API

This module only exposes the path to the correct DCRAW binary, which you can use directly throughchild_process:

constdcraw=require('dcrawr');const{ promisify}=require('util');const{ execFile}=require('child_process');constfs=require('fs');// -c will write the data to stdoutpromisify(execFile)(dcraw,['-c','my-image.dng'],{// hide the extra window on WindowswindowsHide:true,// we want the raw data, not a stringencoding:'buffer',// 8-bit PPMs are roughly 3x bigger than the original raw file// so you should set this number fairly highmaxBuffer:1024*1024*100}).then(result=>{// don't use the sync method... you get the idea thoughfs.writeFileSync('./my-image.ppm',result.stdout);}).catch(err=>{console.error(err);});

[8]ページ先頭

©2009-2025 Movatter.jp