Skip to content
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

Cannot pass non-string to std::string error #11

Closed
hisham opened this issue Nov 20, 2020 · 2 comments
Closed

Cannot pass non-string to std::string error #11

hisham opened this issue Nov 20, 2020 · 2 comments
Labels
invalid This doesn't seem right

Comments

@hisham
Copy link

hisham commented Nov 20, 2020

I'm trying to use this lib but keep getting this error:

  BindingError {
     name: 'BindingError',
     message: 'Cannot pass non-string to std::string',
     stack: 'BindingError: Cannot pass non-string to std::string\n' +
       '    at BindingError.<anonymous> (/Users/hisham/src/ess-app/packages/cli/node_modules/libheif-js/libheif/libheif.js:1:178858)\n' +
       '    at new BindingError (eval at createNamedFunction (/Users/hisham/src/ess-app/packages/cli/node_modules/libheif-js/libheif/libheif.js:18:11916), <anonymous>:4:34)\n' +
       '    at throwBindingError (/Users/hisham/src/ess-app/packages/cli/node_modules/libheif-js/libheif/libheif.js:1:182383)\n' +
       '    at Object.toWireType (/Users/hisham/src/ess-app/packages/cli/node_modules/libheif-js/libheif/libheif.js:1:209812)\n' +
       '    at Object.heif_context_read_from_memory (eval at new_ (/Users/hisham/src/ess-app/packages/cli/node_modules/libheif-js/libheif/libheif.js:1:203780), <anonymous>:8:26)\n' +
       '    at HeifDecoder.decode (/Users/hisham/src/ess-app/packages/cli/node_modules/libheif-js/libheif/libheif.js:18:10575)\n' +
       '    at decodeBuffer (/Users/hisham/src/ess-app/packages/cli/node_modules/heic-decode/index.js:52:24)\n' +
       '    at module.exports (/Users/hisham/src/ess-app/packages/cli/node_modules/heic-decode/index.js:69:46)\n' +
       '    at convert (/Users/hisham/src/ess-app/packages/cli/node_modules/heic-convert/index.js:39:25)\n' +
       '    at module.exports (/Users/hisham/src/ess-app/packages/cli/node_modules/heic-convert/index.js:56:70)\n' +
       '    at ImageService.convertHEICToJpeg (/Users/hisham/src/ess-app/packages/cli/src/utils/image.service.ts:26:22)\n' +
       '    at Object.<anonymous> (/Users/hisham/src/ess-app/packages/cli/src/utils/image.service.test.ts:14:39)\n' +
       '    at Object.asyncJestTest (/Users/hisham/src/ess-app/packages/cli/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37)\n' +
       '    at /Users/hisham/src/ess-app/packages/cli/node_modules/jest-jasmine2/build/queueRunner.js:45:12\n' +
       '    at new Promise (<anonymous>)\n' +
       '    at mapper (/Users/hisham/src/ess-app/packages/cli/node_modules/jest-jasmine2/build/queueRunner.js:28:19)\n' +
       '    at /Users/hisham/src/ess-app/packages/cli/node_modules/jest-jasmine2/build/queueRunner.js:75:41\n' +
       '    at processTicksAndRejections (internal/process/task_queues.js:97:5)'
   }

@catdad
Copy link
Member

catdad commented Nov 20, 2020

Do you have any code to reproduce this issue? Does this happen with only one or all images?

@hisham
Copy link
Author

hisham commented Nov 20, 2020

I investigated, and it appears that this only happens if I run heic-convert within a jest testing environment.

The fix suggested at emscripten-core/emscripten#8400 (comment) resolved it for me! Very weird.

Feel free to close this issue if you want. It appears when emscripten-core/emscripten#8400 is resolved this will resolve as well..

@catdad catdad added the invalid This doesn't seem right label Nov 21, 2020
@catdad catdad closed this as completed Nov 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants