zfedoran / dcraw.js Goto Github PK
View Code? Open in Web Editor NEWDecode or convert RAW camera images using JavaScript
License: GNU General Public License v2.0
Decode or convert RAW camera images using JavaScript
License: GNU General Public License v2.0
There are two things that are now broken here:
I've fixed both on my local copy and it works nicely, and can even use the latest dcraw.c (which is only slightly newer than the one here).
I get this error when trying to use setBrightnessLevel and setCustomGammaCurve
Uncaught TypeError: Assignment to constant variable .... (@ dcraw.js:4)
Just seems to me that only the boolean options work with this code unless I am missing a trick with the syntax.
All the examples are with booleans as well
Tried -
var result = dcraw(buf, { setBrightnessLevel: 1.0 }); - fails and this is default
var result = dcraw(buf, { setBrightnessLevel: '1.0' }); - fails
var result = dcraw(buf, { setCustomGammaCurve: 2.4 12.92 }}); - fails
var result = dcraw(buf, { setCustomGammaCurve: 2.4, 12.92 }}); - fails
var result = dcraw(buf, { setCustomGammaCurve: '2.4', '12.92' }}); - fails
var result = dcraw(buf, { setCustomGammaCurve: { p: 2.4, ts: 12.92 }}); - fails
var result = dcraw(buf, { exportAsTiff: true }); - works OK
var result = dcraw(buf, { extractThumbnail: true }); - works OK
var result = dcraw(buf, { }); // PPM - works OK
var result = dcraw(buf, { useRawMode: true }); - works OK
Cheers,
Blane
In the generated lib output (dcraw/dist/dcraw.js
), the const variable args
is reassigned, which is causing an error (and preventing a valid build). The beautified output below shows this:
const args = [];
if (options) {
...
for (var prop in options) {
const val = options[prop];
if (val !== undefined) {
...
if (prop.match(/[A r C k S n H t o b g q m s]/)) {
args = args.concat(val.toString().split(/\s/)) // <-------- reassignment
}
The creation of the variable should use the let
identifier so that it can be reassigned.
hi,
.cr3 file not open...
Can you help me?
I decided to give this a shot as part of a simple Lightroom catalog helper utility (lrcat files are just sqlite3 databases, so finding image locations and creating thumbnails for them is basically trivial), but it takes 20 seconds to convert a 6000x4000px, 26MB NEF to a 76MB (!) TIFF, on an i7-6700 with more RAM than makes sense in almost any machine.
Is there a way to tell this port to do a resize-while-loading of the NEF data, so that it only tries to work with 600x400px data, for instance? 20 seconds per thumbnail (even with result-caching) isn't really all that much better than "it doesn't work at all" =(
(using the dedicated thumbnail extraction is quite fast, but there are plenty of raws without a built in thumbnail...)
I love this package, thank you! But the extracted thumbnail doesn't have the right rotation - it always comes out as landscape even for raw images that are portrait. Any ideas for how to fix?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.