Giter Site home page Giter Site logo

Comments (7)

stefano-xy avatar stefano-xy commented on August 15, 2024

Try to add #define LIBRAW_LIBRARY_BUILD before the #include of libraw.h, without that it seems the DllDef macro is not expanded properly. If it works, please contribute it back to upstream.

Sorry I could not test it myself due to lack of time, I've just had a quick look at the upstream code.

from picturama.

til-schneider avatar til-schneider commented on August 15, 2024

Sorry for the long time not answering. I didn't have a Windows building environment all the time. Now I set one up and managed to try your hint.

Unfortunately it still doesn't build.

I still get the same error (I'm using LibRaw 0.19.5):

c:\users\til\workspace\picturama\submodules\node-libraw\vendor\libraw\src\libraw_c_api.cpp(277): error C2491: "libraw_set_demosaic": definition of dllimport function not allowed [C:\Users\Til\workspace\picturama\subm
odules\node-libraw\build\vendor\libraw.vcxproj]

from picturama.

akjoshi avatar akjoshi commented on August 15, 2024

FYI - I checked with Libraw team in github LibRaw/LibRaw#161 (comment) and the team has confirmed that it's build-able in windows using both Microsoft compiler and gcc (mingw32).

from picturama.

til-schneider avatar til-schneider commented on August 15, 2024

Thank you for asking the Libraw team. I already knew that Libraw itself builds on Windows. What I didn't get to work yet is building Libraw as node package (using gyp). But I'm no C expert and don't know what else to do. So if anyone can help here, please go ahead.

Maybe the hint from @LibRaw's comment can help:

[...] building without windows-specific memory mapped input stream is also possible

from picturama.

akjoshi avatar akjoshi commented on August 15, 2024

I submitted a pull request in node-libraw repo to support windows compilation.

m0g/node-libraw#8 (comment)

from picturama.

rohrlaf avatar rohrlaf commented on August 15, 2024

Have you considered compiling LibRaw directly with WASM, which is Emscripten for C++: https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_wasm

This could get rid of the additional layer provided by node-libraw and also offer performance improvements as it will be pre-compiled and optimised code to be executed.

Maybe this proof-of-concept might help as well: https://github.com/arbarlow/libraw-wasm-example

from picturama.

til-schneider avatar til-schneider commented on August 15, 2024

I'm not sure, whether checking out the pull request of @akjoshi or compiling LibRaw with WASM is the better way to go. In the end, performance is most important for Picturama (because it sucks if switching between photos is not fast).

@rohrlaf: Why do you think, performance would be better with WASM? My experience with Emscripten was the exact opposite. For HEIC/HEIF support, I ended up creating node-libheif, because using a native binding was 3x faster than using Emscripten.

from picturama.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.