Comments (5)
why can't the function just return
CString::new(path.as_os_str().as_bytes()).unwrap_or_default()
Because the structure OsStr
returned by method as_os_str()
does not implement method as_bytes()
. This method is described in the trait OsStrExt
. Declaration and implementation of this trait depends on the particular OS.
from libheif-rs.
I have added this code into path_to_cstring
function:
#[cfg(all(target_arch = "wasm32", target_os = "wasi"))]
{
use std::os::wasi::ffi::OsStrExt;
CString::new(path.as_os_str().as_bytes()).unwrap_or_default()
}
You can try to compile libheif-rs from the dev
branch of this git-repo.
from libheif-rs.
When building dev branch by command cargo wasi build --release
, many errors occur like below. Any idea?
from libheif-rs.
I don't know. Could you look at bindings.rs
file somewhere inside target/wasm32-wasi/release/build/libheif-sys-*/out/
directory?
This file generates by bindgen
crate from headers-file of original libheif
library. May be it contains these function with another name.
from libheif-rs.
Have you already found a solution how to build the original libheif
library (https://github.com/strukturag/libheif) for wasm32-wasi
and statically link them to the rust project?
I think this is the most painful task in your case.
from libheif-rs.
Related Issues (20)
- unresolved externals [Windows] HOT 2
- Unable to set encoder parameter values HOT 2
- Add support for color profiles HOT 7
- Support for writing meta-data HOT 1
- Plugin support HOT 5
- 0.19 fails to build on Windows HOT 1
- Expose heif_context_set_max_decoding_threads config? HOT 3
- Use after free in HeifContext::read_from_bytes? HOT 2
- get_encoder_for_format test fails when building on Fedora HOT 5
- Clarify licensing for test data HOT 6
- Consider using HEIF and AVIF formats for test data HOT 5
- mismatch detected for 'RuntimeLibrary' on windows HOT 1
- Read from image bytes HOT 6
- statically linking libheif HOT 11
- Missing `heif_compression_format_heif_compression_mask` &c when building HOT 4
- License
- `cargo build` fails on Windows HOT 1
- The system library `libheif` required by crate `libheif-sys` was not found on Docker HOT 3
- Failing to convert HEIC to JPEG HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libheif-rs.