Skip to content

Commit

Permalink
use ffi and DynamicImage only on image_base64
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Feb 12, 2025
1 parent bdd6c5a commit d6df23e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use image::DynamicImage;
use std::sync::Mutex;
use std::sync::OnceLock;

use std::ffi::CString;

#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;

Expand Down Expand Up @@ -98,8 +95,11 @@ pub extern "C" fn image() -> ImageBuffer {
}

#[no_mangle]
#[cfg(feature = "ffi")]
pub extern "C" fn image_base64() -> *const std::os::raw::c_char {
use base64::{engine::general_purpose, Engine};
use image::DynamicImage;
use std::ffi::CString;
use std::io::Cursor;

if let Some(gb) = GAMEBOY.get() {
Expand Down

0 comments on commit d6df23e

Please sign in to comment.