datago 2025.3.11__tar.gz → 2025.3.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {datago-2025.3.11 → datago-2025.3.12}/Cargo.lock +1 -1
- {datago-2025.3.11 → datago-2025.3.12}/Cargo.toml +2 -2
- {datago-2025.3.11 → datago-2025.3.12}/PKG-INFO +1 -1
- {datago-2025.3.11 → datago-2025.3.12}/src/image_processing.rs +18 -9
- {datago-2025.3.11 → datago-2025.3.12}/.github/workflows/ci-cd.yml +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/.github/workflows/rust.yml +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/.gitignore +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/.pre-commit-config.yaml +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/LICENSE +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/README.md +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/pyproject.toml +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/python/benchmark_db.py +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/python/benchmark_filesystem.py +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/python/dataset.py +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/python/raw_types.py +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/python/test_datago_db.py +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/python/test_datago_filesystem.py +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/requirements-tests.txt +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/requirements.txt +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/src/client.rs +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/src/generator_files.rs +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/src/generator_http.rs +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/src/lib.rs +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/src/main.rs +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/src/structs.rs +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/src/worker_files.rs +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/src/worker_http.rs +0 -0
- {datago-2025.3.11 → datago-2025.3.12}/tests/client_test.rs +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "datago"
|
|
3
3
|
edition = "2021"
|
|
4
|
-
version = "2025.3.
|
|
4
|
+
version = "2025.3.12"
|
|
5
5
|
|
|
6
6
|
[lib]
|
|
7
7
|
# exposed by pyo3
|
|
@@ -14,7 +14,7 @@ name = "datago"
|
|
|
14
14
|
path = "src/main.rs"
|
|
15
15
|
|
|
16
16
|
[dependencies]
|
|
17
|
-
image = "0.25.5"
|
|
17
|
+
image = { version = "0.25.5", features = ["png"]}
|
|
18
18
|
reqwest = { version = "0.12.12", features = ["blocking"] }
|
|
19
19
|
serde = { version = "1.0", features = ["derive"] }
|
|
20
20
|
serde_json = "1.0"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
use crate::structs::ImagePayload;
|
|
2
|
+
use image::ImageEncoder;
|
|
2
3
|
use serde::Deserialize;
|
|
3
4
|
use serde::Serialize;
|
|
4
5
|
use std::io::Cursor;
|
|
5
|
-
|
|
6
6
|
// --- Sample data structures - these will be exposed to the Python world ---------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
7
7
|
|
|
8
8
|
#[derive(Debug, Serialize, Deserialize)]
|
|
@@ -176,15 +176,24 @@ pub async fn image_to_payload(
|
|
|
176
176
|
// Encode the image if needed
|
|
177
177
|
let mut image_bytes: Vec<u8> = Vec::new();
|
|
178
178
|
if encode_images {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
// Use the encoder directly with the raw bytes
|
|
180
|
+
image::codecs::png::PngEncoder::new_with_quality(
|
|
181
|
+
&mut Cursor::new(&mut image_bytes),
|
|
182
|
+
image::codecs::png::CompressionType::Fast,
|
|
183
|
+
image::codecs::png::FilterType::Adaptive,
|
|
184
|
+
)
|
|
185
|
+
.write_image(
|
|
186
|
+
image.as_bytes(),
|
|
187
|
+
image.width(),
|
|
188
|
+
image.height(),
|
|
189
|
+
image.color().into(),
|
|
190
|
+
)
|
|
191
|
+
.map_err(|e| {
|
|
192
|
+
image::ImageError::IoError(std::io::Error::new(
|
|
184
193
|
std::io::ErrorKind::Other,
|
|
185
|
-
|
|
186
|
-
))
|
|
187
|
-
}
|
|
194
|
+
e.to_string(),
|
|
195
|
+
))
|
|
196
|
+
})?;
|
|
188
197
|
|
|
189
198
|
channels = -1; // Signal the fact that the image is encoded
|
|
190
199
|
} else {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|