New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Png-Dom-Object in NodeJS Mode #59
Comments
Ah yeah, so the compile step was designed such that the file at If you load |
ok I tried that, but I think I need little bit more help.. :) What I did now:
than I get the dist/psd.js |
You shouldn't need to compile it yourself, there is already a built version in the |
Oh yeah right, the github version has the dist folder already, the npm module don't. var PSD = require('../../../../library/psd.js/dist/psd.js'); |
Maybe I'm a little confused on how this works inside an Electron environment. As long as the psd.js script is loaded on the page, you should be able to do |
Well im confused too, about the different require and build possibilities in js.. :D I'm not sure what you mean with:
a script src tag? npm i psd & PSD = require('psd') to load dist/psd.js I need to clone psdjs from github because the npm package does not include the dist folder. Is no Browserify a problem?Electron is just a Chrome-Browser where you can use NodeJS in everywhere. |
I found the browser example.. now I know what you mean.. :) The dist/psd.js defines require by itself: when I load dist/psd.js by a script tag and change and than use: But I don't understand why there ist this require = and not a module.export = or something similar ;) |
The require is added by Browserify, but I'm honestly not up to date enough with the latest JS module loaders to know what a good solution here would be. |
Hi @bunterWolf |
I would like to create a png preview of an psd in an Electron App.
But with toPng() I get this Object which isn't mountable to the DOM instead of a Browser Image Object :
If I unterstand it right, psd.js runs in NodeJS mode because Electron has NodeJS build in the Browser/Renderer too. Which isn't the normal use case of node.
I tried to load psd.js with requirejs, but that didn't change anything.
The Usage - "NodeJS Example" works fine, the "Browser Example" don't
Can I load psd.js in Browser mode or get the Png Image Object somehow?
Thanks a lot!
The text was updated successfully, but these errors were encountered: