catdad-experiments / libheif-js

🤳 libheif as an npm module
GNU Lesser General Public License v3.0
65 stars 3 forks source link

Is there a way to generate a heic/heif file using this library? #28

Closed Xheldon closed 2 weeks ago

Xheldon commented 2 months ago

I am working on a heic/heif compression tool using the Electron tech stack. I want to use libheif-js to compress a buffer read from the hard drive by node:fs to a specified value and then output it to a given path.

I found that the library only has the new libheif.HeifDecoder() method to read files correctly, but it lacks the new libheif.HeifEncoder() method to generate a heic/heif file. Is my understanding correct?

Is there any way to generate a heic/heif file?

Thx!

catdad commented 2 weeks ago

There is no encoding in the javascript version: https://github.com/strukturag/libheif/issues/113

Since you are writing an Electron desktop application, I would definitely recommend calling native binaries rather than using the javascript version.