Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 91f1d95
Author: Uttarayan Mondal <email@uttarayan.me>
Date:   Tue Feb 6 18:47:44 2024 +0530

    [feat] Update to latest libraw

commit 67b13a7
Author: Mentle Gen <arshkumar9@live.com>
Date:   Mon Feb 5 10:56:49 2024 +0530

    Replaced CargoCallBacks const with new()

commit 5f36c5a
Author: Mentle Gen <arshkumar9@live.com>
Date:   Mon Feb 5 10:51:12 2024 +0530

    Added git URL for libjpeg sys

commit 000adc9
Author: Uttarayan Mondal <email@uttarayan.me>
Date:   Mon Feb 5 15:46:35 2024 +0530

    [feat] Remove path dep

commit ceae875
Author: Uttarayan Mondal <email@uttarayan.me>
Date:   Mon Feb 5 15:38:58 2024 +0530

    [feat] Use libjpeg-turbo

commit 350dfce
Author: saul <arshkumar9@live.com>
Date:   Fri Feb 2 18:12:35 2024 +0530

    Fix for ktra down bad

commit 51ae25e
Author: Uttarayan Mondal <email@uttarayan.me>
Date:   Tue Jan 30 14:41:32 2024 +0530

    [bump] Bump version for bindgen

commit 1e23102
Author: saul <arsh.k@aftershoot.com>
Date:   Tue Oct 17 11:06:46 2023 +0530

    Updated submodule

commit b39ed1e
Author: Uttarayan Mondal <email@uttarayan.me>
Date:   Mon Aug 21 16:16:56 2023 +0530

    [fix] Use ktra registry

commit a599deb
Author: saul <arsh.k@aftershoot.com>
Date:   Wed Aug 2 15:58:42 2023 +0530

    Fix: Removed ktra dependency

commit a776b36
Author: saul <arsh.k@aftershoot.com>
Date:   Wed Aug 2 12:38:03 2023 +0530

    Changed submodule for libraw

commit e70e434
Author: Uttarayan Mondal <email@uttarayan.me>
Date:   Tue May 9 20:07:22 2023 +0530

    [Fix] Add multi-thumb wrapper routes

commit 9fb5d37
Author: saul <arshkumar9@live.com>
Date:   Tue May 9 20:06:43 2023 +0530

    Whatever.

commit 1c9e7e7
Author: Uttarayan Mondal <email@uttarayan.me>
Date:   Tue May 9 20:02:08 2023 +0530

    [fix] Update libarw-sys to 8.10

commit 9eff78a
Author: Uttarayan Mondal <email@uttarayan.me>
Date:   Tue May 9 19:45:32 2023 +0530

    [fix] Bring up the version of libraw_r
  • Loading branch information
uttarayan21 committed Mar 6, 2024
1 parent bf0a164 commit f78100e
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 11 deletions.
1 change: 0 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[registries]
ktra = { index = "https://github.com/uttarayan21/crates-io.git" }

2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "libraw-sys/vendor"]
path = libraw-sys/vendor
url = https://github.com/libraw/libraw
url = git@github.com:aftershootco/libraw.git
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"libraw-rs",
"libraw-sys",
Expand Down
3 changes: 1 addition & 2 deletions libraw-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ rust-version = "1.65"
description = "High level api over libraw-sys"
repository = "https://github.com/aftershootco/libraw-sys"
homepage = "https://github.com/aftershootco/libraw-sys"
publish = ["ktra"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -16,7 +15,7 @@ futures = { version = "0.3.28", optional = true }
image = { version = "0.24" , optional = true }
img-parts = { version = "0.3.0", optional = true }
libc = { version = "0.2.135", optional = true }
libraw-sys = { version = "1.0.0-rc.1", path = "../libraw-sys", registry = "ktra" }
libraw-sys = { version = "1.0.0-rc.1", path = "../libraw-sys" }
semver = "1.0"
thiserror = "1.0"

Expand Down
8 changes: 8 additions & 0 deletions libraw-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ impl Default for Processor {
}

impl Processor {
pub fn thumbs_list(&self) -> &sys::libraw_thumbnail_list_t {
unsafe { &self.inner.as_ref().thumbs_list }
}
pub fn unpack_thumb_ex(&mut self, index: libc::c_int) -> Result<(), LibrawError> {
LibrawError::check(unsafe { sys::libraw_unpack_thumb_ex(self.inner.as_ptr(), index) })?;
Ok(())
}

/// Drop the processor and get a handle to the inner type
///
/// Processor also implements DerefMut so you can take that if you want
Expand Down
7 changes: 4 additions & 3 deletions libraw-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ links = "raw_r"
libc = "0.2.123"
libz-sys = { version = "1.1.8", optional = true, features = ["static"], default-features = false }
# We want to switch out to libjpeg-turbo but currently the build system depends cmake and doesn't build on windows for some reason
mozjpeg-sys = { version = "1.0", optional = true, features = ["jpeg80_abi"], registry = "ktra" }
# mozjpeg-sys = { path = "/Users/fs0c131y/Projects/aftershoot/mozjpeg-sys", optional = true, features = ["jpeg80_abi", "nasm_simd", "with_simd", "nasm_simd_parallel_build", "parallel"] }
libjpeg-sys = { git = "https://github.com/aftershootco/libjpeg-sys", optional = true }
openmp-sys = { version = "1.2.3", optional = true }

[build-dependencies]
bindgen = { version = "0.65.1", optional = true }
bindgen = { version = "0.69", optional = true }
pkg-config = "0.3.26"
cc = { version = "1.0.73", features = ["parallel"]}
shellexpand = "3.0.0"
Expand All @@ -31,6 +32,6 @@ default = ["jpeg", "zlib", "bindgen"]
bindgen = ["dep:bindgen"]
copy = []
zlib = ["dep:libz-sys"]
jpeg = ["dep:mozjpeg-sys"]
jpeg = ["dep:libjpeg-sys"]
openmp = ["dep:openmp-sys"]
openmp_static = ["openmp", "openmp-sys?/static"]
6 changes: 4 additions & 2 deletions libraw-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ fn build(out_dir: impl AsRef<Path>, libraw_dir: impl AsRef<Path>) -> Result<()>
);
println!("cargo:rustc-link-lib=static=raw_r");
#[cfg(feature = "jpeg")]
println!("cargo:rustc-link-lib=static=mozjpeg80");
if let Ok(name) = std::env::var("DEP_JPEG_NAME") {
println!("cargo:rustc-link-lib=static={name}");
}
#[cfg(feature = "zlib")]
println!("cargo:rustc-link-lib=static=z");

Expand All @@ -275,7 +277,7 @@ fn bindings(out_dir: impl AsRef<Path>, libraw_dir: impl AsRef<Path>) -> Result<(
.use_core()
.ctypes_prefix("libc")
.generate_comments(true)
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
// API improvements
.derive_eq(true)
.size_t_is_usize(true)
Expand Down
2 changes: 1 addition & 1 deletion libraw-sys/vendor
2 changes: 1 addition & 1 deletion tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ libraw_r = { path = "../libraw-rs/" }

[dev-dependencies]
libraw_r = { path = "../libraw-rs/" }
criterion = { version = "0.4.0", features = ["html_reports"] }
criterion = { version = "0.5", features = ["html_reports"] }

[[bench]]
name = "libraw"
Expand Down

0 comments on commit f78100e

Please sign in to comment.