fix: format imports and fix effect_entry argument type

This commit is contained in:
Dylan M. Taylor
2026-10-24 02:23:26 +00:00
parent 01bb705b7b
commit b857592948
6 changed files with 7 additions and 8 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
//! The pre-#7921 Smart Blur (every neighbour read per channel through `Image::get`) stays as an
//! exact oracle: the offset fast path must give the same bits for every mode, depth and layout.
use super::{native, ncol, smart_blur, unpremul_px, xy, BlurQuality, Ctx, Image, Rect, SmartBlurMode, MAXC};
use super::{BlurQuality, Ctx, Image, MAXC, Rect, SmartBlurMode, native, ncol, smart_blur, unpremul_px, xy};
use photocraft_color::ColorMode;
#[allow(clippy::too_many_arguments)]
+1 -2
View File
@@ -2340,8 +2340,7 @@ fn build_fx_slot_maps(layer: &Layer, region: Rect, key: u64, cx: &Ctx, slot: &Fx
let mut pin = Vec::new();
layer_identity(layer, &mut std::collections::hash_map::DefaultHasher::new(), &mut |t| pin.push(std::sync::Arc::downgrade(t)));
// The maps, plus what each reserved tile address keeps allocated.
let bytes =
maps.bytes().saturating_add(pin.len().saturating_mul(std::mem::size_of::<photocraft_raster::Tile>() + 2 * std::mem::size_of::<usize>()));
let bytes = maps.bytes().saturating_add(pin.len().saturating_mul(std::mem::size_of::<photocraft_raster::Tile>() + 2 * std::mem::size_of::<usize>()));
let maps = std::sync::Arc::new(maps);
if slot.set(FxEntry { maps: maps.clone(), _pin: pin, bytes }).is_ok() {
// Counted exactly once, by the build that filled the slot, and only while the
@@ -1,7 +1,7 @@
use photocraft_psd::atn;
use serde_json::json;
use super::{enm, export, export_item, get_obj, layer_ref, pct, text, trimmed, Action, Session, Skipped};
use super::{Action, Session, Skipped, enm, export, export_item, get_obj, layer_ref, pct, text, trimmed};
/// PhotoCraft's own roundtrip accepts a combined Set, but Photoshop applies only its rename.
#[test]
+1 -1
View File
@@ -7,7 +7,7 @@ use std::sync::Arc;
use photocraft_color::{ColorMode, SampleType};
use photocraft_doc::{Document, Layer, Size};
use super::{list_objects, PcraftWriter, SaveOptions, MANIFEST};
use super::{MANIFEST, PcraftWriter, SaveOptions, list_objects};
use crate::atomic::{AtomicFs, RealFs};
/// The object or manifest directory barrier at which to inject one publication failure.
@@ -2,9 +2,9 @@
use std::sync::Arc;
use serde_json::{json, Value};
use serde_json::{Value, json};
use super::{commit_open_raw, finish_redevelop, queue_open_dialog, replace_raw_document, CameraRaw, PhotocraftApp, RawOpen};
use super::{CameraRaw, PhotocraftApp, RawOpen, commit_open_raw, finish_redevelop, queue_open_dialog, replace_raw_document};
fn synthetic_raw() -> Vec<u8> {
use photocraft_raw::testgen::{DngSpec, mosaic, scene};
+1 -1
View File
@@ -643,7 +643,7 @@ fn validate_params(f: &Map<String, Value>) -> Result<(), String> {
Ok(())
}
fn effect_entry(e: &Map<String, Value>, kind: &str, mut params: Value, initial_light_angle: Option<f64>) -> Value {
fn effect_entry(e: &Value, kind: &str, mut params: Value, initial_light_angle: Option<f64>) -> Value {
match e.get("fx").filter(|fx| fx.is_object()) {
Some(fx) => {
if kind == "bevelEmboss"