mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-19 00:27:11 +00:00
images: cut over EPS bounding_box and is_eps to craft-ps (#2972)
This commit is contained in:
1 parent
5ce12193af
commit
12fe81ca01
5 files changed
+23
-3
No files matched your search
Generated
+19
@@ -1214,6 +1214,11 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-eps"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5bd7eb9e88e8574a9cd011accaa9b4beaf4118ac#5bd7eb9e88e8574a9cd011accaa9b4beaf4118ac"
|
||||
|
||||
[[package]]
|
||||
name = "craft-eps"
|
||||
version = "0.1.0"
|
||||
@@ -1603,6 +1608,19 @@ dependencies = [
|
||||
"winsafe",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-ps"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5bd7eb9e88e8574a9cd011accaa9b4beaf4118ac#5bd7eb9e88e8574a9cd011accaa9b4beaf4118ac"
|
||||
dependencies = [
|
||||
"craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5bd7eb9e88e8574a9cd011accaa9b4beaf4118ac)",
|
||||
"kurbo",
|
||||
"miniz_oxide 0.8.9",
|
||||
"pdf-writer",
|
||||
"skrifa 0.47.0",
|
||||
"weezl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-psd"
|
||||
version = "0.1.0"
|
||||
@@ -2296,6 +2314,7 @@ dependencies = [
|
||||
"craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)",
|
||||
"craft-file-formats",
|
||||
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)",
|
||||
"craft-ps",
|
||||
"craft-psd",
|
||||
"craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f)",
|
||||
"designcraft-color",
|
||||
|
||||
@@ -17,6 +17,7 @@ craft-mime = { version = "0.1.0", git = "https://github.com/storytold/craft-libs
|
||||
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.1.0", default-features = false }
|
||||
craft-designcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "b1b4602a71d19e09ad33f7752a10d6598cf39b2b", version = "=0.1.0" }
|
||||
craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", version = "=0.1.0" }
|
||||
craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "5bd7eb9e88e8574a9cd011accaa9b4beaf4118ac", version = "=0.1.0", features = ["read"] }
|
||||
craft-epub = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", version = "=0.1.0" }
|
||||
craft-idml = { git = "https://github.com/storytold/craft-libs", rev = "899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2", version = "=0.1.0" }
|
||||
craft-indd = { git = "https://github.com/storytold/craft-libs", rev = "47bf5650b0d503b97bfb5e841746c4957897d11f", version = "=0.1.0" }
|
||||
|
||||
@@ -10,6 +10,7 @@ workspace = true
|
||||
|
||||
[dependencies]
|
||||
craft-eps = { workspace = true }
|
||||
craft-ps = { workspace = true }
|
||||
craft-svg = { workspace = true }
|
||||
designcraft-color = { workspace = true }
|
||||
designcraft-fonts = { workspace = true }
|
||||
|
||||
@@ -10,8 +10,7 @@ fn sections(bytes: &[u8]) -> (&[u8], Option<&[u8]>) {
|
||||
|
||||
/// The bounding box in points: (x0, y0, x1, y1), the high-resolution one when given.
|
||||
pub fn bounding_box(bytes: &[u8]) -> Option<[f64; 4]> {
|
||||
let parts = craft_eps::sections(bytes).ok()?;
|
||||
craft_eps::Comments::read(parts.postscript).page_box()
|
||||
craft_ps::read::bounding_box(craft_ps::read::postscript_section(bytes))
|
||||
}
|
||||
|
||||
/// Natural EPS dimensions in points. Bound sizes before fitting or allocating a proxy:
|
||||
|
||||
@@ -13,7 +13,7 @@ mod jpeg;
|
||||
mod psd;
|
||||
mod resolution;
|
||||
mod tone;
|
||||
pub use craft_eps::is_eps;
|
||||
pub use craft_ps::read::is_eps;
|
||||
pub use eps::{bounding_box as eps_bounding_box, eps_pixel_size, eps_png, eps_proxy, eps_size};
|
||||
pub use tone::{Tone, tone};
|
||||
|
||||
|
||||
Reference in new issue
Block a user