Skip to content

Commit

Permalink
🔀 Add JxlEncoderUseBoxes for metadata encode (#58)
Browse files Browse the repository at this point in the history
- Add metadata test, test encoder.use_box
- Cleaned up from #54
  • Loading branch information
inflation authored May 18, 2024
2 parents 58956f0 + 12710d6 commit 15d6a37
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
32 changes: 16 additions & 16 deletions jpegxl-rs/src/encode.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
This file is part of jpegxl-rs.
jpegxl-rs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
jpegxl-rs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with jpegxl-rs. If not, see <https://www.gnu.org/licenses/>.
*/
* This file is part of jpegxl-rs.
*
* jpegxl-rs is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* jpegxl-rs is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with jpegxl-rs. If not, see <https://www.gnu.org/licenses/>.
*/

//! Encoder of JPEG XL format
Expand Down Expand Up @@ -395,7 +395,7 @@ impl<'prl, 'mm> JxlEncoder<'prl, 'mm> {
self.check_enc_status(unsafe {
JxlEncoderAddBox(
self.enc,
Metadata::box_type(t),
&Metadata::box_type(t),
data.as_ptr().cast(),
data.len(),
compress.into(),
Expand Down
32 changes: 16 additions & 16 deletions jpegxl-sys/src/encode.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
This file is part of jpegxl-sys.
jpegxl-sys is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
jpegxl-sys is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with jpegxl-sys. If not, see <https://www.gnu.org/licenses/>.
*/
* This file is part of jpegxl-rs.
*
* jpegxl-rs is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* jpegxl-rs is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with jpegxl-rs. If not, see <https://www.gnu.org/licenses/>.
*/

use std::ffi::{c_char, c_void};

Expand Down Expand Up @@ -242,7 +242,7 @@ extern "C" {

pub fn JxlEncoderAddBox(
enc: *mut JxlEncoder,
box_type: JxlBoxType,
box_type: *const JxlBoxType,
contents: *const u8,
size: usize,
compress_box: JxlBool,
Expand Down

0 comments on commit 15d6a37

Please sign in to comment.