- bump bioformats to 8.3.0

- rust: command line binary, save as mp4, save as tiff, ome metadata, more methods for View, bugfixes, less unsafe code
- python: ome as dict
This commit is contained in:
Wim Pomp
2025-08-21 19:45:02 +02:00
parent 24af64ac7e
commit 3dc8e6af04
17 changed files with 2317 additions and 1261 deletions

View File

@@ -21,9 +21,21 @@ fn jvm() -> Rc<Jvm> {
.unwrap()
.to_path_buf();
let class_path = path.parent().unwrap();
let class_path = if path.join("jassets").exists() {
path.as_path()
} else {
path.parent().unwrap()
};
if !class_path.join("jassets").exists() {
panic!(
"jassets directory does not exist in {}",
class_path.display()
);
}
Rc::new(
JvmBuilder::new()
.skip_setting_native_lib()
.with_base_path(class_path.to_str().unwrap())
.build()
.expect("Failed to build JVM"),
@@ -33,11 +45,25 @@ fn jvm() -> Rc<Jvm> {
})
}
#[cfg(feature = "python")]
pub(crate) fn download_bioformats(gpl_formats: bool) -> Result<()> {
let path = crate::py::ndbioimage_file().unwrap();
pub fn download_bioformats(gpl_formats: bool) -> Result<()> {
#[cfg(feature = "python")]
let path = crate::py::ndbioimage_file()?;
#[cfg(not(feature = "python"))]
let path = std::env::current_exe()
.unwrap()
.parent()
.unwrap()
.to_path_buf();
let class_path = path.parent().unwrap();
let jassets = class_path.join("jassets");
if !jassets.exists() {
std::fs::create_dir_all(jassets)?;
}
println!("installing jassets in {}", class_path.display());
let jvm = JvmBuilder::new()
.skip_setting_native_lib()
.with_base_path(class_path.to_str().unwrap())
.with_maven_settings(j4rs::MavenSettings::new(vec![
j4rs::MavenArtifactRepo::from(
@@ -46,10 +72,10 @@ pub(crate) fn download_bioformats(gpl_formats: bool) -> Result<()> {
]))
.build()?;
jvm.deploy_artifact(&j4rs::MavenArtifact::from("ome:bioformats_package:8.1.0"))?;
jvm.deploy_artifact(&j4rs::MavenArtifact::from("ome:bioformats_package:8.3.0"))?;
if gpl_formats {
jvm.deploy_artifact(&j4rs::MavenArtifact::from("ome:formats-gpl:8.1.0"))?;
jvm.deploy_artifact(&j4rs::MavenArtifact::from("ome:formats-gpl:8.3.0"))?;
}
Ok(())