Merge PhotoCraft main; keep craft-libs at 20574f0ed4

This commit is contained in:
aiongg committed 2026-11-22 22:57:49 +00:00
commit 910759f7e6
667 files changed
+3933 -2427

No files matched your search

+261 -261
View File
@@ -14,7 +14,7 @@ bin linux photocraft-color 37 1.67
bin linux photocraft-compose 536 61.79
bin linux photocraft-compose::it 9 0.33
bin linux photocraft-doc 85 1.85
bin linux photocraft-engine 4444 1033.26
bin linux photocraft-engine-core 4444 1033.26
bin linux photocraft-engine::global_state 27 18.61
bin linux photocraft-engine::it 745 420.58
bin linux photocraft-engine::panic_hunt 2 12.37
@@ -161,104 +161,104 @@ test linux photocraft-compose 4.89 tests::one_colour_areas_reduce_like_composite
test linux photocraft-compose 1.25 tests::shapeless_effects_render_the_same_in_bands_and_parts
test linux photocraft-compose 1.46 viewport::tests::reduced_pages_match_averaging_every_composited_pixel
test linux photocraft-doc 1.10 slices::tests::nested_slices_resolve_in_bounded_work
test linux photocraft-engine 1.17 cmd::align_cmds::tests::auto_align_keeps_a_locked_layer_as_the_reference
test linux photocraft-engine 5.04 cmd::align_cmds::tests::auto_align_registers_a_smooth_bracket_by_intensity
test linux photocraft-engine 1.29 cmd::align_cmds::tests::auto_align_rejects_unrelated_layers_instead_of_guessing_a_pose
test linux photocraft-engine 1.24 cmd::artboard_cmds::include_name_tests::a_name_taller_than_the_border_never_draws_over_the_board
test linux photocraft-engine 1.23 cmd::artboard_cmds::include_name_tests::bad_name_options_never_panic
test linux photocraft-engine 1.04 cmd::atn_cmds::render_tests::render_actions_match_direct_filters_and_undo
test linux photocraft-engine 1.76 cmd::atn_cmds::stylize_tests::imported_group_d_playback_matches_direct_commands_across_modes_and_depths
test linux photocraft-engine 2.90 cmd::brush_cmds::mixer_live_tests::mixer_command_outgrows_the_preview_tile_budget_without_losing_the_stroke
test linux photocraft-engine 5.26 cmd::brush_cmds::mixer_live_tests::mixer_command_paints_strokes_beyond_the_preview_sample_and_dab_budgets
test linux photocraft-engine 3.82 cmd::brush_cmds::mixer_live_tests::mixer_large_brushes_replay_after_the_preview_budget
test linux photocraft-engine 2.32 cmd::channel_cmds::apply_image_locked_layer_tests::a_locked_layer_gets_the_preserve_transparency_result
test linux photocraft-engine 1.32 cmd::cutout_cmds::tests::remove_background_masks_the_subject_at_every_depth_and_undoes
test linux photocraft-engine 1.46 cmd::cutout_cmds::tests::remove_background_on_a_layer_smaller_than_the_canvas_masks_the_subject_not_the_layer
test linux photocraft-engine 1.66 cmd::distort_cmds::tests::puppet_refuses_pins_that_stretch_the_content_too_far
test linux photocraft-engine 1.86 cmd::edit_cmds::tests::tiled_lift_matches_the_whole_area_lift
test linux photocraft-engine 13.56 cmd::edit_menu_cmds::tests::content_aware_fill_samples_photoshops_window
test linux photocraft-engine 4.41 cmd::edit_menu_cmds::tests::content_aware_fill_takes_the_workspace_edits
test linux photocraft-engine 3.17 cmd::edit_menu_cmds::tests::delete_and_fill_selection_removes_the_object_in_one_step
test linux photocraft-engine 1.37 cmd::eraser_cmds::transparency_lock_tests::with_a_colour_channel_target_the_preview_matches_the_commit_on_a_locked_layer
test linux photocraft-engine 11.13 cmd::file_cmds::export::export_clut_stack_tests::a_huge_canvas_still_bakes_the_stack
test linux photocraft-engine 8.05 cmd::file_cmds::place_job_tests::a_cooperative_place_equals_the_inline_place
test linux photocraft-engine 1.09 cmd::file_cmds::place_resolution_tests::the_resolution_scale_comes_before_the_fit_to_the_canvas
test linux photocraft-engine 2.84 cmd::image_cmds::tests::crop_target_budgets_the_hidden_pixels_it_resamples
test linux photocraft-engine 2.24 cmd::image_cmds::tests::crop_to_a_target_size_and_resolution_is_one_step
test linux photocraft-engine 3.14 cmd::image_cmds::tests::turned_crop_deleting_pixels_matches_turning_the_whole_canvas
test linux photocraft-engine 6.75 cmd::layer_multi_cmds::tile_damage_tests::painting_command_hints_cover_their_changed_tiles
test linux photocraft-engine 1.04 cmd::mode_cmds::rotate_canvas_interpolation_pref_tests::not_measured_preferences_keep_todays_bicubic_result
test linux photocraft-engine 1.31 cmd::mode_cmds::rotate_canvas_right_angle_tests::arbitrary_right_angles_match_the_dedicated_rotation_commands
test linux photocraft-engine 3.70 cmd::mode_cmds::tests::bitmap_custom_pattern_accepts_compact_pattern_past_full_rgba_limit
test linux photocraft-engine 3.25 cmd::mode_cmds::tests::bitmap_output_resolution_budgets_the_whole_conversion_not_just_the_resample
test linux photocraft-engine 1.61 cmd::mode_cmds::tests::duotone_to_colour_modes_keeps_the_ink_colours
test linux photocraft-engine 12.44 cmd::pattern_cmds::tests::defined_patterns_over_4096_squared_paint_or_are_refused
test linux photocraft-engine 1.01 cmd::photo_cmds::photomerge_layer_order_tests::blended_composite_does_not_depend_on_the_stacking
test linux photocraft-engine 1.15 cmd::photo_cmds::photomerge_layer_order_tests::fill_layer_stays_above_the_sources
test linux photocraft-engine 1.53 cmd::photo_cmds::photomerge_layer_order_tests::first_source_is_the_top_layer
test linux photocraft-engine 2.01 cmd::photo_cmds::photomerge_name_tests::a_second_panorama_gets_another_number
test linux photocraft-engine 1.96 cmd::photo_cmds::photomerge_name_tests::panorama_is_untitled_panorama_1_whatever_else_is_open
test linux photocraft-engine 2.81 cmd::photo_cmds::tests::hdr_merge_from_synthetic_exposures
test linux photocraft-engine 8.35 cmd::photo_cmds::tests::photomerge_cylindrical_with_fill
test linux photocraft-engine 3.72 cmd::photo_cmds::tests::photomerge_open_documents_ignores_the_folder
test linux photocraft-engine 2.41 cmd::photo_cmds::tests::photomerge_open_documents_reposition_and_perspective
test linux photocraft-engine 4.76 cmd::retouch_cmds::art_history::tests::large_brush_click_is_not_too_large
test linux photocraft-engine 2.53 cmd::retouch_cmds::clone_source_layer_tests::clone_healing_absent_source_preserves_nonuniform_destinations
test linux photocraft-engine 3.74 cmd::retouch_cmds::clone_source_layer_tests::clone_no_alpha_sources_clip_preview_live_and_commit_at_all_canvas_corners
test linux photocraft-engine 84.40 cmd::retouch_cmds::content_aware_move::color_tests::a_brightness_change_shifts_the_middle_only_past_color_five
test linux photocraft-engine 42.09 cmd::retouch_cmds::content_aware_move::color_tests::a_flat_patch_matches_the_new_surroundings_at_color_ten
test linux photocraft-engine 59.07 cmd::retouch_cmds::content_aware_move::color_tests::color_ten_on_green_leaves_the_middle_and_blends_the_edge
test linux photocraft-engine 10.55 cmd::retouch_cmds::content_aware_move::tests::a_coarse_preview_keeps_a_faint_sparse_selection
test linux photocraft-engine 7.63 cmd::retouch_cmds::content_aware_move::tests::a_preview_within_the_full_resolution_budget_is_the_plain_solve_bit_for_bit
test linux photocraft-engine 14.20 cmd::retouch_cmds::patch::patch_destination_selection_tests::content_aware_keeps_the_selection_and_changes_the_pixels
test linux photocraft-engine 2.68 cmd::retouch_cmds::patch_history_names_tests::applying_a_patch_is_one_step_named_patch_selection_in_every_mode
test linux photocraft-engine 1.99 cmd::retouch_cmds::remove::remove_new_layer_name_tests::a_taken_name_gives_the_first_free_one
test linux photocraft-engine 1.23 cmd::retouch_cmds::remove::remove_new_layer_name_tests::successive_strokes_name_remove_tool_edits_then_1_then_2_each_above_the_active_layer
test linux photocraft-engine 1.01 cmd::retouch_cmds::remove_history_name_tests::one_stroke_is_one_step_named_remove_tool_in_every_mode_and_depth
test linux photocraft-engine 1.38 cmd::retouch_cmds::tests::content_aware_extend_keeps_the_original
test linux photocraft-engine 4.97 cmd::retouch_cmds::tests::content_aware_move_coarse_preview_handles_transform_extend_and_limits
test linux photocraft-engine 1.85 cmd::retouch_cmds::tests::content_aware_move_fails_gracefully
test linux photocraft-engine 9.65 cmd::retouch_cmds::tests::content_aware_move_moves_the_object_and_fills_its_place_at_all_depths
test linux photocraft-engine 4.42 cmd::retouch_cmds::tests::content_aware_move_overlapping_at_the_edge_and_on_other_targets
test linux photocraft-engine 7.02 cmd::retouch_cmds::tests::content_aware_move_preview_shows_the_result_without_touching_the_session
test linux photocraft-engine 35.99 cmd::retouch_cmds::tests::content_aware_move_previews_large_selections_coarse_then_exact
test linux photocraft-engine 5.54 cmd::retouch_cmds::tests::content_aware_move_samples_all_layers_onto_an_empty_layer
test linux photocraft-engine 12.56 cmd::retouch_cmds::tests::content_aware_move_structure_and_color_shape_the_result
test linux photocraft-engine 9.49 cmd::retouch_cmds::tests::content_aware_move_transform_on_drop_scales_and_rotates_the_content
test linux photocraft-engine 12.99 cmd::retouch_cmds::tests::live_dab_batches_match_the_accumulating_renderer
test linux photocraft-engine 1.53 cmd::retouch_cmds::tests::live_dab_rejects_invalid_batches_without_changing_the_preview
test linux photocraft-engine 8.69 cmd::retouch_cmds::tests::live_dab_strokes_commit_their_pixels_and_they_are_the_commands
test linux photocraft-engine 3.71 cmd::retouch_cmds::tests::patch_content_aware_copies_the_dragged_to_content_into_the_selection
test linux photocraft-engine 1.37 cmd::retouch_cmds::tests::protect_detail_drags_at_the_default_spacing_widen_the_halo_without_banding
test linux photocraft-engine 1.47 cmd::retouch_cmds::tests::remove_a_ring_around_an_object_removes_it_in_one_undo_step
test linux photocraft-engine 2.28 cmd::retouch_cmds::tests::sample_all_layers_spot_healing_heals_onto_an_empty_layer
test linux photocraft-engine 14.35 cmd::retouch_cmds::tests::spot_healing_keeps_film_grain_through_overlapping_strokes
test linux photocraft-engine 4.92 cmd::retouch_cmds::tests::spot_healing_removes_blemish_all_types
test linux photocraft-engine 1.26 cmd::retouch_cmds::tests::the_tools_the_reference_application_does_not_wrap_stop_at_the_canvas_edge
test linux photocraft-engine 4.24 cmd::selection_cmds::color_range_window_tests::cropped_range_matches_full_canvas_combinations_with_soft_holes_and_clipped_masks
test linux photocraft-engine 3.30 cmd::selection_cmds::modify_window::tests::cropped_commands_match_full_canvas_reads_padding_and_writeback
test linux photocraft-engine 7.71 cmd::selection_cmds::tests::windowed_tool_feather_matches_full_canvas
test linux photocraft-engine 1.93 cmd::slice_cmds::tests::divide_refuses_more_parts_than_one_division_makes
test linux photocraft-engine 2.05 cmd::smart_cmds::tests::selection::selected_pixels_become_one_editable_smart_object_in_every_mode_and_depth
test linux photocraft-engine 2.52 cmd::smart_cmds::tests::source_flatten::effects_across_block_edges_match
test linux photocraft-engine 3.27 cmd::smart_cmds::tests::svg_profile::svg_smart_contents_and_stack_open_many_shapes_as_layers
test linux photocraft-engine 3.36 cmd::smart_cmds::tests::svg_profile::svg_warp_frame_uses_bounded_bounds
test linux photocraft-engine 1.49 cmd::smartselect_cmds::object_hard_edge_tests::hard_edge_off_on_the_reference_disc
test linux photocraft-engine 2.04 cmd::smartselect_cmds::object_hard_edge_tests::hard_edge_on_is_unchanged_on_the_reference_document
test linux photocraft-engine 4.11 cmd::smartselect_cmds::tests::refine_edge_accepts_huge_sparse_and_solid_selections
test linux photocraft-engine 1.54 cmd::smartselect_cmds::tests::refine_edge_edits_object_and_subject
test linux photocraft-engine 1.02 cmd::swatch_cmds::tests::library_limits
test linux photocraft-engine 8.27 color_channels::tone::tests::fused_tiles_match_scalar_oracle_at_all_depths_and_modes
test linux photocraft-engine 1.76 color_channels::tone_dialog_tests::tone_dialog_normalization_matches_native_execution
test linux photocraft-engine 1.60 jobs::tests::content_aware_fill_and_scale_run_as_jobs
test linux photocraft-engine 2.82 jobs::tests::content_aware_move_runs_as_a_job
test linux photocraft-engine 1.07 jobs::tests::remove_runs_as_a_job
test linux photocraft-engine 1.07 layer_style::tests::oversized_satin_and_bevel_sizes_stay_saveable_and_render
test linux photocraft-engine 1.20 new_layer::tests::neutral_fills_leave_the_image_unchanged
test linux photocraft-engine 39.06 pixels::tests::tiled_adjustment_matches_one_pass_over_the_content
test linux photocraft-engine 13.64 pixels::tests::tiled_clear_and_fill_match_one_pass_over_the_area
test linux photocraft-engine 3.84 select_mask_edits::tests::thin_edits_across_a_huge_canvas_paint_only_their_tiles
test linux photocraft-engine 8.54 tests::file_new_at_the_size_limit_does_not_fill_every_tile
test linux photocraft-engine-core 1.17 cmd::align_cmds::tests::auto_align_keeps_a_locked_layer_as_the_reference
test linux photocraft-engine-core 5.04 cmd::align_cmds::tests::auto_align_registers_a_smooth_bracket_by_intensity
test linux photocraft-engine-core 1.29 cmd::align_cmds::tests::auto_align_rejects_unrelated_layers_instead_of_guessing_a_pose
test linux photocraft-engine-core 1.24 cmd::artboard_cmds::include_name_tests::a_name_taller_than_the_border_never_draws_over_the_board
test linux photocraft-engine-core 1.23 cmd::artboard_cmds::include_name_tests::bad_name_options_never_panic
test linux photocraft-engine-core 1.04 cmd::atn_cmds::render_tests::render_actions_match_direct_filters_and_undo
test linux photocraft-engine-core 1.76 cmd::atn_cmds::stylize_tests::imported_group_d_playback_matches_direct_commands_across_modes_and_depths
test linux photocraft-engine-core 2.90 cmd::brush_cmds::mixer_live_tests::mixer_command_outgrows_the_preview_tile_budget_without_losing_the_stroke
test linux photocraft-engine-core 5.26 cmd::brush_cmds::mixer_live_tests::mixer_command_paints_strokes_beyond_the_preview_sample_and_dab_budgets
test linux photocraft-engine-core 3.82 cmd::brush_cmds::mixer_live_tests::mixer_large_brushes_replay_after_the_preview_budget
test linux photocraft-engine-core 2.32 cmd::channel_cmds::apply_image_locked_layer_tests::a_locked_layer_gets_the_preserve_transparency_result
test linux photocraft-engine-core 1.32 cmd::cutout_cmds::tests::remove_background_masks_the_subject_at_every_depth_and_undoes
test linux photocraft-engine-core 1.46 cmd::cutout_cmds::tests::remove_background_on_a_layer_smaller_than_the_canvas_masks_the_subject_not_the_layer
test linux photocraft-engine-core 1.66 cmd::distort_cmds::tests::puppet_refuses_pins_that_stretch_the_content_too_far
test linux photocraft-engine-core 1.86 cmd::edit_cmds::tests::tiled_lift_matches_the_whole_area_lift
test linux photocraft-engine-core 13.56 cmd::edit_menu_cmds::tests::content_aware_fill_samples_photoshops_window
test linux photocraft-engine-core 4.41 cmd::edit_menu_cmds::tests::content_aware_fill_takes_the_workspace_edits
test linux photocraft-engine-core 3.17 cmd::edit_menu_cmds::tests::delete_and_fill_selection_removes_the_object_in_one_step
test linux photocraft-engine-core 1.37 cmd::eraser_cmds::transparency_lock_tests::with_a_colour_channel_target_the_preview_matches_the_commit_on_a_locked_layer
test linux photocraft-engine-core 11.13 cmd::file_cmds::export::export_clut_stack_tests::a_huge_canvas_still_bakes_the_stack
test linux photocraft-engine-core 8.05 cmd::file_cmds::place_job_tests::a_cooperative_place_equals_the_inline_place
test linux photocraft-engine-core 1.09 cmd::file_cmds::place_resolution_tests::the_resolution_scale_comes_before_the_fit_to_the_canvas
test linux photocraft-engine-core 2.84 cmd::image_cmds::tests::crop_target_budgets_the_hidden_pixels_it_resamples
test linux photocraft-engine-core 2.24 cmd::image_cmds::tests::crop_to_a_target_size_and_resolution_is_one_step
test linux photocraft-engine-core 3.14 cmd::image_cmds::tests::turned_crop_deleting_pixels_matches_turning_the_whole_canvas
test linux photocraft-engine-core 6.75 cmd::layer_multi_cmds::tile_damage_tests::painting_command_hints_cover_their_changed_tiles
test linux photocraft-engine-core 1.04 cmd::mode_cmds::rotate_canvas_interpolation_pref_tests::not_measured_preferences_keep_todays_bicubic_result
test linux photocraft-engine-core 1.31 cmd::mode_cmds::rotate_canvas_right_angle_tests::arbitrary_right_angles_match_the_dedicated_rotation_commands
test linux photocraft-engine-core 3.70 cmd::mode_cmds::tests::bitmap_custom_pattern_accepts_compact_pattern_past_full_rgba_limit
test linux photocraft-engine-core 3.25 cmd::mode_cmds::tests::bitmap_output_resolution_budgets_the_whole_conversion_not_just_the_resample
test linux photocraft-engine-core 1.61 cmd::mode_cmds::tests::duotone_to_colour_modes_keeps_the_ink_colours
test linux photocraft-engine-core 12.44 cmd::pattern_cmds::tests::defined_patterns_over_4096_squared_paint_or_are_refused
test linux photocraft-engine-core 1.01 cmd::photo_cmds::photomerge_layer_order_tests::blended_composite_does_not_depend_on_the_stacking
test linux photocraft-engine-core 1.15 cmd::photo_cmds::photomerge_layer_order_tests::fill_layer_stays_above_the_sources
test linux photocraft-engine-core 1.53 cmd::photo_cmds::photomerge_layer_order_tests::first_source_is_the_top_layer
test linux photocraft-engine-core 2.01 cmd::photo_cmds::photomerge_name_tests::a_second_panorama_gets_another_number
test linux photocraft-engine-core 1.96 cmd::photo_cmds::photomerge_name_tests::panorama_is_untitled_panorama_1_whatever_else_is_open
test linux photocraft-engine-core 2.81 cmd::photo_cmds::tests::hdr_merge_from_synthetic_exposures
test linux photocraft-engine-core 8.35 cmd::photo_cmds::tests::photomerge_cylindrical_with_fill
test linux photocraft-engine-core 3.72 cmd::photo_cmds::tests::photomerge_open_documents_ignores_the_folder
test linux photocraft-engine-core 2.41 cmd::photo_cmds::tests::photomerge_open_documents_reposition_and_perspective
test linux photocraft-engine-core 4.76 cmd::retouch_cmds::art_history::tests::large_brush_click_is_not_too_large
test linux photocraft-engine-core 2.53 cmd::retouch_cmds::clone_source_layer_tests::clone_healing_absent_source_preserves_nonuniform_destinations
test linux photocraft-engine-core 3.74 cmd::retouch_cmds::clone_source_layer_tests::clone_no_alpha_sources_clip_preview_live_and_commit_at_all_canvas_corners
test linux photocraft-engine-core 84.40 cmd::retouch_cmds::content_aware_move::color_tests::a_brightness_change_shifts_the_middle_only_past_color_five
test linux photocraft-engine-core 42.09 cmd::retouch_cmds::content_aware_move::color_tests::a_flat_patch_matches_the_new_surroundings_at_color_ten
test linux photocraft-engine-core 59.07 cmd::retouch_cmds::content_aware_move::color_tests::color_ten_on_green_leaves_the_middle_and_blends_the_edge
test linux photocraft-engine-core 10.55 cmd::retouch_cmds::content_aware_move::tests::a_coarse_preview_keeps_a_faint_sparse_selection
test linux photocraft-engine-core 7.63 cmd::retouch_cmds::content_aware_move::tests::a_preview_within_the_full_resolution_budget_is_the_plain_solve_bit_for_bit
test linux photocraft-engine-core 14.20 cmd::retouch_cmds::patch::patch_destination_selection_tests::content_aware_keeps_the_selection_and_changes_the_pixels
test linux photocraft-engine-core 2.68 cmd::retouch_cmds::patch_history_names_tests::applying_a_patch_is_one_step_named_patch_selection_in_every_mode
test linux photocraft-engine-core 1.99 cmd::retouch_cmds::remove::remove_new_layer_name_tests::a_taken_name_gives_the_first_free_one
test linux photocraft-engine-core 1.23 cmd::retouch_cmds::remove::remove_new_layer_name_tests::successive_strokes_name_remove_tool_edits_then_1_then_2_each_above_the_active_layer
test linux photocraft-engine-core 1.01 cmd::retouch_cmds::remove_history_name_tests::one_stroke_is_one_step_named_remove_tool_in_every_mode_and_depth
test linux photocraft-engine-core 1.38 cmd::retouch_cmds::tests::content_aware_extend_keeps_the_original
test linux photocraft-engine-core 4.97 cmd::retouch_cmds::tests::content_aware_move_coarse_preview_handles_transform_extend_and_limits
test linux photocraft-engine-core 1.85 cmd::retouch_cmds::tests::content_aware_move_fails_gracefully
test linux photocraft-engine-core 9.65 cmd::retouch_cmds::tests::content_aware_move_moves_the_object_and_fills_its_place_at_all_depths
test linux photocraft-engine-core 4.42 cmd::retouch_cmds::tests::content_aware_move_overlapping_at_the_edge_and_on_other_targets
test linux photocraft-engine-core 7.02 cmd::retouch_cmds::tests::content_aware_move_preview_shows_the_result_without_touching_the_session
test linux photocraft-engine-core 35.99 cmd::retouch_cmds::tests::content_aware_move_previews_large_selections_coarse_then_exact
test linux photocraft-engine-core 5.54 cmd::retouch_cmds::tests::content_aware_move_samples_all_layers_onto_an_empty_layer
test linux photocraft-engine-core 12.56 cmd::retouch_cmds::tests::content_aware_move_structure_and_color_shape_the_result
test linux photocraft-engine-core 9.49 cmd::retouch_cmds::tests::content_aware_move_transform_on_drop_scales_and_rotates_the_content
test linux photocraft-engine-core 12.99 cmd::retouch_cmds::tests::live_dab_batches_match_the_accumulating_renderer
test linux photocraft-engine-core 1.53 cmd::retouch_cmds::tests::live_dab_rejects_invalid_batches_without_changing_the_preview
test linux photocraft-engine-core 8.69 cmd::retouch_cmds::tests::live_dab_strokes_commit_their_pixels_and_they_are_the_commands
test linux photocraft-engine-core 3.71 cmd::retouch_cmds::tests::patch_content_aware_copies_the_dragged_to_content_into_the_selection
test linux photocraft-engine-core 1.37 cmd::retouch_cmds::tests::protect_detail_drags_at_the_default_spacing_widen_the_halo_without_banding
test linux photocraft-engine-core 1.47 cmd::retouch_cmds::tests::remove_a_ring_around_an_object_removes_it_in_one_undo_step
test linux photocraft-engine-core 2.28 cmd::retouch_cmds::tests::sample_all_layers_spot_healing_heals_onto_an_empty_layer
test linux photocraft-engine-core 14.35 cmd::retouch_cmds::tests::spot_healing_keeps_film_grain_through_overlapping_strokes
test linux photocraft-engine-core 4.92 cmd::retouch_cmds::tests::spot_healing_removes_blemish_all_types
test linux photocraft-engine-core 1.26 cmd::retouch_cmds::tests::the_tools_the_reference_application_does_not_wrap_stop_at_the_canvas_edge
test linux photocraft-engine-core 4.24 cmd::selection_cmds::color_range_window_tests::cropped_range_matches_full_canvas_combinations_with_soft_holes_and_clipped_masks
test linux photocraft-engine-core 3.30 cmd::selection_cmds::modify_window::tests::cropped_commands_match_full_canvas_reads_padding_and_writeback
test linux photocraft-engine-core 7.71 cmd::selection_cmds::tests::windowed_tool_feather_matches_full_canvas
test linux photocraft-engine-core 1.93 cmd::slice_cmds::tests::divide_refuses_more_parts_than_one_division_makes
test linux photocraft-engine-core 2.05 cmd::smart_cmds::tests::selection::selected_pixels_become_one_editable_smart_object_in_every_mode_and_depth
test linux photocraft-engine-core 2.52 cmd::smart_cmds::tests::source_flatten::effects_across_block_edges_match
test linux photocraft-engine-core 3.27 cmd::smart_cmds::tests::svg_profile::svg_smart_contents_and_stack_open_many_shapes_as_layers
test linux photocraft-engine-core 3.36 cmd::smart_cmds::tests::svg_profile::svg_warp_frame_uses_bounded_bounds
test linux photocraft-engine-core 1.49 cmd::smartselect_cmds::object_hard_edge_tests::hard_edge_off_on_the_reference_disc
test linux photocraft-engine-core 2.04 cmd::smartselect_cmds::object_hard_edge_tests::hard_edge_on_is_unchanged_on_the_reference_document
test linux photocraft-engine-core 4.11 cmd::smartselect_cmds::tests::refine_edge_accepts_huge_sparse_and_solid_selections
test linux photocraft-engine-core 1.54 cmd::smartselect_cmds::tests::refine_edge_edits_object_and_subject
test linux photocraft-engine-core 1.02 cmd::swatch_cmds::tests::library_limits
test linux photocraft-engine-core 8.27 color_channels::tone::tests::fused_tiles_match_scalar_oracle_at_all_depths_and_modes
test linux photocraft-engine-core 1.76 color_channels::tone_dialog_tests::tone_dialog_normalization_matches_native_execution
test linux photocraft-engine-core 1.60 jobs::tests::content_aware_fill_and_scale_run_as_jobs
test linux photocraft-engine-core 2.82 jobs::tests::content_aware_move_runs_as_a_job
test linux photocraft-engine-core 1.07 jobs::tests::remove_runs_as_a_job
test linux photocraft-engine-core 1.07 layer_style::tests::oversized_satin_and_bevel_sizes_stay_saveable_and_render
test linux photocraft-engine-core 1.20 new_layer::tests::neutral_fills_leave_the_image_unchanged
test linux photocraft-engine-core 39.06 pixels::tests::tiled_adjustment_matches_one_pass_over_the_content
test linux photocraft-engine-core 13.64 pixels::tests::tiled_clear_and_fill_match_one_pass_over_the_area
test linux photocraft-engine-core 3.84 select_mask_edits::tests::thin_edits_across_a_huge_canvas_paint_only_their_tiles
test linux photocraft-engine-core 8.54 tests::file_new_at_the_size_limit_does_not_fill_every_tile
test linux photocraft-engine::global_state 1.01 artboard_export_scratch::artboard_exports_refuse_unreadable_scratch_tiles
test linux photocraft-engine::global_state 1.37 memory_gate::a_smart_object_edit_under_low_memory_keeps_its_appearance
test linux photocraft-engine::global_state 1.92 memory_gate::place_that_does_not_fit_fails_and_leaves_the_document_alone
@@ -798,7 +798,7 @@ bin windows photocraft-color 37 5.25
bin windows photocraft-compose 536 125.58
bin windows photocraft-compose::it 9 0.26
bin windows photocraft-doc 85 26.11
bin windows photocraft-engine 4430 1637.30
bin windows photocraft-engine-core 4430 1637.30
bin windows photocraft-engine::global_state 26 31.36
bin windows photocraft-engine::it 745 676.05
bin windows photocraft-engine::panic_hunt 2 26.00
@@ -1013,167 +1013,167 @@ test windows photocraft-compose 2.17 tests::renders_with_maps_clipped_over_the_b
test windows photocraft-compose 3.11 tests::shapeless_effects_render_the_same_in_bands_and_parts
test windows photocraft-compose 3.04 viewport::tests::reduced_pages_match_averaging_every_composited_pixel
test windows photocraft-doc 3.36 slices::tests::nested_slices_resolve_in_bounded_work
test windows photocraft-engine 1.23 adjust_params::tests::destructive_commands_apply_their_params_at_every_depth
test windows photocraft-engine 1.03 canvas_geom::tests::turns_at_every_depth_and_mode
test windows photocraft-engine 1.30 cmd::actions_cmds::history::tests::generic_preference_updates_cannot_change_a_paused_history_policy
test windows photocraft-engine 1.22 cmd::actions_cmds::history::tests::history_policy_stays_fixed_until_all_paused_continuations_are_released
test windows photocraft-engine 1.50 cmd::actions_cmds::tests::playback_stops_when_a_nested_batch_cannot_write_its_error_log
test windows photocraft-engine 1.39 cmd::align_cmds::tests::auto_align_keeps_a_locked_layer_as_the_reference
test windows photocraft-engine 1.24 cmd::align_cmds::tests::auto_align_moves_the_background_as_a_normal_layer
test windows photocraft-engine 10.49 cmd::align_cmds::tests::auto_align_registers_a_smooth_bracket_by_intensity
test windows photocraft-engine 3.92 cmd::align_cmds::tests::auto_align_rejects_unrelated_layers_instead_of_guessing_a_pose
test windows photocraft-engine 1.03 cmd::analysis_cmds::tests::place_scale_marker_on_a_short_document_errors_without_panicking
test windows photocraft-engine 1.07 cmd::artboard_cmds::export_options_tests::include_icc_profile_reaches_the_file
test windows photocraft-engine 1.50 cmd::artboard_cmds::include_name_tests::a_name_taller_than_the_border_never_draws_over_the_board
test windows photocraft-engine 1.76 cmd::artboard_cmds::include_name_tests::bad_name_options_never_panic
test windows photocraft-engine 2.33 cmd::atn_cmds::render_tests::render_actions_match_direct_filters_and_undo
test windows photocraft-engine 2.76 cmd::atn_cmds::stylize_tests::imported_group_d_playback_matches_direct_commands_across_modes_and_depths
test windows photocraft-engine 1.15 cmd::atn_cmds::stylize_tests::trace_levels_clamp_on_import_and_play_at_the_boundary
test windows photocraft-engine 1.61 cmd::automate_cmds::tests::droplet_scoped_variants_keep_the_existing_action_limit
test windows photocraft-engine 1.43 cmd::automate_cmds::tests::droplets_carry_the_actions_their_play_steps_call
test windows photocraft-engine 1.59 cmd::brush_cmds::mixer_live_tests::mixer_command_outgrows_the_preview_tile_budget_without_losing_the_stroke
test windows photocraft-engine 8.47 cmd::brush_cmds::mixer_live_tests::mixer_command_paints_strokes_beyond_the_preview_sample_and_dab_budgets
test windows photocraft-engine 3.60 cmd::brush_cmds::mixer_live_tests::mixer_large_brushes_replay_after_the_preview_budget
test windows photocraft-engine 2.60 cmd::channel_cmds::apply_image_locked_layer_tests::a_locked_layer_gets_the_preserve_transparency_result
test windows photocraft-engine 1.60 cmd::cutout_cmds::tests::remove_background_masks_the_subject_at_every_depth_and_undoes
test windows photocraft-engine 1.67 cmd::cutout_cmds::tests::remove_background_on_a_layer_smaller_than_the_canvas_masks_the_subject_not_the_layer
test windows photocraft-engine 1.95 cmd::distort_cmds::tests::puppet_refuses_pins_that_stretch_the_content_too_far
test windows photocraft-engine 1.96 cmd::document_preset_cmds::tests::every_field_survives_save_reload_and_file_new
test windows photocraft-engine 1.23 cmd::document_preset_cmds::tests::old_preferences_and_malformed_presets_keep_unrelated_settings
test windows photocraft-engine 1.18 cmd::document_preset_cmds::tests::the_color_profile_survives_save_reload_and_file_new
test windows photocraft-engine 3.58 cmd::edit_cmds::tests::tiled_lift_matches_the_whole_area_lift
test windows photocraft-engine 1.71 cmd::edit_menu_cmds::caf_new_layer_name_tests::an_existing_copy_gives_the_next_copy_name_like_the_duplicate_output
test windows photocraft-engine 1.01 cmd::edit_menu_cmds::find_replace_order_tests::find_next_from_t1_forward_visits_upward_and_stops_at_end
test windows photocraft-engine 1.00 cmd::edit_menu_cmds::find_replace_order_tests::find_next_from_t5_backward_reverses_only_in_layer_matches
test windows photocraft-engine 1.06 cmd::edit_menu_cmds::find_replace_order_tests::find_next_from_t5_forward_wraps_and_stops_before_t5
test windows photocraft-engine 1.10 cmd::edit_menu_cmds::find_replace_order_tests::find_next_from_t7_backward_goes_upward_to_t8_first
test windows photocraft-engine 1.06 cmd::edit_menu_cmds::find_replace_order_tests::find_next_from_top_pixel_layer_wraps_to_bottom_type_layer
test windows photocraft-engine 1.17 cmd::edit_menu_cmds::find_replace_order_tests::find_next_single_layer_and_change_all_preserved
test windows photocraft-engine 1.17 cmd::edit_menu_cmds::tests::content_aware_fill_outputs_and_sampling
test windows photocraft-engine 12.09 cmd::edit_menu_cmds::tests::content_aware_fill_samples_photoshops_window
test windows photocraft-engine 4.11 cmd::edit_menu_cmds::tests::content_aware_fill_takes_the_workspace_edits
test windows photocraft-engine 3.98 cmd::edit_menu_cmds::tests::delete_and_fill_selection_removes_the_object_in_one_step
test windows photocraft-engine 1.51 cmd::eraser_cmds::channel_target_tests::partial_sets_that_were_not_measured_keep_erasing
test windows photocraft-engine 2.50 cmd::eraser_cmds::transparency_lock_tests::with_a_colour_channel_target_the_preview_matches_the_commit_on_a_locked_layer
test windows photocraft-engine 1.22 cmd::file_cmds::batch_run::action_history_tests::batch_and_droplet_document_history_boundaries
test windows photocraft-engine 16.20 cmd::file_cmds::export::export_clut_stack_tests::a_huge_canvas_still_bakes_the_stack
test windows photocraft-engine 1.17 cmd::file_cmds::export::export_clut_stack_tests::small_and_large_canvases_never_panic
test windows photocraft-engine 1.13 cmd::file_cmds::export::export_clut_stack_tests::the_work_limit_is_known_before_any_pass_is_built
test windows photocraft-engine 1.68 cmd::file_cmds::export_clut_cube_header_tests::eight_and_sixteen_bit_values_sit_on_1_32768_steps
test windows photocraft-engine 1.54 cmd::file_cmds::place_job_tests::a_banded_flatten_equals_flattened_checked
test windows photocraft-engine 11.36 cmd::file_cmds::place_job_tests::a_cooperative_place_equals_the_inline_place
test windows photocraft-engine 1.36 cmd::file_cmds::place_resolution_tests::the_resolution_scale_comes_before_the_fit_to_the_canvas
test windows photocraft-engine 1.64 cmd::file_cmds::processing::image_processor_tests::image_processor_untitled_names_use_the_shared_filename_sanitizer
test windows photocraft-engine 1.44 cmd::file_cmds::tests::a_direct_batch_in_a_script_stops_it_when_cancelled_or_its_log_fails
test windows photocraft-engine 1.36 cmd::file_cmds::tests::batch_open_source_save_step_leaves_an_unwritten_document_changed
test windows photocraft-engine 1.37 cmd::file_cmds::tests::batch_reports_file_failures_even_if_error_log_cannot_be_written
test windows photocraft-engine 1.73 cmd::gallery_cmds::tests::every_gallery_filter_runs_at_every_depth_and_undoes
test windows photocraft-engine 3.62 cmd::image_cmds::tests::crop_target_budgets_the_hidden_pixels_it_resamples
test windows photocraft-engine 2.35 cmd::image_cmds::tests::crop_to_a_target_size_and_resolution_is_one_step
test windows photocraft-engine 1.21 cmd::image_cmds::tests::delete_cropped_pixels_keeps_type_and_smart_objects_whole
test windows photocraft-engine 4.33 cmd::image_cmds::tests::turned_crop_deleting_pixels_matches_turning_the_whole_canvas
test windows photocraft-engine 9.56 cmd::layer_multi_cmds::tile_damage_tests::painting_command_hints_cover_their_changed_tiles
test windows photocraft-engine 1.42 cmd::migrate_cmds::tests::each_migrated_preset_kind_marks_preferences_dirty_and_survives_reload
test windows photocraft-engine 1.43 cmd::mode_cmds::rotate_canvas_interpolation_pref_tests::not_measured_preferences_keep_todays_bicubic_result
test windows photocraft-engine 1.34 cmd::mode_cmds::rotate_canvas_interpolation_pref_tests::rotated_crop_and_straighten_ignore_the_interpolation_preference
test windows photocraft-engine 1.84 cmd::mode_cmds::rotate_canvas_right_angle_tests::arbitrary_right_angles_match_the_dedicated_rotation_commands
test windows photocraft-engine 4.37 cmd::mode_cmds::tests::bitmap_custom_pattern_accepts_compact_pattern_past_full_rgba_limit
test windows photocraft-engine 4.03 cmd::mode_cmds::tests::bitmap_output_resolution_budgets_the_whole_conversion_not_just_the_resample
test windows photocraft-engine 2.54 cmd::mode_cmds::tests::duotone_to_colour_modes_keeps_the_ink_colours
test windows photocraft-engine 24.30 cmd::pattern_cmds::tests::defined_patterns_over_4096_squared_paint_or_are_refused
test windows photocraft-engine 1.07 cmd::pattern_fill_cmds::tests::create_preview_and_commit_honor_default_masks_option
test windows photocraft-engine 1.16 cmd::perspective_crop_cmds::perspective_crop_size_tests::one_side_alone_keeps_the_mean_edge_proportions
test windows photocraft-engine 1.44 cmd::perspective_crop_cmds::perspective_crop_size_tests::width_and_height_are_still_exact
test windows photocraft-engine 1.41 cmd::photo_cmds::photomerge_layer_order_tests::blended_composite_does_not_depend_on_the_stacking
test windows photocraft-engine 1.45 cmd::photo_cmds::photomerge_layer_order_tests::fill_layer_stays_above_the_sources
test windows photocraft-engine 1.82 cmd::photo_cmds::photomerge_layer_order_tests::first_source_is_the_top_layer
test windows photocraft-engine 2.88 cmd::photo_cmds::photomerge_name_tests::a_second_panorama_gets_another_number
test windows photocraft-engine 2.87 cmd::photo_cmds::photomerge_name_tests::panorama_is_untitled_panorama_1_whatever_else_is_open
test windows photocraft-engine 3.97 cmd::photo_cmds::tests::hdr_merge_from_synthetic_exposures
test windows photocraft-engine 8.87 cmd::photo_cmds::tests::photomerge_cylindrical_with_fill
test windows photocraft-engine 5.54 cmd::photo_cmds::tests::photomerge_open_documents_ignores_the_folder
test windows photocraft-engine 3.38 cmd::photo_cmds::tests::photomerge_open_documents_reposition_and_perspective
test windows photocraft-engine 1.42 cmd::print_cmds::tests::a_native_print_drops_a_printable_area_the_driver_did_not_give
test windows photocraft-engine 5.65 cmd::retouch_cmds::art_history::tests::large_brush_click_is_not_too_large
test windows photocraft-engine 2.99 cmd::retouch_cmds::clone_source_layer_tests::clone_healing_absent_source_preserves_nonuniform_destinations
test windows photocraft-engine 5.69 cmd::retouch_cmds::clone_source_layer_tests::clone_no_alpha_sources_clip_preview_live_and_commit_at_all_canvas_corners
test windows photocraft-engine 111.35 cmd::retouch_cmds::content_aware_move::color_tests::a_brightness_change_shifts_the_middle_only_past_color_five
test windows photocraft-engine 48.52 cmd::retouch_cmds::content_aware_move::color_tests::a_flat_patch_matches_the_new_surroundings_at_color_ten
test windows photocraft-engine 74.13 cmd::retouch_cmds::content_aware_move::color_tests::color_ten_on_green_leaves_the_middle_and_blends_the_edge
test windows photocraft-engine 15.31 cmd::retouch_cmds::content_aware_move::tests::a_coarse_preview_keeps_a_faint_sparse_selection
test windows photocraft-engine 13.85 cmd::retouch_cmds::content_aware_move::tests::a_preview_within_the_full_resolution_budget_is_the_plain_solve_bit_for_bit
test windows photocraft-engine 18.82 cmd::retouch_cmds::patch::patch_destination_selection_tests::content_aware_keeps_the_selection_and_changes_the_pixels
test windows photocraft-engine 1.49 cmd::retouch_cmds::patch::patch_destination_selection_tests::destination_selection_stays_when_it_is_not_a_plain_rectangle
test windows photocraft-engine 2.28 cmd::retouch_cmds::patch_history_names_tests::applying_a_patch_is_one_step_named_patch_selection_in_every_mode
test windows photocraft-engine 2.50 cmd::retouch_cmds::remove::remove_new_layer_name_tests::a_taken_name_gives_the_first_free_one
test windows photocraft-engine 1.49 cmd::retouch_cmds::remove::remove_new_layer_name_tests::successive_strokes_name_remove_tool_edits_then_1_then_2_each_above_the_active_layer
test windows photocraft-engine 1.04 cmd::retouch_cmds::remove::remove_new_layer_name_tests::two_strokes_without_sample_all_layers_name_remove_tool_edits_then_1
test windows photocraft-engine 1.40 cmd::retouch_cmds::remove::remove_new_layer_name_tests::undo_frees_the_name_for_the_next_stroke
test windows photocraft-engine 3.01 cmd::retouch_cmds::remove_history_name_tests::one_stroke_is_one_step_named_remove_tool_in_every_mode_and_depth
test windows photocraft-engine 1.29 cmd::retouch_cmds::remove_history_name_tests::sample_all_layers_and_create_new_layer_are_one_step_named_remove_tool
test windows photocraft-engine 1.50 cmd::retouch_cmds::tests::content_aware_extend_keeps_the_original
test windows photocraft-engine 4.54 cmd::retouch_cmds::tests::content_aware_move_coarse_preview_handles_transform_extend_and_limits
test windows photocraft-engine 2.63 cmd::retouch_cmds::tests::content_aware_move_fails_gracefully
test windows photocraft-engine 9.47 cmd::retouch_cmds::tests::content_aware_move_moves_the_object_and_fills_its_place_at_all_depths
test windows photocraft-engine 6.30 cmd::retouch_cmds::tests::content_aware_move_overlapping_at_the_edge_and_on_other_targets
test windows photocraft-engine 5.56 cmd::retouch_cmds::tests::content_aware_move_preview_shows_the_result_without_touching_the_session
test windows photocraft-engine 41.74 cmd::retouch_cmds::tests::content_aware_move_previews_large_selections_coarse_then_exact
test windows photocraft-engine 8.41 cmd::retouch_cmds::tests::content_aware_move_samples_all_layers_onto_an_empty_layer
test windows photocraft-engine 18.56 cmd::retouch_cmds::tests::content_aware_move_structure_and_color_shape_the_result
test windows photocraft-engine 14.38 cmd::retouch_cmds::tests::content_aware_move_transform_on_drop_scales_and_rotates_the_content
test windows photocraft-engine 1.28 cmd::retouch_cmds::tests::erase_to_history_paints_white_past_a_shapes_path_in_every_colour_mode
test windows photocraft-engine 19.22 cmd::retouch_cmds::tests::live_dab_batches_match_the_accumulating_renderer
test windows photocraft-engine 2.06 cmd::retouch_cmds::tests::live_dab_offers_are_refused_or_dropped_when_they_dont_match
test windows photocraft-engine 1.82 cmd::retouch_cmds::tests::live_dab_rejects_invalid_batches_without_changing_the_preview
test windows photocraft-engine 16.36 cmd::retouch_cmds::tests::live_dab_strokes_commit_their_pixels_and_they_are_the_commands
test windows photocraft-engine 4.49 cmd::retouch_cmds::tests::patch_content_aware_copies_the_dragged_to_content_into_the_selection
test windows photocraft-engine 2.42 cmd::retouch_cmds::tests::protect_detail_drags_at_the_default_spacing_widen_the_halo_without_banding
test windows photocraft-engine 1.86 cmd::retouch_cmds::tests::remove_a_ring_around_an_object_removes_it_in_one_undo_step
test windows photocraft-engine 1.15 cmd::retouch_cmds::tests::remove_open_strokes_and_the_selection_limit_what_changes
test windows photocraft-engine 3.18 cmd::retouch_cmds::tests::sample_all_layers_spot_healing_heals_onto_an_empty_layer
test windows photocraft-engine 14.60 cmd::retouch_cmds::tests::spot_healing_keeps_film_grain_through_overlapping_strokes
test windows photocraft-engine 4.09 cmd::retouch_cmds::tests::spot_healing_removes_blemish_all_types
test windows photocraft-engine 2.03 cmd::retouch_cmds::tests::the_tools_the_reference_application_does_not_wrap_stop_at_the_canvas_edge
test windows photocraft-engine 6.95 cmd::selection_cmds::color_range_window_tests::cropped_range_matches_full_canvas_combinations_with_soft_holes_and_clipped_masks
test windows photocraft-engine 1.08 cmd::selection_cmds::modify_window::tests::cropped_blurs_preserve_soft_masks_at_every_depth
test windows photocraft-engine 4.30 cmd::selection_cmds::modify_window::tests::cropped_commands_match_full_canvas_reads_padding_and_writeback
test windows photocraft-engine 8.24 cmd::selection_cmds::tests::windowed_tool_feather_matches_full_canvas
test windows photocraft-engine 2.73 cmd::slice_cmds::tests::divide_refuses_more_parts_than_one_division_makes
test windows photocraft-engine 2.46 cmd::slice_cmds::tests::slices_round_trip_through_psd_and_pcraft
test windows photocraft-engine 1.89 cmd::smart_cmds::tests::selection::selected_pixels_become_one_editable_smart_object_in_every_mode_and_depth
test windows photocraft-engine 2.39 cmd::smart_cmds::tests::source_flatten::effects_across_block_edges_match
test windows photocraft-engine 3.36 cmd::smart_cmds::tests::svg_profile::svg_smart_contents_and_stack_open_many_shapes_as_layers
test windows photocraft-engine 3.49 cmd::smart_cmds::tests::svg_profile::svg_warp_frame_uses_bounded_bounds
test windows photocraft-engine 1.69 cmd::smart_svg_cmds::tests::embedded_pdf_ai_and_eps_update_shared_instances_without_reading_linked_paths
test windows photocraft-engine 2.61 cmd::smart_svg_cmds::tests::original_vector_formats_save_atomically_and_survive_undo_and_persistence
test windows photocraft-engine 1.23 cmd::smart_svg_cmds::tests::valid_updates_repeat_at_all_depths_and_roundtrip_original_svg
test windows photocraft-engine 1.02 cmd::smartselect_cmds::object_hard_edge_tests::a_wrong_type_hard_edge_is_the_default
test windows photocraft-engine 1.42 cmd::smartselect_cmds::object_hard_edge_tests::hard_edge_off_matches_the_reference_rectangle
test windows photocraft-engine 2.63 cmd::smartselect_cmds::object_hard_edge_tests::hard_edge_off_on_the_reference_disc
test windows photocraft-engine 2.67 cmd::smartselect_cmds::object_hard_edge_tests::hard_edge_on_is_unchanged_on_the_reference_document
test windows photocraft-engine 1.04 cmd::smartselect_cmds::quick_mode_refusal_tests::other_modes_keep_selecting
test windows photocraft-engine 1.08 cmd::smartselect_cmds::tests::object_selection_point_selects_the_object_under_it
test windows photocraft-engine 7.25 cmd::smartselect_cmds::tests::refine_edge_accepts_huge_sparse_and_solid_selections
test windows photocraft-engine 2.63 cmd::smartselect_cmds::tests::refine_edge_edits_object_and_subject
test windows photocraft-engine 1.54 cmd::smartselect_cmds::tests::select_subject_repeat_reuses_the_mask_until_pixels_change
test windows photocraft-engine 1.29 cmd::type_area_cmds::tests::a_resolution_change_keeps_area_type_wrapping_where_it_was
test windows photocraft-engine 2.68 cmd::type_area_cmds::tests::area_type_saves_to_psd_as_paragraph_text_with_a_warning
test windows photocraft-engine 1.02 cmd::type_caret_cmds::tests::caret_midpoint_round_trips_for_point_paragraph_transformed_and_vertical
test windows photocraft-engine 1.10 cmd::type_cmds::tests::a_duplicated_type_layer_follows_its_new_text
test windows photocraft-engine 1.01 cmd::type_spell_cmds::enabled_tests::enabled_with_type_layers_as_before
test windows photocraft-engine 1.19 cmd::type_spell_cmds::order_tests::a_null_unknown_or_pixel_from_checks_top_to_bottom
test windows photocraft-engine 11.68 color_channels::tone::tests::fused_tiles_match_scalar_oracle_at_all_depths_and_modes
test windows photocraft-engine 3.22 color_channels::tone_dialog_tests::tone_dialog_normalization_matches_native_execution
test windows photocraft-engine 2.15 jobs::tests::content_aware_fill_and_scale_run_as_jobs
test windows photocraft-engine 3.81 jobs::tests::content_aware_move_runs_as_a_job
test windows photocraft-engine 1.57 jobs::tests::remove_runs_as_a_job
test windows photocraft-engine 1.32 layer_style::tests::oversized_satin_and_bevel_sizes_stay_saveable_and_render
test windows photocraft-engine 27.10 pixels::tests::tiled_adjustment_matches_one_pass_over_the_content
test windows photocraft-engine 11.11 pixels::tests::tiled_clear_and_fill_match_one_pass_over_the_area
test windows photocraft-engine 2.17 preset_store::tests::startup_with_many_groups_loads_them_all
test windows photocraft-engine 2.14 select_mask_edits::tests::invert_on_a_huge_canvas_and_runs_of_inverts
test windows photocraft-engine 6.11 select_mask_edits::tests::thin_edits_across_a_huge_canvas_paint_only_their_tiles
test windows photocraft-engine 5.18 tests::file_new_at_the_size_limit_does_not_fill_every_tile
test windows photocraft-engine-core 1.23 adjust_params::tests::destructive_commands_apply_their_params_at_every_depth
test windows photocraft-engine-core 1.03 canvas_geom::tests::turns_at_every_depth_and_mode
test windows photocraft-engine-core 1.30 cmd::actions_cmds::history::tests::generic_preference_updates_cannot_change_a_paused_history_policy
test windows photocraft-engine-core 1.22 cmd::actions_cmds::history::tests::history_policy_stays_fixed_until_all_paused_continuations_are_released
test windows photocraft-engine-core 1.50 cmd::actions_cmds::tests::playback_stops_when_a_nested_batch_cannot_write_its_error_log
test windows photocraft-engine-core 1.39 cmd::align_cmds::tests::auto_align_keeps_a_locked_layer_as_the_reference
test windows photocraft-engine-core 1.24 cmd::align_cmds::tests::auto_align_moves_the_background_as_a_normal_layer
test windows photocraft-engine-core 10.49 cmd::align_cmds::tests::auto_align_registers_a_smooth_bracket_by_intensity
test windows photocraft-engine-core 3.92 cmd::align_cmds::tests::auto_align_rejects_unrelated_layers_instead_of_guessing_a_pose
test windows photocraft-engine-core 1.03 cmd::analysis_cmds::tests::place_scale_marker_on_a_short_document_errors_without_panicking
test windows photocraft-engine-core 1.07 cmd::artboard_cmds::export_options_tests::include_icc_profile_reaches_the_file
test windows photocraft-engine-core 1.50 cmd::artboard_cmds::include_name_tests::a_name_taller_than_the_border_never_draws_over_the_board
test windows photocraft-engine-core 1.76 cmd::artboard_cmds::include_name_tests::bad_name_options_never_panic
test windows photocraft-engine-core 2.33 cmd::atn_cmds::render_tests::render_actions_match_direct_filters_and_undo
test windows photocraft-engine-core 2.76 cmd::atn_cmds::stylize_tests::imported_group_d_playback_matches_direct_commands_across_modes_and_depths
test windows photocraft-engine-core 1.15 cmd::atn_cmds::stylize_tests::trace_levels_clamp_on_import_and_play_at_the_boundary
test windows photocraft-engine-core 1.61 cmd::automate_cmds::tests::droplet_scoped_variants_keep_the_existing_action_limit
test windows photocraft-engine-core 1.43 cmd::automate_cmds::tests::droplets_carry_the_actions_their_play_steps_call
test windows photocraft-engine-core 1.59 cmd::brush_cmds::mixer_live_tests::mixer_command_outgrows_the_preview_tile_budget_without_losing_the_stroke
test windows photocraft-engine-core 8.47 cmd::brush_cmds::mixer_live_tests::mixer_command_paints_strokes_beyond_the_preview_sample_and_dab_budgets
test windows photocraft-engine-core 3.60 cmd::brush_cmds::mixer_live_tests::mixer_large_brushes_replay_after_the_preview_budget
test windows photocraft-engine-core 2.60 cmd::channel_cmds::apply_image_locked_layer_tests::a_locked_layer_gets_the_preserve_transparency_result
test windows photocraft-engine-core 1.60 cmd::cutout_cmds::tests::remove_background_masks_the_subject_at_every_depth_and_undoes
test windows photocraft-engine-core 1.67 cmd::cutout_cmds::tests::remove_background_on_a_layer_smaller_than_the_canvas_masks_the_subject_not_the_layer
test windows photocraft-engine-core 1.95 cmd::distort_cmds::tests::puppet_refuses_pins_that_stretch_the_content_too_far
test windows photocraft-engine-core 1.96 cmd::document_preset_cmds::tests::every_field_survives_save_reload_and_file_new
test windows photocraft-engine-core 1.23 cmd::document_preset_cmds::tests::old_preferences_and_malformed_presets_keep_unrelated_settings
test windows photocraft-engine-core 1.18 cmd::document_preset_cmds::tests::the_color_profile_survives_save_reload_and_file_new
test windows photocraft-engine-core 3.58 cmd::edit_cmds::tests::tiled_lift_matches_the_whole_area_lift
test windows photocraft-engine-core 1.71 cmd::edit_menu_cmds::caf_new_layer_name_tests::an_existing_copy_gives_the_next_copy_name_like_the_duplicate_output
test windows photocraft-engine-core 1.01 cmd::edit_menu_cmds::find_replace_order_tests::find_next_from_t1_forward_visits_upward_and_stops_at_end
test windows photocraft-engine-core 1.00 cmd::edit_menu_cmds::find_replace_order_tests::find_next_from_t5_backward_reverses_only_in_layer_matches
test windows photocraft-engine-core 1.06 cmd::edit_menu_cmds::find_replace_order_tests::find_next_from_t5_forward_wraps_and_stops_before_t5
test windows photocraft-engine-core 1.10 cmd::edit_menu_cmds::find_replace_order_tests::find_next_from_t7_backward_goes_upward_to_t8_first
test windows photocraft-engine-core 1.06 cmd::edit_menu_cmds::find_replace_order_tests::find_next_from_top_pixel_layer_wraps_to_bottom_type_layer
test windows photocraft-engine-core 1.17 cmd::edit_menu_cmds::find_replace_order_tests::find_next_single_layer_and_change_all_preserved
test windows photocraft-engine-core 1.17 cmd::edit_menu_cmds::tests::content_aware_fill_outputs_and_sampling
test windows photocraft-engine-core 12.09 cmd::edit_menu_cmds::tests::content_aware_fill_samples_photoshops_window
test windows photocraft-engine-core 4.11 cmd::edit_menu_cmds::tests::content_aware_fill_takes_the_workspace_edits
test windows photocraft-engine-core 3.98 cmd::edit_menu_cmds::tests::delete_and_fill_selection_removes_the_object_in_one_step
test windows photocraft-engine-core 1.51 cmd::eraser_cmds::channel_target_tests::partial_sets_that_were_not_measured_keep_erasing
test windows photocraft-engine-core 2.50 cmd::eraser_cmds::transparency_lock_tests::with_a_colour_channel_target_the_preview_matches_the_commit_on_a_locked_layer
test windows photocraft-engine-core 1.22 cmd::file_cmds::batch_run::action_history_tests::batch_and_droplet_document_history_boundaries
test windows photocraft-engine-core 16.20 cmd::file_cmds::export::export_clut_stack_tests::a_huge_canvas_still_bakes_the_stack
test windows photocraft-engine-core 1.17 cmd::file_cmds::export::export_clut_stack_tests::small_and_large_canvases_never_panic
test windows photocraft-engine-core 1.13 cmd::file_cmds::export::export_clut_stack_tests::the_work_limit_is_known_before_any_pass_is_built
test windows photocraft-engine-core 1.68 cmd::file_cmds::export_clut_cube_header_tests::eight_and_sixteen_bit_values_sit_on_1_32768_steps
test windows photocraft-engine-core 1.54 cmd::file_cmds::place_job_tests::a_banded_flatten_equals_flattened_checked
test windows photocraft-engine-core 11.36 cmd::file_cmds::place_job_tests::a_cooperative_place_equals_the_inline_place
test windows photocraft-engine-core 1.36 cmd::file_cmds::place_resolution_tests::the_resolution_scale_comes_before_the_fit_to_the_canvas
test windows photocraft-engine-core 1.64 cmd::file_cmds::processing::image_processor_tests::image_processor_untitled_names_use_the_shared_filename_sanitizer
test windows photocraft-engine-core 1.44 cmd::file_cmds::tests::a_direct_batch_in_a_script_stops_it_when_cancelled_or_its_log_fails
test windows photocraft-engine-core 1.36 cmd::file_cmds::tests::batch_open_source_save_step_leaves_an_unwritten_document_changed
test windows photocraft-engine-core 1.37 cmd::file_cmds::tests::batch_reports_file_failures_even_if_error_log_cannot_be_written
test windows photocraft-engine-core 1.73 cmd::gallery_cmds::tests::every_gallery_filter_runs_at_every_depth_and_undoes
test windows photocraft-engine-core 3.62 cmd::image_cmds::tests::crop_target_budgets_the_hidden_pixels_it_resamples
test windows photocraft-engine-core 2.35 cmd::image_cmds::tests::crop_to_a_target_size_and_resolution_is_one_step
test windows photocraft-engine-core 1.21 cmd::image_cmds::tests::delete_cropped_pixels_keeps_type_and_smart_objects_whole
test windows photocraft-engine-core 4.33 cmd::image_cmds::tests::turned_crop_deleting_pixels_matches_turning_the_whole_canvas
test windows photocraft-engine-core 9.56 cmd::layer_multi_cmds::tile_damage_tests::painting_command_hints_cover_their_changed_tiles
test windows photocraft-engine-core 1.42 cmd::migrate_cmds::tests::each_migrated_preset_kind_marks_preferences_dirty_and_survives_reload
test windows photocraft-engine-core 1.43 cmd::mode_cmds::rotate_canvas_interpolation_pref_tests::not_measured_preferences_keep_todays_bicubic_result
test windows photocraft-engine-core 1.34 cmd::mode_cmds::rotate_canvas_interpolation_pref_tests::rotated_crop_and_straighten_ignore_the_interpolation_preference
test windows photocraft-engine-core 1.84 cmd::mode_cmds::rotate_canvas_right_angle_tests::arbitrary_right_angles_match_the_dedicated_rotation_commands
test windows photocraft-engine-core 4.37 cmd::mode_cmds::tests::bitmap_custom_pattern_accepts_compact_pattern_past_full_rgba_limit
test windows photocraft-engine-core 4.03 cmd::mode_cmds::tests::bitmap_output_resolution_budgets_the_whole_conversion_not_just_the_resample
test windows photocraft-engine-core 2.54 cmd::mode_cmds::tests::duotone_to_colour_modes_keeps_the_ink_colours
test windows photocraft-engine-core 24.30 cmd::pattern_cmds::tests::defined_patterns_over_4096_squared_paint_or_are_refused
test windows photocraft-engine-core 1.07 cmd::pattern_fill_cmds::tests::create_preview_and_commit_honor_default_masks_option
test windows photocraft-engine-core 1.16 cmd::perspective_crop_cmds::perspective_crop_size_tests::one_side_alone_keeps_the_mean_edge_proportions
test windows photocraft-engine-core 1.44 cmd::perspective_crop_cmds::perspective_crop_size_tests::width_and_height_are_still_exact
test windows photocraft-engine-core 1.41 cmd::photo_cmds::photomerge_layer_order_tests::blended_composite_does_not_depend_on_the_stacking
test windows photocraft-engine-core 1.45 cmd::photo_cmds::photomerge_layer_order_tests::fill_layer_stays_above_the_sources
test windows photocraft-engine-core 1.82 cmd::photo_cmds::photomerge_layer_order_tests::first_source_is_the_top_layer
test windows photocraft-engine-core 2.88 cmd::photo_cmds::photomerge_name_tests::a_second_panorama_gets_another_number
test windows photocraft-engine-core 2.87 cmd::photo_cmds::photomerge_name_tests::panorama_is_untitled_panorama_1_whatever_else_is_open
test windows photocraft-engine-core 3.97 cmd::photo_cmds::tests::hdr_merge_from_synthetic_exposures
test windows photocraft-engine-core 8.87 cmd::photo_cmds::tests::photomerge_cylindrical_with_fill
test windows photocraft-engine-core 5.54 cmd::photo_cmds::tests::photomerge_open_documents_ignores_the_folder
test windows photocraft-engine-core 3.38 cmd::photo_cmds::tests::photomerge_open_documents_reposition_and_perspective
test windows photocraft-engine-core 1.42 cmd::print_cmds::tests::a_native_print_drops_a_printable_area_the_driver_did_not_give
test windows photocraft-engine-core 5.65 cmd::retouch_cmds::art_history::tests::large_brush_click_is_not_too_large
test windows photocraft-engine-core 2.99 cmd::retouch_cmds::clone_source_layer_tests::clone_healing_absent_source_preserves_nonuniform_destinations
test windows photocraft-engine-core 5.69 cmd::retouch_cmds::clone_source_layer_tests::clone_no_alpha_sources_clip_preview_live_and_commit_at_all_canvas_corners
test windows photocraft-engine-core 111.35 cmd::retouch_cmds::content_aware_move::color_tests::a_brightness_change_shifts_the_middle_only_past_color_five
test windows photocraft-engine-core 48.52 cmd::retouch_cmds::content_aware_move::color_tests::a_flat_patch_matches_the_new_surroundings_at_color_ten
test windows photocraft-engine-core 74.13 cmd::retouch_cmds::content_aware_move::color_tests::color_ten_on_green_leaves_the_middle_and_blends_the_edge
test windows photocraft-engine-core 15.31 cmd::retouch_cmds::content_aware_move::tests::a_coarse_preview_keeps_a_faint_sparse_selection
test windows photocraft-engine-core 13.85 cmd::retouch_cmds::content_aware_move::tests::a_preview_within_the_full_resolution_budget_is_the_plain_solve_bit_for_bit
test windows photocraft-engine-core 18.82 cmd::retouch_cmds::patch::patch_destination_selection_tests::content_aware_keeps_the_selection_and_changes_the_pixels
test windows photocraft-engine-core 1.49 cmd::retouch_cmds::patch::patch_destination_selection_tests::destination_selection_stays_when_it_is_not_a_plain_rectangle
test windows photocraft-engine-core 2.28 cmd::retouch_cmds::patch_history_names_tests::applying_a_patch_is_one_step_named_patch_selection_in_every_mode
test windows photocraft-engine-core 2.50 cmd::retouch_cmds::remove::remove_new_layer_name_tests::a_taken_name_gives_the_first_free_one
test windows photocraft-engine-core 1.49 cmd::retouch_cmds::remove::remove_new_layer_name_tests::successive_strokes_name_remove_tool_edits_then_1_then_2_each_above_the_active_layer
test windows photocraft-engine-core 1.04 cmd::retouch_cmds::remove::remove_new_layer_name_tests::two_strokes_without_sample_all_layers_name_remove_tool_edits_then_1
test windows photocraft-engine-core 1.40 cmd::retouch_cmds::remove::remove_new_layer_name_tests::undo_frees_the_name_for_the_next_stroke
test windows photocraft-engine-core 3.01 cmd::retouch_cmds::remove_history_name_tests::one_stroke_is_one_step_named_remove_tool_in_every_mode_and_depth
test windows photocraft-engine-core 1.29 cmd::retouch_cmds::remove_history_name_tests::sample_all_layers_and_create_new_layer_are_one_step_named_remove_tool
test windows photocraft-engine-core 1.50 cmd::retouch_cmds::tests::content_aware_extend_keeps_the_original
test windows photocraft-engine-core 4.54 cmd::retouch_cmds::tests::content_aware_move_coarse_preview_handles_transform_extend_and_limits
test windows photocraft-engine-core 2.63 cmd::retouch_cmds::tests::content_aware_move_fails_gracefully
test windows photocraft-engine-core 9.47 cmd::retouch_cmds::tests::content_aware_move_moves_the_object_and_fills_its_place_at_all_depths
test windows photocraft-engine-core 6.30 cmd::retouch_cmds::tests::content_aware_move_overlapping_at_the_edge_and_on_other_targets
test windows photocraft-engine-core 5.56 cmd::retouch_cmds::tests::content_aware_move_preview_shows_the_result_without_touching_the_session
test windows photocraft-engine-core 41.74 cmd::retouch_cmds::tests::content_aware_move_previews_large_selections_coarse_then_exact
test windows photocraft-engine-core 8.41 cmd::retouch_cmds::tests::content_aware_move_samples_all_layers_onto_an_empty_layer
test windows photocraft-engine-core 18.56 cmd::retouch_cmds::tests::content_aware_move_structure_and_color_shape_the_result
test windows photocraft-engine-core 14.38 cmd::retouch_cmds::tests::content_aware_move_transform_on_drop_scales_and_rotates_the_content
test windows photocraft-engine-core 1.28 cmd::retouch_cmds::tests::erase_to_history_paints_white_past_a_shapes_path_in_every_colour_mode
test windows photocraft-engine-core 19.22 cmd::retouch_cmds::tests::live_dab_batches_match_the_accumulating_renderer
test windows photocraft-engine-core 2.06 cmd::retouch_cmds::tests::live_dab_offers_are_refused_or_dropped_when_they_dont_match
test windows photocraft-engine-core 1.82 cmd::retouch_cmds::tests::live_dab_rejects_invalid_batches_without_changing_the_preview
test windows photocraft-engine-core 16.36 cmd::retouch_cmds::tests::live_dab_strokes_commit_their_pixels_and_they_are_the_commands
test windows photocraft-engine-core 4.49 cmd::retouch_cmds::tests::patch_content_aware_copies_the_dragged_to_content_into_the_selection
test windows photocraft-engine-core 2.42 cmd::retouch_cmds::tests::protect_detail_drags_at_the_default_spacing_widen_the_halo_without_banding
test windows photocraft-engine-core 1.86 cmd::retouch_cmds::tests::remove_a_ring_around_an_object_removes_it_in_one_undo_step
test windows photocraft-engine-core 1.15 cmd::retouch_cmds::tests::remove_open_strokes_and_the_selection_limit_what_changes
test windows photocraft-engine-core 3.18 cmd::retouch_cmds::tests::sample_all_layers_spot_healing_heals_onto_an_empty_layer
test windows photocraft-engine-core 14.60 cmd::retouch_cmds::tests::spot_healing_keeps_film_grain_through_overlapping_strokes
test windows photocraft-engine-core 4.09 cmd::retouch_cmds::tests::spot_healing_removes_blemish_all_types
test windows photocraft-engine-core 2.03 cmd::retouch_cmds::tests::the_tools_the_reference_application_does_not_wrap_stop_at_the_canvas_edge
test windows photocraft-engine-core 6.95 cmd::selection_cmds::color_range_window_tests::cropped_range_matches_full_canvas_combinations_with_soft_holes_and_clipped_masks
test windows photocraft-engine-core 1.08 cmd::selection_cmds::modify_window::tests::cropped_blurs_preserve_soft_masks_at_every_depth
test windows photocraft-engine-core 4.30 cmd::selection_cmds::modify_window::tests::cropped_commands_match_full_canvas_reads_padding_and_writeback
test windows photocraft-engine-core 8.24 cmd::selection_cmds::tests::windowed_tool_feather_matches_full_canvas
test windows photocraft-engine-core 2.73 cmd::slice_cmds::tests::divide_refuses_more_parts_than_one_division_makes
test windows photocraft-engine-core 2.46 cmd::slice_cmds::tests::slices_round_trip_through_psd_and_pcraft
test windows photocraft-engine-core 1.89 cmd::smart_cmds::tests::selection::selected_pixels_become_one_editable_smart_object_in_every_mode_and_depth
test windows photocraft-engine-core 2.39 cmd::smart_cmds::tests::source_flatten::effects_across_block_edges_match
test windows photocraft-engine-core 3.36 cmd::smart_cmds::tests::svg_profile::svg_smart_contents_and_stack_open_many_shapes_as_layers
test windows photocraft-engine-core 3.49 cmd::smart_cmds::tests::svg_profile::svg_warp_frame_uses_bounded_bounds
test windows photocraft-engine-core 1.69 cmd::smart_svg_cmds::tests::embedded_pdf_ai_and_eps_update_shared_instances_without_reading_linked_paths
test windows photocraft-engine-core 2.61 cmd::smart_svg_cmds::tests::original_vector_formats_save_atomically_and_survive_undo_and_persistence
test windows photocraft-engine-core 1.23 cmd::smart_svg_cmds::tests::valid_updates_repeat_at_all_depths_and_roundtrip_original_svg
test windows photocraft-engine-core 1.02 cmd::smartselect_cmds::object_hard_edge_tests::a_wrong_type_hard_edge_is_the_default
test windows photocraft-engine-core 1.42 cmd::smartselect_cmds::object_hard_edge_tests::hard_edge_off_matches_the_reference_rectangle
test windows photocraft-engine-core 2.63 cmd::smartselect_cmds::object_hard_edge_tests::hard_edge_off_on_the_reference_disc
test windows photocraft-engine-core 2.67 cmd::smartselect_cmds::object_hard_edge_tests::hard_edge_on_is_unchanged_on_the_reference_document
test windows photocraft-engine-core 1.04 cmd::smartselect_cmds::quick_mode_refusal_tests::other_modes_keep_selecting
test windows photocraft-engine-core 1.08 cmd::smartselect_cmds::tests::object_selection_point_selects_the_object_under_it
test windows photocraft-engine-core 7.25 cmd::smartselect_cmds::tests::refine_edge_accepts_huge_sparse_and_solid_selections
test windows photocraft-engine-core 2.63 cmd::smartselect_cmds::tests::refine_edge_edits_object_and_subject
test windows photocraft-engine-core 1.54 cmd::smartselect_cmds::tests::select_subject_repeat_reuses_the_mask_until_pixels_change
test windows photocraft-engine-core 1.29 cmd::type_area_cmds::tests::a_resolution_change_keeps_area_type_wrapping_where_it_was
test windows photocraft-engine-core 2.68 cmd::type_area_cmds::tests::area_type_saves_to_psd_as_paragraph_text_with_a_warning
test windows photocraft-engine-core 1.02 cmd::type_caret_cmds::tests::caret_midpoint_round_trips_for_point_paragraph_transformed_and_vertical
test windows photocraft-engine-core 1.10 cmd::type_cmds::tests::a_duplicated_type_layer_follows_its_new_text
test windows photocraft-engine-core 1.01 cmd::type_spell_cmds::enabled_tests::enabled_with_type_layers_as_before
test windows photocraft-engine-core 1.19 cmd::type_spell_cmds::order_tests::a_null_unknown_or_pixel_from_checks_top_to_bottom
test windows photocraft-engine-core 11.68 color_channels::tone::tests::fused_tiles_match_scalar_oracle_at_all_depths_and_modes
test windows photocraft-engine-core 3.22 color_channels::tone_dialog_tests::tone_dialog_normalization_matches_native_execution
test windows photocraft-engine-core 2.15 jobs::tests::content_aware_fill_and_scale_run_as_jobs
test windows photocraft-engine-core 3.81 jobs::tests::content_aware_move_runs_as_a_job
test windows photocraft-engine-core 1.57 jobs::tests::remove_runs_as_a_job
test windows photocraft-engine-core 1.32 layer_style::tests::oversized_satin_and_bevel_sizes_stay_saveable_and_render
test windows photocraft-engine-core 27.10 pixels::tests::tiled_adjustment_matches_one_pass_over_the_content
test windows photocraft-engine-core 11.11 pixels::tests::tiled_clear_and_fill_match_one_pass_over_the_area
test windows photocraft-engine-core 2.17 preset_store::tests::startup_with_many_groups_loads_them_all
test windows photocraft-engine-core 2.14 select_mask_edits::tests::invert_on_a_huge_canvas_and_runs_of_inverts
test windows photocraft-engine-core 6.11 select_mask_edits::tests::thin_edits_across_a_huge_canvas_paint_only_their_tiles
test windows photocraft-engine-core 5.18 tests::file_new_at_the_size_limit_does_not_fill_every_tile
test windows photocraft-engine::global_state 2.59 artboard_export_scratch::artboard_exports_refuse_unreadable_scratch_tiles
test windows photocraft-engine::global_state 3.26 memory_gate::a_psd_with_image_resources_places_and_renders_when_it_fits
test windows photocraft-engine::global_state 1.87 memory_gate::a_smart_object_edit_under_low_memory_keeps_its_appearance
1 # Test times of the CI gate's shards, which the build job balances its per-shard archives by
14 bin
15 bin
16 bin
17 bin
18 bin
19 bin
20 bin
161 test
162 test
163 test
164 test
165 test
166 test
167 test
168 test
169 test
170 test
171 test
172 test
173 test
174 test
175 test
176 test
177 test
178 test
179 test
180 test
181 test
182 test
183 test
184 test
185 test
186 test
187 test
188 test
189 test
190 test
191 test
192 test
193 test
194 test
195 test
196 test
197 test
198 test
199 test
200 test
201 test
202 test
203 test
204 test
205 test
206 test
207 test
208 test
209 test
210 test
211 test
212 test
213 test
214 test
215 test
216 test
217 test
218 test
219 test
220 test
221 test
222 test
223 test
224 test
225 test
226 test
227 test
228 test
229 test
230 test
231 test
232 test
233 test
234 test
235 test
236 test
237 test
238 test
239 test
240 test
241 test
242 test
243 test
244 test
245 test
246 test
247 test
248 test
249 test
250 test
251 test
252 test
253 test
254 test
255 test
256 test
257 test
258 test
259 test
260 test
261 test
262 test
263 test
264 test
798 bin
799 bin
800 bin
801 bin
802 bin
803 bin
804 bin
1013 test
1014 test
1015 test
1016 test
1017 test
1018 test
1019 test
1020 test
1021 test
1022 test
1023 test
1024 test
1025 test
1026 test
1027 test
1028 test
1029 test
1030 test
1031 test
1032 test
1033 test
1034 test
1035 test
1036 test
1037 test
1038 test
1039 test
1040 test
1041 test
1042 test
1043 test
1044 test
1045 test
1046 test
1047 test
1048 test
1049 test
1050 test
1051 test
1052 test
1053 test
1054 test
1055 test
1056 test
1057 test
1058 test
1059 test
1060 test
1061 test
1062 test
1063 test
1064 test
1065 test
1066 test
1067 test
1068 test
1069 test
1070 test
1071 test
1072 test
1073 test
1074 test
1075 test
1076 test
1077 test
1078 test
1079 test
1080 test
1081 test
1082 test
1083 test
1084 test
1085 test
1086 test
1087 test
1088 test
1089 test
1090 test
1091 test
1092 test
1093 test
1094 test
1095 test
1096 test
1097 test
1098 test
1099 test
1100 test
1101 test
1102 test
1103 test
1104 test
1105 test
1106 test
1107 test
1108 test
1109 test
1110 test
1111 test
1112 test
1113 test
1114 test
1115 test
1116 test
1117 test
1118 test
1119 test
1120 test
1121 test
1122 test
1123 test
1124 test
1125 test
1126 test
1127 test
1128 test
1129 test
1130 test
1131 test
1132 test
1133 test
1134 test
1135 test
1136 test
1137 test
1138 test
1139 test
1140 test
1141 test
1142 test
1143 test
1144 test
1145 test
1146 test
1147 test
1148 test
1149 test
1150 test
1151 test
1152 test
1153 test
1154 test
1155 test
1156 test
1157 test
1158 test
1159 test
1160 test
1161 test
1162 test
1163 test
1164 test
1165 test
1166 test
1167 test
1168 test
1169 test
1170 test
1171 test
1172 test
1173 test
1174 test
1175 test
1176 test
1177 test
1178 test
1179 test
+7 -7
View File
@@ -55,7 +55,7 @@ slow-timeout = { period = "15s", terminate-after = 3 }
# times out. Each runs alone there.
[[profile.ci.overrides]]
platform = 'cfg(target_os = "windows")'
filter = 'package(photocraft-engine) & test(/content_aware_move/)'
filter = '(package(photocraft-engine-core) | package(photocraft-engine)) & test(/content_aware_move/)'
threads-required = "num-test-threads"
# Keep phase timings for the remaining expensive Windows GPU regressions visible. This does
@@ -97,23 +97,23 @@ priority = 100
# 60 to 200 s
filter = '''
(package(photocraft-gpu) & test(=camera_raw::clarity_texture_and_dehaze_with_shadows_highlights_and_per_pixel_stages)) |
(package(photocraft-engine) & test(=cmd::retouch_cmds::content_aware_move::tests::a_coarse_preview_keeps_a_faint_sparse_selection)) |
(package(photocraft-engine-core) & test(=cmd::retouch_cmds::content_aware_move::tests::a_coarse_preview_keeps_a_faint_sparse_selection)) |
(package(photocraft-engine) & test(=crop_content_aware_layers::unmeasured_active_targets_and_delete_off_keep_the_legacy_target)) |
(package(photocraft-engine) & test(=cmd::retouch_cmds::content_aware_move::color_tests::a_flat_patch_matches_the_new_surroundings_at_color_ten)) |
(package(photocraft-engine-core) & test(=cmd::retouch_cmds::content_aware_move::color_tests::a_flat_patch_matches_the_new_surroundings_at_color_ten)) |
(package(photocraft-ui-egui) & test(=tools::type_tool::canvas_tests::every_paragraph_box_handle_resizes_the_box_with_snapping_on)) |
(package(photocraft-ui-egui) & test(=gpu_tests::checker_canvas::pixel_grid_is_solid_and_visible_gpu_2x)) |
(package(photocraft-engine) & test(=cmd::retouch_cmds::tests::content_aware_move_coarse_preview_handles_transform_extend_and_limits)) |
(package(photocraft-engine-core) & test(=cmd::retouch_cmds::tests::content_aware_move_coarse_preview_handles_transform_extend_and_limits)) |
(package(photocraft-ui-egui) & test(=gpu_tests::checker_canvas::pixel_grid_is_solid_and_visible_cpu_2x)) |
(package(photocraft-ui-egui) & test(=gpu_tests::drag_preview_canvas::marquee_previews_show_while_dragging_on_white_and_black_at_1x_and_2x)) |
(package(photocraft-gpu) & test(=camera_raw::shadows_and_highlights_with_per_pixel_stages)) |
(package(photocraft-engine) & test(=cmd::retouch_cmds::content_aware_move::color_tests::a_brightness_change_shifts_the_middle_only_past_color_five)) |
(package(photocraft-engine) & test(=cmd::retouch_cmds::tests::content_aware_move_previews_large_selections_coarse_then_exact_at_all_depths)) |
(package(photocraft-engine-core) & test(=cmd::retouch_cmds::content_aware_move::color_tests::a_brightness_change_shifts_the_middle_only_past_color_five)) |
(package(photocraft-engine-core) & test(=cmd::retouch_cmds::tests::content_aware_move_previews_large_selections_coarse_then_exact_at_all_depths)) |
(package(photocraft-ui-egui) & test(=gpu_tests::live_stroke_canvas::live_tool_camera_navigation_is_visible_in_the_input_frame)) |
(package(photocraft-ui-egui) & test(=gpu_tests::live_stroke_canvas::the_canvas_shows_the_committed_stroke_part_0)) |
(package(photocraft-ui-egui) & test(=gpu_tests::full_res_preview::adjustment_layer_drag_previews_at_full_resolution_when_low_res_is_off)) |
(package(photocraft-ui-egui) & test(=input::hold_keys::tests::cmd_gives_the_move_tool_only_where_the_tool_does_not_take_cmd)) |
(package(photocraft-ui-egui) & test(=guide_cursor_tests::command_over_a_guide_takes_it_where_command_is_the_move_tool)) |
(package(photocraft-gpu) & test(=parity::documents_larger_than_the_texture_limit)) |
(package(photocraft-engine) & test(=cmd::retouch_cmds::content_aware_move::tests::a_preview_within_the_full_resolution_budget_is_the_plain_solve_bit_for_bit))
(package(photocraft-engine-core) & test(=cmd::retouch_cmds::content_aware_move::tests::a_preview_within_the_full_resolution_budget_is_the_plain_solve_bit_for_bit))
'''
priority = 50
+2 -2
View File
@@ -549,7 +549,7 @@ jobs:
- name: Compare exact outputs and release timings on 24 MP
run: |
set -o pipefail
cargo test --release -p photocraft-engine --lib color_range_release_comparison -- --ignored --nocapture | tee color-range-perf.txt
cargo test --release -p photocraft-engine-core --lib color_range_release_comparison -- --ignored --nocapture | tee color-range-perf.txt
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always()
with:
@@ -590,7 +590,7 @@ jobs:
- name: Compare cropped command reads and writeback on 36 MP
run: |
set -o pipefail
cargo test --release -p photocraft-engine --lib sparse_modify_release_comparison -- --ignored --nocapture | tee -a selection-morphology-perf.txt
cargo test --release -p photocraft-engine-core --lib sparse_modify_release_comparison -- --ignored --nocapture | tee -a selection-morphology-perf.txt
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always()
with:
Generated
+29
View File
@@ -6610,6 +6610,35 @@ dependencies = [
[[package]]
name = "photocraft-engine"
version = "0.23.1"
dependencies = [
"blake3",
"craft-affinity",
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=20574f0ed421f0a3d25edf8d9cbbef68f93a90ce)",
"craft-develop-model",
"craft-image-codecs",
"craft-psd",
"exr",
"photocraft-algo",
"photocraft-color",
"photocraft-compose",
"photocraft-doc",
"photocraft-engine-core",
"photocraft-format",
"photocraft-geom",
"photocraft-io",
"photocraft-paint",
"photocraft-raster",
"photocraft-testkit",
"photocraft-text",
"photocraft-vector",
"rayon",
"serde_json",
"tempfile",
]
[[package]]
name = "photocraft-engine-core"
version = "0.23.1"
dependencies = [
"base64 0.22.1",
"blake3",
+5 -2
View File
@@ -38,6 +38,7 @@ photocraft-format = { path = "crates/format" }
photocraft-automation = { path = "crates/automation" }
photocraft-plugins = { path = "crates/plugins" }
photocraft-engine = { path = "crates/engine" }
photocraft-engine-core = { path = "crates/engine-core" }
photocraft-ui-egui = { path = "crates/ui-egui" }
photocraft-testkit = { path = "crates/testkit" }
photocraft-tablet = { path = "crates/tablet" }
@@ -120,7 +121,7 @@ todo = "warn"
# Every cl command selects these packages: each brings features the others lack, so a command that drops one
# builds a second copy of egui, photocraft-io or craft-affinity and of everything above them.
selection = [
"photocraft-ui-egui", "photocraft-engine", "photocraft", "photocraft-algo", "photocraft-automation",
"photocraft-ui-egui", "photocraft-engine", "photocraft-engine-core", "photocraft", "photocraft-algo", "photocraft-automation",
"photocraft-text", "photocraft-tablet", "photocraft-cli", "photocraft-paint", "photocraft-io", "photocraft-gpu",
]
# Crates whose new builds cl names after a command, besides the framework's.
@@ -149,7 +150,7 @@ craft-imaging = ["default", "screen-testing", "ui"]
[workspace.metadata.cl.default_seconds]
"photocraft-ui-egui/photocraft_ui_egui" = 389.0
"photocraft-ui-egui/it" = 221.0
"photocraft-engine/photocraft_engine" = 97.0
"photocraft-engine-core/photocraft_engine_core" = 97.0
# Dependencies carry no debug info: their frames in a backtrace lose file:line, and the target dir
# and link times shrink. The test profile inherits both settings.
@@ -179,6 +180,8 @@ opt-level = 0
# the dev profile's 1.
[profile.test.package.photocraft-engine]
opt-level = 0
[profile.test.package.photocraft-engine-core]
opt-level = 0
# Only the exhaustive rounding proof needs maximum optimization; algo stays at its usual level.
[profile.test.package.photocraft-oil-round-proof]
+1 -1
View File
@@ -49,7 +49,7 @@ WORKDIR /src/apps/photocraft-web
# memory than the release zip's fat LTO; retain the profile's other optimizations.
ARG CARGO_PROFILE_WASM_RELEASE_LTO=thin
ARG CARGO_BUILD_JOBS=1
# Optional build provenance shown in About and `--version` (crates/engine/src/build_info.rs).
# Optional build provenance shown in About and `--version` (crates/engine-core/src/build_info.rs).
# .git is not in the build context, so pass it in, e.g.
# --build-arg PHOTOCRAFT_BUILD_SHA=$(git rev-parse HEAD) --build-arg PHOTOCRAFT_BUILD_DATE=$(date -u +%F)
# Left empty, the build reports itself as a dev build.
+1
View File
@@ -1427,6 +1427,7 @@ fn a_non_unicode_path_is_taken_and_non_unicode_text_is_a_usage_error() {
#[test]
fn batch_plays_a_photoshop_actions_file() {
use photocraft_engine::actions_cmds::{Action, ActionStep};
photocraft_engine::install().unwrap();
let d = tmp("atn");
let input = d.join("in");
std::fs::create_dir_all(&input).unwrap();
+27 -2
View File
@@ -13,10 +13,15 @@
//! [`service`] builds the pointer-position service for the app's window, `None` where it can't
//! be read.
pub use platform::service;
pub use platform::{primary_down_service, service};
#[cfg(target_os = "macos")]
mod platform {
/// Not read here: the title-bar move of a floating document window reaches the app as a press and a release.
pub fn primary_down_service() -> Option<photocraft_ui_egui::PrimaryDownFn> {
None
}
use objc2::MainThreadMarker;
use objc2_app_kit::{NSApplication, NSEvent, NSWindow};
use photocraft_ui_egui::CursorPosFn;
@@ -45,6 +50,11 @@ mod platform {
#[cfg(target_os = "linux")]
mod platform {
/// Not read here: the title-bar move of a floating document window reaches the app as a press and a release.
pub fn primary_down_service() -> Option<photocraft_ui_egui::PrimaryDownFn> {
None
}
use eframe::wgpu::rwh::{HasWindowHandle, RawWindowHandle};
use photocraft_ui_egui::CursorPosFn;
use x11rb::protocol::xproto::ConnectionExt;
@@ -81,7 +91,17 @@ mod platform {
#[cfg(target_os = "windows")]
mod platform {
use photocraft_ui_egui::CursorPosFn;
use photocraft_ui_egui::{CursorPosFn, PrimaryDownFn};
/// The physical left button (`GetAsyncKeyState`): a floating document window's title-bar move runs in the OS, which
/// tells the app nothing when it ends (#16415).
pub fn primary_down_service() -> Option<PrimaryDownFn> {
// `GetAsyncKeyState` reads the physical button: with the buttons swapped, the primary one is the right.
Some(Box::new(|| {
let swapped = winsafe::GetSystemMetrics(winsafe::co::SM::SWAPBUTTON) != 0;
winsafe::GetAsyncKeyState(if swapped { winsafe::co::VK::RBUTTON } else { winsafe::co::VK::LBUTTON })
}))
}
pub fn service(_cc: &eframe::CreationContext<'_>) -> Option<CursorPosFn> {
Some(Box::new(|ctx: &egui::Context| {
@@ -104,6 +124,11 @@ fn client_points(screen_px: egui::Pos2, inner_min: egui::Pos2, ppp: f32) -> egui
#[cfg(not(any(target_os = "macos", target_os = "linux", target_os = "windows")))]
mod platform {
/// Not read here: the title-bar move of a floating document window reaches the app as a press and a release.
pub fn primary_down_service() -> Option<photocraft_ui_egui::PrimaryDownFn> {
None
}
use photocraft_ui_egui::CursorPosFn;
pub fn service(_cc: &eframe::CreationContext<'_>) -> Option<CursorPosFn> {
+3 -1
View File
@@ -155,7 +155,7 @@ fn control_port_for(cli: Option<u16>, prefs: &photocraft_engine::prefs::Integrat
}
/// The main window: 1440 × 900 (shrunk to fit the monitor, and maximized on the first frame
/// when it still doesn't fit, `work_area::fit_window`), centred on the main monitor. Without
/// when it still doesn't fit, `embed::before_ui`), centred on the main monitor. Without
/// `centered`, Windows cascades each new window from the top-left corner, so it opened at a
/// different offset every launch (#419). A later launch restores the saved position instead
/// (`main` turns `centered` off, #4826). Wayland compositors place windows themselves.
@@ -713,6 +713,8 @@ fn main() -> eframe::Result {
}
// Where file drags and drops are (winit 0.30 doesn't say).
app.services.cursor_pos = cursor::service(cc);
// The physical primary button: it ends a floating document window's OS move by its title bar (#16415).
app.services.primary_down = cursor::primary_down_service();
// The custom title bar's undecorated window must stay borderless, or its caption and
// border offset the content and the pointer on some Windows systems (#2246).
app.services.window_frame = window_frame::service(cc, integrated_frame);
+2 -1
View File
@@ -245,7 +245,8 @@ fn recovered_documents_survive_a_second_crash_until_saved_or_closed() {
let red = index_of(&app, RED);
app.run("file.close", json!({"document": red})).unwrap();
// Saving marks the revision saved (the file write itself is the save service's job).
assert!(app.session.set_active(index_of(&app, BLUE)));
let blue = index_of(&app, BLUE);
assert!(app.session.set_active(blue));
let st = app.session.active_mut().unwrap();
st.saved_revision = st.revision;
prefs_ui::tick(&mut app, &ctx, std::time::Instant::now());
+1 -1
View File
@@ -288,7 +288,7 @@ fn holds_image(dir: &Dir, relative: &Path) -> bool {
let Ok(mut file) = dir.open(relative) else { return false };
let Ok(n) = file.read(&mut head) else { return false };
let head = &head[..n];
head.starts_with(b"8BPS") || photocraft_codecs::detect(head).is_some_and(|format| format.caps().write)
photocraft_io::is_psd(head) || photocraft_codecs::detect(head).is_some_and(|format| format.caps().write)
}
fn read_to_observed_length(reader: &mut impl Read, observed_length: u64) -> Result<Vec<u8>, AutomationError> {
+89
View File
@@ -0,0 +1,89 @@
[package]
name = "photocraft-engine-core"
version.workspace = true
edition.workspace = true
license.workspace = true
[lints]
workspace = true
[features]
# Real-file corpus tests (opt-in; `cargo xtask test-corpus`). Fail when the corpus is missing.
corpus = []
[dependencies]
craft-tracked = { workspace = true }
# `#[derive(PlainData)]` for the session areas held in `Tracked`.
craft-ui-macros = { workspace = true }
photocraft-geom = { workspace = true }
photocraft-color = { workspace = true }
craft-cms = { workspace = true }
# PCTIP codec from craft-libs#1564; isolated pin until the shared revision is adopted workspace-wide.
craft-pcraft-tip = { package = "craft-pcraft-format", git = "https://github.com/storytold/craft-libs", rev = "20574f0ed421f0a3d25edf8d9cbbef68f93a90ce" }
photocraft-raster = { workspace = true }
photocraft-doc = { workspace = true }
photocraft-ops = { workspace = true }
photocraft-compose = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
rayon = { workspace = true }
chrono = { workspace = true }
web-time = { workspace = true }
photocraft-paint = { workspace = true }
photocraft-algo = { workspace = true }
photocraft-text = { workspace = true }
photocraft-vector = { workspace = true }
photocraft-io = { workspace = true }
craft-xml = { workspace = true }
craft-psd = { workspace = true }
photocraft-format = { workspace = true }
photocraft-plugins = { workspace = true }
base64 = "0.22"
blake3 = { version = "1.8", default-features = false, features = ["pure"] }
photocraft-codecs = { workspace = true }
photocraft-formats = { workspace = true }
flate2 = { workspace = true }
craft-print = { workspace = true }
# The framework through its facade: the actions model (`craft::automation`), the `.kys` model
# (`craft::keymap`), the palette (`craft::color_ui`), preferences storage and autosave
# (`craft::settings`, `craft::platform`), and `craft::theme::ThemeId`, the theme ids the
# appearance preferences hold.
craft = { workspace = true, features = ["automation", "color-ui", "keymap", "platform", "settings"] }
# Release tags use the same semantic versions as Cargo.
semver = "1"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tempfile = "3"
# `clock`: the local time that names History Options' snapshot on save (#2966); already in the
# tree through rmcp. The web build has no local clock here and names it "Snapshot N".
chrono = { workspace = true, features = ["clock"] }
# `file_cmds::same_file` on Windows: the volume serial number and file index, so a hard link to a
# file is that file (std's `MetadataExt::file_index` is unstable).
[target.'cfg(windows)'.dependencies]
same-file = "1"
# `file.print` loads Windows.Data.Pdf.dll before calling into it (#5884): the safe binding
# ui-egui and craft-print already use, pinned to the same version.
winsafe = { version = "=0.0.29", default-features = false, features = ["kernel"] }
# Printing on Unix: an IPP client for CUPS (pure Rust); the web build cannot print.
[target.'cfg(all(not(target_arch = "wasm32"), not(target_os = "windows")))'.dependencies]
photocraft-ipp = { workspace = true }
[dev-dependencies]
craft-affinity = { workspace = true, features = ["synth"] }
craft-develop-model = { workspace = true }
photocraft-io = { workspace = true, features = ["testgen"] }
# Synthetic camera raw files for the open tests.
photocraft-raw = { workspace = true, features = ["testgen"] }
photocraft-testkit = { workspace = true }
exr = { version = "1.73", default-features = false }
# WebAssembly text -> binary for plug-in test modules (Apache-2.0 WITH LLVM-exception).
wat = "1.228"
# Synthetic multi-part EXR fixtures for the parts-commands tests.
# Palette PNGs at 1, 2 and 4 bits and with an eXIf chunk for the Color Table index tests
# (the png 0.18 already in the tree).
png = "0.18"
File renamed without changes.
@@ -5,7 +5,7 @@ use crate::jobs::Started;
use crate::{EngineError, Session};
fn session() -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 32, "height": 32, "background": "white"})).unwrap();
s
}
File renamed without changes.
@@ -364,7 +364,7 @@ fn gray_point_fallback_keeps_tightly_spaced_points_round_trip_safe() {
#[test]
fn curves_eyedropper_param_drives_the_command() {
let mut s = crate::Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
s.execute("edit.fill", json!({"color": [0.6, 0.5, 0.4]})).unwrap();
s.execute("image.adjustments.curves", json!({"eyedropper": {"point": "white", "at": [2, 2]}})).unwrap();
@@ -391,7 +391,7 @@ fn curves_eyedropper_param_drives_the_command() {
/// that samples the image below the layer, so a repeated click keeps the same curve.
#[test]
fn layer_eyedropper_samples_below_the_curves_layer() {
let mut s = crate::Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
s.execute("edit.fill", json!({"color": [0.6, 0.5, 0.4]})).unwrap();
s.execute("layer.newAdjustmentLayer.curves", json!({})).unwrap();
@@ -420,7 +420,7 @@ fn layer_eyedropper_samples_below_the_curves_layer() {
#[test]
fn eyedropper_on_a_smart_object_records_the_resolved_adjustment() {
for kind in ["curves", "levels"] {
let mut s = crate::Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
s.execute("edit.fill", json!({"color": [0.6, 0.5, 0.4]})).unwrap();
s.execute("layer.smartObjects.convertToSmartObject", json!({})).unwrap();
@@ -437,14 +437,14 @@ fn eyedropper_on_a_smart_object_records_the_resolved_adjustment() {
fn levels_eyedroppers_set_white_and_neutral_gray() {
let pixel = |s: &mut crate::Session| -> Vec<f32> { serde_json::from_value(s.execute("document.pixel", json!({"x": 2, "y": 2})).unwrap()).unwrap() };
for depth in [8, 16] {
let mut s = crate::Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8, "depth": depth})).unwrap();
s.execute("edit.fill", json!({"color": [0.6, 0.5, 0.4]})).unwrap();
s.execute("image.adjustments.levels", json!({"eyedropper": {"point": "white", "at": [2, 2]}})).unwrap();
let px = pixel(&mut s);
assert!(px.iter().take(3).all(|v| *v > 0.995), "{depth}-bit: the sample becomes white: {px:?}");
}
let mut s = crate::Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
s.execute("edit.fill", json!({"color": [0.6, 0.5, 0.4]})).unwrap();
let before = pixel(&mut s);
@@ -489,7 +489,7 @@ fn hue_range_sliders_stay_ordered() {
/// A colourful 16×16 document (`mode`, `depth`) for command tests.
fn colourful(mode: &str, depth: u32) -> crate::Session {
let mut s = crate::Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 16, "height": 16, "mode": mode, "depth": depth})).unwrap();
for (i, c) in ["#c83c28", "#3c8c50", "#2850b4", "#d2b464"].iter().enumerate() {
s.execute("select.rect", json!({"x": (i % 2) * 8, "y": (i / 2) * 8, "width": 8, "height": 8})).unwrap();
@@ -563,7 +563,7 @@ fn destructive_levels_dont_clip_in_32_bit() {
// compose-side `levels_dont_clip_in_32_bit` pins the same curve, #2592).
let params = json!({"inBlack": 15, "inWhite": 230, "gamma": 1.3, "outBlack": 10, "outWhite": 245});
for depth in [8, 16, 32] {
let mut s = crate::Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 16, "height": 16, "depth": depth, "background": "white"})).unwrap();
s.execute("select.rect", json!({"x": 0, "y": 0, "width": 8, "height": 16})).unwrap();
s.execute("edit.fill", json!({"color": "#000000"})).unwrap();
@@ -649,7 +649,7 @@ fn destructive_levels_match_independent_signed_hdr_endpoints() {
// curve at black and white, not display-clipped values.
let params = json!({"inBlack": 15, "inWhite": 230, "gamma": 1.3, "outBlack": 10, "outWhite": 245});
for (depth, low, high, tolerance) in [(8, 10.0, 245.0, 0.6), (16, 10.0, 245.0, 0.6), (32, -20.308_89, 265.750_3, 0.01)] {
let mut s = crate::Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 16, "height": 16, "depth": depth, "background": "white"})).unwrap();
s.execute("select.rect", json!({"x": 0, "y": 0, "width": 8, "height": 16})).unwrap();
s.execute("edit.fill", json!({"color": "#000000"})).unwrap();
File renamed without changes.
@@ -12,7 +12,7 @@ const GREEN: [f32; 4] = [0.0, 1.0, 0.0, 1.0];
const WHITE: [f32; 4] = [1.0, 1.0, 1.0, 1.0];
fn session() -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 64, "height": 32, "background": "white"})).unwrap();
s.tools.foreground = BLACK;
s.tools.background = GREEN;
@@ -6,7 +6,6 @@
//! these same two fields (`crates/ui-egui/src/panels/options_bar.rs`), so off here means drawn
//! off there.
use crate::Session;
use photocraft_paint::brush::BrushSettings;
use serde_json::{Value, json};
@@ -22,7 +21,7 @@ fn the_default_brush_has_neither_pressure_toggle_on() {
/// two toggles.
#[test]
fn brush_get_reports_both_pressure_toggles_off() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 32, "height": 32})).unwrap();
let got = s.execute("brush.get", json!({})).unwrap();
assert_eq!(got["pressureSize"], json!(false), "brush.get reports Pressure for Size off (#11809)");
@@ -49,7 +48,7 @@ fn a_brush_that_omits_the_field_takes_the_off_default() {
/// same field the options-bar button is drawn from.
#[test]
fn pressure_for_size_still_switches_on_and_off() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 32, "height": 32})).unwrap();
s.execute("tools.setBrush", json!({"brush": {"pressureSize": true}})).unwrap();
assert!(s.tools.brush.pressure_size, "the toggle still turns on");
@@ -62,7 +61,7 @@ fn pressure_for_size_still_switches_on_and_off() {
/// One stroke of a pressure ramp (0.3 → 0.65 → 1.0) across a new empty layer with `brush`: the
/// layer's pixels and what the stroke covers.
fn ramp(brush: Value) -> (Vec<f32>, photocraft_geom::Rect) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 80, "height": 40})).unwrap();
s.execute("layer.new.layer", json!({})).unwrap();
s.execute("paint.stroke", json!({"points": [[20.0, 20.0, 0.3], [40.0, 20.0, 0.65], [60.0, 20.0, 1.0]], "size": 24.0, "color": "#ff0000", "brush": brush}))
File renamed without changes.
File renamed without changes.
@@ -32,7 +32,7 @@ fn paint(s: &mut Session, f: impl Fn(i32, i32) -> [f32; 4]) {
/// An asymmetric document: a gradient Background, a type layer, a shape layer, a raster layer
/// with a vector mask and a smart object, plus a guide, a saved path and a slice.
fn mixed(depth: u64, mode: &str) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": W, "height": H, "depth": depth, "mode": mode})).unwrap();
paint(&mut s, |x, y| [x as f32 / W as f32, y as f32 / H as f32, 0.3, 1.0]);
s.execute("type.create", json!({"x": 4, "y": 16, "text": "Fj", "size": 14, "color": "#102080"})).unwrap();
@@ -190,7 +190,7 @@ fn gradient_fill_angle_follows_the_canvas() {
/// The gradient fill's centre offset after `cmd`, as `gradient.fill.get` reports it (% of the frame).
fn fill_offset_after(cmd: &str, p: serde_json::Value) -> (f64, f64) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 100, "height": 100})).unwrap();
s.execute("gradient.fill.create", json!({"from": [10, 50], "to": [90, 50], "style": "radial"})).unwrap();
s.execute("gradient.fill.set", json!({"angle": 0, "offset": [25, 0]})).unwrap();
@@ -225,7 +225,7 @@ fn gradient_fill_offset_stays_a_fraction_of_the_frame() {
fn turns_carry_an_angle_gradient_fill_with_its_pixels() {
// An Angle gradient sweeps clockwise: a mirror must reverse it, a turn must not.
for t in TURNS {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": W, "height": H})).unwrap();
let p = json!({"from": [20, 14], "to": [50, 4], "style": "angle", "dither": false});
s.execute("gradient.fill.create", p).unwrap();
@@ -250,7 +250,7 @@ fn turns_carry_an_angle_gradient_fill_with_its_pixels() {
/// The shape's (fill, stroke) gradient angles after `cmd` on a shape whose fill and stroke both
/// start as a 0° (left to right) gradient.
fn shape_gradient_angles_after(cmd: &str, p: serde_json::Value) -> (f32, f32) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": W, "height": H})).unwrap();
let g = json!({"gradient": {"stops": [[0, "#ff0000"], [1, "#0000ff"]], "angle": 0}});
s.execute("shape.create", json!({"kind": "rect", "rect": [10, 8, 30, 20], "fill": g, "stroke": {"width": 6, "fill": g}})).unwrap();
@@ -324,7 +324,7 @@ fn canvas_size_and_crop_move_vector_geometry() {
#[test]
fn guide_colours_follow_their_guides() {
const MAGENTA: [u8; 3] = [255, 0, 255];
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": W, "height": H})).unwrap();
s.execute("view.newGuide", json!({"orientation": "vertical", "position": 20, "color": "#ff00ff"})).unwrap();
s.execute("view.newGuide", json!({"orientation": "vertical", "position": 30})).unwrap();
@@ -386,7 +386,7 @@ fn arbitrary_rotation_moves_marks_and_unlinked_vector_masks() {
/// A canvas turn moves every stored video frame, not just the displayed one (#4956).
#[test]
fn turns_move_stored_video_frames() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": W, "height": H})).unwrap();
s.execute("layer.new.layer", json!({})).unwrap();
paint(&mut s, |x, y| if (x, y) == (1, 2) { [1.0, 0.0, 0.0, 1.0] } else { [0.0; 4] });
@@ -410,14 +410,14 @@ fn turns_move_stored_video_frames() {
#[test]
fn turns_on_empty_and_tiny_documents_never_panic() {
for (w, h) in [(1, 1), (1, 7), (5, 1)] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": w, "height": h})).unwrap();
for t in TURNS {
s.execute(command(t), json!({"junk": [1, 2]})).unwrap();
}
s.execute("image.rotation.arbitrary", json!({"angle": 33})).unwrap();
}
let mut s = Session::new();
let mut s = crate::session();
for t in TURNS {
assert!(s.execute(command(t), json!({})).is_err(), "no document");
}
File renamed without changes.
@@ -7,7 +7,7 @@ const H: i32 = 20;
/// A white document whose left half is #336699: red 0.2, green 0.4, blue 0.6 there.
fn session(depth: u32) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": W, "height": H, "depth": depth})).unwrap();
s.execute("select.rect", json!({"x": 0, "y": 0, "width": W / 2, "height": H})).unwrap();
s.execute("edit.fill", json!({"color": "#336699"})).unwrap();
@@ -77,7 +77,7 @@ fn cmyk_channels_copy_and_paste_as_tone() {
// #5787: copying a CMYK channel gives its tone (white where there is no ink), and pasting a
// tone into a CMYK channel writes it back as ink.
for depth in [8, 16] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": W, "height": H, "mode": "cmyk", "depth": depth, "background": "white"})).unwrap();
s.execute("select.rect", json!({"x": 0, "y": 0, "width": W / 2, "height": H})).unwrap();
s.execute("edit.fill", json!({"color": "#00ffff"})).unwrap();
@@ -102,7 +102,7 @@ fn spot_channels_copy_and_paste_as_tone() {
// #5787: a spot channel stores ink but copies as its tone, and a tone pasted into it goes back
// to ink: spot -> Black prints the spot's ink in black, Cyan -> spot gives the spot Cyan's ink.
for depth in [8, 16] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": W, "height": H, "mode": "cmyk", "depth": depth, "background": "white"})).unwrap();
s.execute("select.rect", json!({"x": 0, "y": 0, "width": W / 2, "height": H})).unwrap();
s.execute("edit.fill", json!({"color": "#00ffff"})).unwrap();
@@ -146,7 +146,7 @@ mod tests {
/// A document holding `spec` (bottom to top, `*` = clipped) above its Background.
fn stack(spec: &str) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 16, "height": 16})).unwrap();
for name in spec.split_whitespace() {
let id = s.execute("layer.new.layer", json!({"name": name.trim_end_matches('*')})).unwrap()["layer"].clone();
@@ -171,8 +171,8 @@ use params::{bad, set_clipped};
pub(crate) use params::{check_f32_values, cmyk_param, color_param, int, int_i32, parse_hex, u32_id, u32_id_param};
pub use photocraft_color::blend::parse_blend;
pub use crate::install::{command_specs, find};
pub use crate::registry::{CommandSpec, list_entry, list_entry_matches, search_keywords};
pub use crate::registry::{command_specs, find};
#[cfg(test)]
mod set_props_tests {
@@ -181,7 +181,7 @@ mod set_props_tests {
#[test]
fn opacity_and_fill_outside_zero_to_one_are_refused_not_clamped() {
// #5242: `55` (a percentage, as the Layer Style commands take) used to become 100 %.
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
s.execute("layer.new.layer", json!({})).unwrap();
s.execute("layer.setProps", json!({"opacity": 0.55, "fill": 0.4})).unwrap();
@@ -1410,7 +1410,7 @@ mod security_tests {
#[test]
fn playback_budget_is_shared_by_nested_calls() {
let mut session = Session::new();
let mut session = crate::session();
session.actions.playback_steps = MAX_PLAYBACK_STEPS - 1;
assert!(consume_playback_step(&mut session));
assert!(!consume_playback_step(&mut session));
@@ -1420,7 +1420,7 @@ mod security_tests {
/// batch carries instead of restarting it for each input.
#[test]
fn a_nested_batch_input_does_not_reset_the_shared_playback_count() {
let mut session = Session::new();
let mut session = crate::session();
session.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
session.actions.list.push(Action::new("A", vec![ActionStep::new("select.all", json!({}))])).unwrap();
session.actions.budget_shared = true;
@@ -1437,7 +1437,7 @@ mod security_tests {
/// walking the whole action for free.
#[test]
fn disabled_steps_are_charged_to_the_playback_budget() {
let mut session = Session::new();
let mut session = crate::session();
let mut child = Action::new("Child", (0..1000).map(|_| ActionStep::new("select.all", json!({}))).collect());
child.disabled = (0..1000).collect();
let calls = MAX_PLAYBACK_STEPS as usize / 1000 * 2;
@@ -340,7 +340,7 @@ mod tests {
/// finished, even with the document and history unchanged.
#[test]
fn a_continuation_resumes_once() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width":4,"height":4})).unwrap();
s.execute("actions.setHistory", json!({"singleState":true})).unwrap();
begin_document_history(&mut s, "Spell");
@@ -359,7 +359,7 @@ mod tests {
/// Keep the policy fixed until every clone of a paused continuation releases its lease, in either history mode.
fn history_policy_stays_fixed_until_all_paused_continuations_are_released() {
for single in [false, true] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("actions.setHistory", json!({"singleState":single})).unwrap();
begin_document_history(&mut s, "Paused");
let continuation = ActionHistoryContinuation::capture(&mut s);
@@ -380,7 +380,7 @@ mod tests {
/// Generic preference set/reset routes must preserve the same paused-policy guard as actions.setHistory.
fn generic_preference_updates_cannot_change_a_paused_history_policy() {
for single in [false, true] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("actions.setHistory", json!({"singleState":single})).unwrap();
begin_document_history(&mut s, "Paused");
let continuation = ActionHistoryContinuation::capture(&mut s);
@@ -413,7 +413,7 @@ mod tests {
fn idle_dialog_rebind_keeps_first_edit_and_clear_boundaries() {
for single in [false, true] {
for clear in [false, true] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width":4,"height":4})).unwrap();
s.execute("actions.setHistory", json!({"singleState":single})).unwrap();
begin_document_history(&mut s, "Spell");
@@ -449,7 +449,7 @@ mod tests {
/// A dialog continuation cannot adopt another caller's active grouping scope.
fn idle_dialog_rebind_never_takes_an_unrelated_parent_scope() {
for single in [false, true] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width":4,"height":4})).unwrap();
s.execute("actions.setHistory", json!({"singleState":single})).unwrap();
begin_document_history(&mut s, "Spell");
@@ -9,7 +9,7 @@ fn options(s: &Session) -> (crate::prefs::PlaybackPerformance, u8, bool) {
#[test]
fn set_playback_refuses_bad_values_and_changes_nothing() {
let mut s = Session::new();
let mut s = crate::session();
let before = options(&s);
for bad in [
json!({"performance": "fast"}),
@@ -36,7 +36,7 @@ fn set_playback_refuses_bad_values_and_changes_nothing() {
#[test]
fn set_playback_stores_each_value_in_preferences() {
use crate::prefs::PlaybackPerformance::*;
let mut s = Session::new();
let mut s = crate::session();
assert_eq!(options(&s), (Accelerated, 1, true), "the defaults the reference application ships");
let r = s.execute("actions.setPlayback", json!({"performance": "pause", "seconds": 60})).unwrap();
assert_eq!(r, json!({"performance": "pause", "seconds": 60, "singleState": true}));
@@ -48,7 +48,7 @@ fn set_playback_stores_each_value_in_preferences() {
// A preferences file round trip keeps all three.
s.execute("actions.setPlayback", json!({"performance": "pause", "seconds": 7})).unwrap();
let saved = s.prefs_to_json();
let mut t = Session::new();
let mut t = crate::session();
assert!(t.load_prefs_json(&saved).unwrap().is_empty());
assert_eq!(options(&t), (Pause, 7, false));
// prefs.set validates the same range and names.
@@ -62,7 +62,7 @@ fn set_playback_stores_each_value_in_preferences() {
#[test]
fn older_or_hand_edited_preferences_load_within_range() {
let mut s = Session::new();
let mut s = crate::session();
// Before Playback Options: only the history flag.
assert!(s.load_prefs_json(r#"{"actions":{"createSingleHistoryState":false}}"#).unwrap().is_empty());
assert_eq!(options(&s), (crate::prefs::PlaybackPerformance::Accelerated, 1, false));
@@ -74,7 +74,7 @@ fn older_or_hand_edited_preferences_load_within_range() {
#[test]
fn set_playback_keeps_the_history_policy_of_a_running_play() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
s.actions.list.push(Action::new("Change", vec![ActionStep::new("actions.setPlayback", json!({"singleState": false}))])).unwrap();
let played = s.execute("actions.play", json!({"action": "Change"})).unwrap();
@@ -88,7 +88,7 @@ fn set_playback_keeps_the_history_policy_of_a_running_play() {
fn headless_play_runs_the_whole_action_in_every_mode() {
for performance in ["accelerated", "step", "pause"] {
for single in [true, false] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
s.execute("actions.setPlayback", json!({"performance": performance, "seconds": 60, "singleState": single})).unwrap();
let steps = ["A", "B", "C"].map(|n| ActionStep::new("layer.new.layer", json!({"name": n}))).to_vec();
@@ -19,7 +19,7 @@ fn pixel(s: &Session, layer: usize, x: i32, y: i32) -> Vec<f32> {
/// write: it updates the smart object, headless too.
#[test]
fn save_in_edit_contents_updates_the_smart_object() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
s.execute("layer.new.layer", json!({})).unwrap();
s.execute("edit.fill", json!({"contents": "color", "color": "#ff0000"})).unwrap();
@@ -42,7 +42,7 @@ fn save_in_edit_contents_updates_the_smart_object() {
#[test]
fn deselect_with_nothing_selected_is_a_noop_in_playback() {
// #6744: imported actions often start with Deselect; with no selection Photoshop plays on.
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
let before = s.active().unwrap().history.past_len();
// Outside playback the command stays disabled, like Photoshop's greyed menu item.
@@ -62,7 +62,7 @@ fn deselect_with_nothing_selected_is_a_noop_in_playback() {
#[test]
fn unchecked_steps_are_skipped_and_follow_move_and_delete() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
let step = |name: &str| ActionStep::new("layer.new.layer", json!({"name": name}));
s.actions.list.push(Action::new("Three", vec![step("A"), step("B"), step("C")])).unwrap();
@@ -105,7 +105,7 @@ fn unchecked_steps_are_skipped_and_follow_move_and_delete() {
#[test]
fn recorded_eye_visibility_replays_on_another_document_and_duplicate_names() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
s.execute("layer.new.layer", json!({"name": "Same"})).unwrap();
let hidden = s.execute("layer.new.layer", json!({"name": "Same"})).unwrap()["layer"].as_u64().unwrap();
@@ -141,7 +141,7 @@ fn recorded_thumbnail_click_on_another_layer_saves_and_replays_by_name() {
s.execute("layer.new.layer", json!({"name": "Active"})).unwrap();
source
};
let mut s = Session::new();
let mut s = crate::session();
let source = fixture(&mut s);
let background = s.active().unwrap().doc.background().unwrap().id.0;
s.execute("actions.record", json!({"name": "Load"})).unwrap();
@@ -158,7 +158,7 @@ fn recorded_thumbnail_click_on_another_layer_saves_and_replays_by_name() {
);
crate::atn_cmds::export("Set", &[&action], &[], false).unwrap();
// Replayed in another document, the first step loads its Source layer.
let mut other = Session::new();
let mut other = crate::session();
fixture(&mut other);
let ActionStep { command: id, params } = &action.steps[0];
other.execute(id, params.clone()).unwrap();
@@ -168,7 +168,7 @@ fn recorded_thumbnail_click_on_another_layer_saves_and_replays_by_name() {
#[test]
fn rename_keeps_calls_and_function_key_and_rejects_bad_names() {
let mut s = Session::new();
let mut s = crate::session();
s.actions
.list
.push(Action {
@@ -208,7 +208,7 @@ fn rename_keeps_calls_and_function_key_and_rejects_bad_names() {
#[test]
fn rename_follows_conditional_branches() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
for name in ["B", "Other"] {
s.actions.list.push(Action { name: name.into(), steps: vec![ActionStep::new("layer.new.layer", json!({}))], ..Default::default() }).unwrap();
@@ -234,7 +234,7 @@ fn rename_follows_conditional_branches() {
#[test]
fn delete_action_drops_its_function_key_but_deleting_a_step_keeps_it() {
let mut s = Session::new();
let mut s = crate::session();
let key = format!("{PLAY_SHORTCUT_PREFIX}Action 1");
s.actions.list.push(Action::new("Action 1", vec![ActionStep::new("layer.new.layer", json!({})), ActionStep::new("layer.new.layer", json!({}))])).unwrap();
s.edit_prefs(|p| p.shortcuts.insert(key.clone(), "F2".into()));
@@ -273,7 +273,7 @@ fn translated_square(s: &mut Session, depth: u32) {
#[test]
fn record_transform_again_replays_one_concrete_transform_at_each_depth() {
for depth in [8, 16, 32] {
let mut s = Session::new();
let mut s = crate::session();
translated_square(&mut s, depth);
let from = s.journal.len();
s.execute("actions.record", json!({"name": "Again"})).unwrap();
@@ -310,7 +310,7 @@ fn record_transform_again_replays_one_concrete_transform_at_each_depth() {
#[test]
fn record_transform_again_on_a_copy_replays_in_a_session_without_a_transform() {
for depth in [8, 16] {
let mut s = Session::new();
let mut s = crate::session();
translated_square(&mut s, depth);
s.execute("actions.record", json!({"name": "Step"})).unwrap();
s.execute("edit.transform.againCopy", json!({})).unwrap();
@@ -321,7 +321,7 @@ fn record_transform_again_on_a_copy_replays_in_a_session_without_a_transform() {
let action = s.actions.list.actions()[0].clone();
// A new session has no transform to repeat: the concrete steps still play.
let mut fresh = Session::new();
let mut fresh = crate::session();
fresh.execute("file.new", json!({"width": 20, "height": 8, "depth": depth, "background": "transparent"})).unwrap();
fresh
.edit("red square", |doc, _| {
@@ -344,7 +344,7 @@ fn record_transform_again_on_a_copy_replays_in_a_session_without_a_transform() {
fn record_drops_the_steps_of_a_command_that_failed_and_was_taken_back() {
// Transform Again on a Copy of a position-locked layer duplicates it, fails to move the
// copy and takes the copy back: nothing is left to record.
let mut s = Session::new();
let mut s = crate::session();
translated_square(&mut s, 8);
let id = s.active().unwrap().active_layer.unwrap();
s.execute("layer.setProps", json!({"layer": id.0, "locks": {"position": true}})).unwrap();
@@ -364,7 +364,7 @@ fn record_drops_the_steps_of_a_command_that_failed_and_was_taken_back() {
#[test]
fn record_script_that_plays_an_action_keeps_each_step_once() {
let mut s = Session::new();
let mut s = crate::session();
translated_square(&mut s, 8);
s.execute("actions.record", json!({"name": "Inner"})).unwrap();
s.execute("edit.transform", json!({"matrix": [1, 0, 0, 1, 1, 0], "interpolation": "nearest"})).unwrap();
@@ -382,7 +382,7 @@ fn record_script_that_plays_an_action_keeps_each_step_once() {
#[test]
fn record_explicit_transform_keeps_one_replayable_step() {
let mut s = Session::new();
let mut s = crate::session();
translated_square(&mut s, 8);
s.execute("actions.record", json!({"name": "Move"})).unwrap();
s.execute("edit.transform", json!({"matrix": [1, 0, 0, 1, 4, 0], "interpolation": "nearest"})).unwrap();
@@ -402,7 +402,7 @@ fn record_explicit_transform_keeps_one_replayable_step() {
#[test]
fn recording_folds_one_run_of_move_tool_nudges() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 24, "height": 24, "background": "transparent"})).unwrap();
s.execute("layer.new.layer", json!({"name": "Target"})).unwrap();
s.execute("actions.record", json!({"name": "Nudge"})).unwrap();
@@ -417,7 +417,7 @@ fn recording_folds_one_run_of_move_tool_nudges() {
/// Pattern Preview nudges fold when `wrap` matches, and stay separate when it does not.
#[test]
fn recording_folds_wrapped_move_tool_nudges() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 24, "height": 24, "background": "transparent"})).unwrap();
s.execute("layer.new.layer", json!({"name": "Target"})).unwrap();
s.execute("actions.record", json!({"name": "Nudge"})).unwrap();
@@ -437,7 +437,7 @@ fn recording_folds_wrapped_move_tool_nudges() {
/// Each nudge moves by whole pixels, so two 0.6 px steps fold into the 2 px they moved, not 1.2.
#[test]
fn folded_nudges_add_whole_pixel_steps() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 24, "height": 24, "background": "transparent"})).unwrap();
s.execute("layer.new.layer", json!({"name": "Target"})).unwrap();
s.execute("actions.record", json!({"name": "Nudge"})).unwrap();
@@ -450,7 +450,7 @@ fn folded_nudges_add_whole_pixel_steps() {
#[test]
fn recording_document_activation_uses_opening_order_offset() {
let mut s = Session::new();
let mut s = crate::session();
for name in ["First", "Second"] {
s.execute("file.new", json!({"width": 8, "height": 8, "name": name})).unwrap();
}
@@ -462,7 +462,7 @@ fn recording_document_activation_uses_opening_order_offset() {
#[test]
fn recorded_point_text_position_scales_with_the_playback_canvas() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 100, "height": 100, "background": "transparent"})).unwrap();
s.execute("actions.record", json!({"name": "Caption"})).unwrap();
s.execute("type.create", json!({"x": 20, "y": 30, "text": "Hi", "size": 12})).unwrap();
@@ -479,7 +479,7 @@ fn recorded_point_text_position_scales_with_the_playback_canvas() {
#[test]
fn recorded_point_text_rejects_invalid_relative_positions() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 100, "height": 100})).unwrap();
for params in [
json!({"xPercent": 20}),
@@ -494,7 +494,7 @@ fn recorded_point_text_rejects_invalid_relative_positions() {
#[test]
fn recorded_single_layer_transform_replays_after_layer_ids_shift() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 20, "height": 8, "background": "transparent"})).unwrap();
let source = s.execute("layer.new.layer", json!({"name": "Target"})).unwrap()["layer"].as_u64().unwrap();
s.edit("source pixel", |doc, _| {
@@ -551,7 +551,7 @@ fn record_command_that_runs_commands_replays_it_once() {
// Straighten Layer runs Image Rotation and Crop itself: only its own call is recorded,
// so playback rotates once, not three times (rotate, crop, then straighten again).
for depth in [8, 16] {
let mut s = Session::new();
let mut s = crate::session();
ruled_layer(&mut s, depth);
s.execute("actions.record", json!({"name": "Level"})).unwrap();
s.execute("image.analysis.rulerTool", json!({"start": [10, 30], "end": [70, 25]})).unwrap();
@@ -580,7 +580,7 @@ fn record_command_that_runs_commands_replays_it_once() {
#[test]
fn record_keeps_only_replayable_steps() {
let mut s = Session::new();
let mut s = crate::session();
record_red(&mut s, 8);
let got = s.execute("actions.get", json!({"action": "Red"})).unwrap();
let ids: Vec<&str> = got["steps"].as_array().unwrap().iter().map(|st| st[0].as_str().unwrap()).collect();
@@ -595,7 +595,7 @@ fn record_keeps_only_replayable_steps() {
/// Playback on a different document must match native edits at every depth, independent of history grouping.
fn play_on_another_document_matches_pixels_at_each_depth() {
for depth in [8, 16, 32] {
let mut s = Session::new();
let mut s = crate::session();
// This control checks the optional, per-step history behavior.
s.execute("actions.setHistory", json!({"singleState": false})).unwrap();
record_red(&mut s, depth);
@@ -615,7 +615,7 @@ fn play_on_another_document_matches_pixels_at_each_depth() {
#[test]
fn recorded_layer_selection_replays_by_name_on_another_document() {
for depth in [8, 16, 32] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8, "depth": depth})).unwrap();
let original = s.active().unwrap().active_layer.unwrap();
s.execute("layer.setProps", json!({"name": "Photo"})).unwrap();
@@ -629,7 +629,7 @@ fn recorded_layer_selection_replays_by_name_on_another_document() {
assert_eq!(s.actions.list.actions()[0].steps[0].params, json!({"name":"Photo", "mode":"replace"}));
// Persisted actions must work in an entirely different session too.
let saved = s.actions.list.to_file().to_json().unwrap();
let mut replay = Session::new();
let mut replay = crate::session();
replay.actions.list = ActionList::from_file(ActionsFile::from_json(&saved).unwrap());
replay.execute("file.new", json!({"width": 8, "height": 8, "depth": depth})).unwrap();
replay.execute("layer.setProps", json!({"name": "Photo"})).unwrap();
@@ -660,7 +660,7 @@ fn recorded_mask_drop_replays_on_another_document() {
id
};
let has_mask = |s: &Session, name: &str| s.active().unwrap().doc.walk().iter().any(|(_, _, l)| l.name == name && l.mask.is_some());
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
let photo = masked(&mut s, "Photo");
let shadow = s.execute("layer.new.layer", json!({"name": "Shadow"})).unwrap()["layer"].as_u64().unwrap();
@@ -670,7 +670,7 @@ fn recorded_mask_drop_replays_on_another_document() {
assert_eq!(s.actions.list.actions()[0].steps[0].params, json!({"layer": "Photo", "to": "Shadow", "copy": false}));
// Another document: an extra layer between them, so the recorded id is a different layer.
let saved = s.actions.list.to_file().to_json().unwrap();
let mut replay = Session::new();
let mut replay = crate::session();
replay.actions.list = ActionList::from_file(ActionsFile::from_json(&saved).unwrap());
replay.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
masked(&mut replay, "Photo");
@@ -699,7 +699,7 @@ fn recorded_mask_drop_onto_a_duplicate_name_replays_on_the_same_layer() {
(photo, lower, upper)
};
let mask_on = |s: &Session, id: u64| s.active().unwrap().doc.layer(photocraft_doc::LayerId(id)).unwrap().mask.is_some();
let mut s = Session::new();
let mut s = crate::session();
let (photo, lower, upper) = build(&mut s, false);
s.execute("actions.record", json!({"name": "Copy mask"})).unwrap();
s.execute("layer.layerMask.moveTo", json!({"layer": photo, "to": lower, "copy": true})).unwrap();
@@ -707,7 +707,7 @@ fn recorded_mask_drop_onto_a_duplicate_name_replays_on_the_same_layer() {
assert_eq!(s.actions.list.actions()[0].steps[0].params, json!({"layer": "Photo", "to": "Twin", "toOccurrence": 0, "copy": true}));
assert!(mask_on(&s, lower) && !mask_on(&s, upper));
let saved = s.actions.list.to_file().to_json().unwrap();
let mut replay = Session::new();
let mut replay = crate::session();
replay.actions.list = ActionList::from_file(ActionsFile::from_json(&saved).unwrap());
let (photo2, lower2, upper2) = build(&mut replay, true);
assert_ne!((photo, lower, upper), (photo2, lower2, upper2), "the ids differ");
@@ -729,7 +729,7 @@ fn recorded_mask_drop_onto_a_duplicate_name_replays_on_the_same_layer() {
#[test]
fn recorded_layer_drag_replays_on_another_document() {
for depth in [8, 16, 32] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 16, "height": 16, "depth": depth})).unwrap();
s.execute("actions.record", json!({"name": "Retouch"})).unwrap();
s.execute("layer.stampVisible", json!({})).unwrap();
@@ -747,7 +747,7 @@ fn recorded_layer_drag_replays_on_another_document() {
let names = |s: &Session| s.active().unwrap().doc.layers.iter().rev().map(|l| l.name.clone()).collect::<Vec<_>>();
let recorded = names(&s);
let saved = s.actions.list.to_file().to_json().unwrap();
let mut replay = Session::new();
let mut replay = crate::session();
replay.actions.list = ActionList::from_file(ActionsFile::from_json(&saved).unwrap());
replay.execute("file.new", json!({"width": 16, "height": 16, "depth": depth})).unwrap();
let result = replay.execute("actions.play", json!({"action": 0})).unwrap();
@@ -755,7 +755,7 @@ fn recorded_layer_drag_replays_on_another_document() {
assert_eq!(names(&replay), recorded, "{depth}: the same stack");
}
// Several layers of the drop target's name: the recorded occurrence picks the right one.
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
s.execute("layer.new.layer", json!({"name": "Twin"})).unwrap();
s.execute("layer.new.layer", json!({"name": "Twin"})).unwrap();
@@ -775,7 +775,7 @@ fn recorded_layer_drag_replays_on_another_document() {
}
s.active().unwrap().doc.layers.iter().map(|l| l.id).collect::<Vec<_>>()
};
let mut s = Session::new();
let mut s = crate::session();
let ids = build(&mut s);
let (lowest, top) = (ids[1], ids[3]);
s.execute("actions.record", json!({"name": "Twins"})).unwrap();
@@ -785,7 +785,7 @@ fn recorded_layer_drag_replays_on_another_document() {
let order = |s: &Session| s.active().unwrap().doc.layers.iter().map(|l| l.id).collect::<Vec<_>>();
let want: Vec<_> = order(&s).iter().map(|id| ids.iter().position(|x| x == id).unwrap()).collect();
let saved = s.actions.list.to_file().to_json().unwrap();
let mut replay = Session::new();
let mut replay = crate::session();
replay.actions.list = ActionList::from_file(ActionsFile::from_json(&saved).unwrap());
let ids2 = build(&mut replay);
let result = replay.execute("actions.play", json!({"action": 0})).unwrap();
@@ -805,14 +805,14 @@ fn recorded_layer_drag_replays_on_another_document() {
s.execute("layer.select", json!({"layer": group.0, "mode": "replace"})).unwrap();
(group, top)
};
let mut g = Session::new();
let mut g = crate::session();
let (group, top) = build_group(&mut g);
g.execute("actions.record", json!({"name": "Group"})).unwrap();
g.execute("layer.moveTo", json!({"layer": group.0, "target": top.0, "position": "above"})).unwrap();
g.execute("actions.stop", json!({})).unwrap();
let recorded = g.actions.list.actions()[0].steps[0].params.clone();
let saved = g.actions.list.to_file().to_json().unwrap();
let mut replay = Session::new();
let mut replay = crate::session();
replay.actions.list = ActionList::from_file(ActionsFile::from_json(&saved).unwrap());
let (group2, _) = build_group(&mut replay);
let result = replay.execute("actions.play", json!({"action": 0})).unwrap();
@@ -820,7 +820,7 @@ fn recorded_layer_drag_replays_on_another_document() {
let top_layer = |s: &Session| s.active().unwrap().doc.layers.last().map(|l| l.id);
assert_eq!(top_layer(&replay), Some(group2), "{recorded}: the group went to the top");
// Several moved layers named like the target are left out too, so the name is unambiguous.
let mut m = Session::new();
let mut m = crate::session();
m.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
let a = photocraft_doc::LayerId(m.execute("layer.new.layer", json!({"name": "Twin"})).unwrap()["layer"].as_u64().unwrap());
let b = photocraft_doc::LayerId(m.execute("layer.new.layer", json!({"name": "Twin"})).unwrap()["layer"].as_u64().unwrap());
@@ -829,7 +829,7 @@ fn recorded_layer_drag_replays_on_another_document() {
assert_eq!(m.active().unwrap().doc.layers.last().map(|l| l.id), Some(b), "both moved above the third Twin");
assert_eq!(m.active().unwrap().doc.layers.iter().rev().nth(2).map(|l| l.id), Some(target));
// An ⌥-drag copy of the selected layer beside itself replays by name too.
let mut c = Session::new();
let mut c = crate::session();
c.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
let src = photocraft_doc::LayerId(c.execute("layer.new.layer", json!({"name": "Solo"})).unwrap()["layer"].as_u64().unwrap());
c.execute("actions.record", json!({"name": "Copy"})).unwrap();
@@ -837,7 +837,7 @@ fn recorded_layer_drag_replays_on_another_document() {
c.execute("actions.stop", json!({})).unwrap();
assert_eq!(c.actions.list.actions()[0].steps[0].params, json!({"target": "Solo", "position": "above", "copy": true}));
let saved = c.actions.list.to_file().to_json().unwrap();
let mut replay = Session::new();
let mut replay = crate::session();
replay.actions.list = ActionList::from_file(ActionsFile::from_json(&saved).unwrap());
replay.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
replay.execute("layer.new.layer", json!({"name": "Solo"})).unwrap();
@@ -857,14 +857,14 @@ fn recorded_layer_drag_replays_on_another_document() {
s.execute("layer.select", json!({"layer": group.0, "mode": "replace"})).unwrap();
(group, a, b)
};
let mut gc = Session::new();
let mut gc = crate::session();
let (group, a, _) = build_copy(&mut gc);
gc.execute("actions.record", json!({"name": "Copy group"})).unwrap();
// Below `a`: the copy's "Twin" then comes before `a` in document order.
gc.execute("layer.moveTo", json!({"layer": group.0, "target": a.0, "position": "below", "copy": true})).unwrap();
gc.execute("actions.stop", json!({})).unwrap();
let saved = gc.actions.list.to_file().to_json().unwrap();
let mut replay = Session::new();
let mut replay = crate::session();
replay.actions.list = ActionList::from_file(ActionsFile::from_json(&saved).unwrap());
let (_, a2, _) = build_copy(&mut replay);
let result = replay.execute("actions.play", json!({"action": 0})).unwrap();
@@ -895,7 +895,7 @@ fn recorded_layer_drag_replays_on_another_document() {
/// than exported as a copy beside the original.
#[test]
fn recorded_in_place_duplicate_keeps_in_place_only_for_artboards() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
s.execute("actions.record", json!({"name": "Layer copy"})).unwrap();
s.execute("layer.duplicate", json!({"inPlace": true})).unwrap();
@@ -909,7 +909,7 @@ fn recorded_in_place_duplicate_keeps_in_place_only_for_artboards() {
assert!(crate::atn_cmds::export("Audit", &[&s.actions.list.actions()[0]], &[], false).is_ok());
assert!(crate::atn_cmds::export("Audit", &[&s.actions.list.actions()[1]], &[], false).is_err());
// Several selected layers are copied together: one artboard among them keeps `inPlace`.
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
let photo = s.active().unwrap().active_layer.unwrap();
s.execute("layer.new.layer", json!({"name": "Logo"})).unwrap();
@@ -929,7 +929,7 @@ fn recorded_in_place_duplicate_keeps_in_place_only_for_artboards() {
#[test]
fn named_selection_preserves_modes_and_duplicate_occurrences() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width":4,"height":4})).unwrap();
s.execute("layer.setProps", json!({"name":"Photo"})).unwrap();
let first = s.active().unwrap().active_layer.unwrap();
@@ -1002,7 +1002,7 @@ fn named_selection_preserves_modes_and_duplicate_occurrences() {
#[test]
fn play_stops_at_the_failing_step_and_reports_it() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 16, "height": 16})).unwrap();
s.execute("actions.record", json!({})).unwrap();
s.execute("layer.new.layer", json!({"name": "One"})).unwrap();
@@ -1023,7 +1023,7 @@ fn play_stops_at_the_failing_step_and_reports_it() {
#[test]
fn play_refuses_recursion() {
let mut s = Session::new();
let mut s = crate::session();
s.actions
.list
.push(Action {
@@ -1046,7 +1046,7 @@ fn play_checks_each_step_with_the_authorize_hook() {
fn deny_file(id: &str, _: &Value) -> Result<()> {
if id.starts_with("file.") { Err(EngineError::Other(format!("automation command `{id}` is disabled"))) } else { Ok(()) }
}
let mut s = Session::new();
let mut s = crate::session();
s.authorize = Some(deny_file);
s.actions
.list
@@ -1075,7 +1075,7 @@ fn actions_automation_wrote_keep_its_gate_when_the_user_plays_them() {
if id.starts_with("file.") { Err(EngineError::Other(format!("automation command `{id}` is disabled"))) } else { Ok(()) }
}
let open = || ActionStep::new("file.openAs", json!({"path": "/outside/secret.png"}));
let mut s = Session::new();
let mut s = crate::session();
s.automation_gate = Some(deny_file);
s.actions.list.push(Action::new("Mine", vec![open()])).unwrap();
s.actions.list.push(Action::new("Edited", vec![ActionStep::new("layer.new.layer", json!({}))])).unwrap();
@@ -1124,7 +1124,7 @@ fn a_step_automation_runs_into_the_users_recording_keeps_its_gate() {
fn admit(_: &str, _: &Value) -> Result<()> {
Ok(())
}
let mut s = Session::new();
let mut s = crate::session();
s.automation_gate = Some(deny_file);
// The user records an action of their own: it is not marked.
s.execute("actions.record", json!({"name": "Mine"})).unwrap();
@@ -1164,7 +1164,7 @@ fn a_step_automation_runs_into_the_users_recording_keeps_its_gate() {
#[test]
fn append_delete_and_from_step() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8, "background": "white"})).unwrap();
let started = s.execute("actions.record", json!({"name": "Grow"})).unwrap();
assert_eq!(started["index"], 0);
@@ -1188,7 +1188,7 @@ fn append_delete_and_from_step() {
#[test]
fn delete_one_step_while_recording_keeps_journal_and_remaining_steps() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
s.execute("actions.record", json!({"name": "Edit"})).unwrap();
s.execute("layer.new.layer", json!({"name": "Kept"})).unwrap();
@@ -1224,7 +1224,7 @@ fn delete_one_step_while_recording_keeps_journal_and_remaining_steps() {
#[test]
fn nested_call_records_one_named_step_and_tracks_child_edits() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 4, "height": 4})).unwrap();
s.actions
.list
@@ -1259,7 +1259,7 @@ fn nested_call_records_one_named_step_and_tracks_child_edits() {
#[test]
fn nested_failure_cycles_depth_and_authorization_stop_parent() {
let mut s = Session::new();
let mut s = crate::session();
s.actions
.list
.push(Action {
@@ -1309,7 +1309,7 @@ fn nested_failure_cycles_depth_and_authorization_stop_parent() {
#[test]
fn move_pending_steps_is_atomic_persists_and_changes_playback_order() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 4, "height": 4})).unwrap();
s.execute("actions.record", json!({"name": "Order"})).unwrap();
for name in ["One", "Two", "Three"] {
@@ -1340,7 +1340,7 @@ fn move_pending_steps_is_atomic_persists_and_changes_playback_order() {
#[test]
fn new_names_do_not_collide_with_named_calls() {
let mut s = Session::new();
let mut s = crate::session();
s.actions.list.push(Action { name: "Action 2".into(), steps: vec![], disabled: Default::default(), ..Default::default() }).unwrap();
assert_eq!(s.execute("actions.record", json!({})).unwrap()["action"], "Action 3");
s.execute("actions.stop", json!({})).unwrap();
@@ -1350,7 +1350,7 @@ fn new_names_do_not_collide_with_named_calls() {
#[test]
fn moving_action_keeps_recording_attached_to_it() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width":4,"height":4})).unwrap();
for name in ["A", "B", "C"] {
s.actions.list.push(Action { name: name.into(), steps: vec![], disabled: Default::default(), ..Default::default() }).unwrap();
@@ -1367,7 +1367,7 @@ fn moving_action_keeps_recording_attached_to_it() {
#[test]
fn bad_params_do_not_panic() {
let mut s = Session::new();
let mut s = crate::session();
let junk = [
Value::Null,
json!([]),
@@ -1397,7 +1397,7 @@ fn bad_params_do_not_panic() {
fn actions_persist_with_the_preset_store() {
let dir = std::env::temp_dir().join(format!("pc-actions-{}-persist", std::process::id()));
let _ = std::fs::remove_dir_all(&dir);
let mut s = Session::new();
let mut s = crate::session();
let warnings = s.attach_preset_store(crate::preset_store::open_dir(&dir));
assert!(warnings.iter().all(|w| !w.contains("actions")), "{warnings:?}");
s.execute("file.new", json!({"width": 4, "height": 4})).unwrap();
@@ -1406,7 +1406,7 @@ fn actions_persist_with_the_preset_store() {
s.execute("actions.stop", json!({})).unwrap();
drop(s);
let mut t = Session::new();
let mut t = crate::session();
t.attach_preset_store(crate::preset_store::open_dir(&dir));
let listed = t.execute("actions.list", json!({})).unwrap();
assert_eq!(listed["actions"][0]["name"], "Kept");
@@ -1415,7 +1415,7 @@ fn actions_persist_with_the_preset_store() {
// An action created before the store finishes loading is kept, and a different one on
// disk is merged in.
let mut early = Session::new();
let mut early = crate::session();
early.execute("actions.record", json!({"name": "Early"})).unwrap();
early.execute("actions.stop", json!({})).unwrap();
early.attach_preset_store(crate::preset_store::open_dir(&dir));
@@ -1423,7 +1423,7 @@ fn actions_persist_with_the_preset_store() {
assert!(names.contains(&"Early".into()) && names.contains(&"Kept".into()), "{names:?}");
std::fs::write(dir.join("actions.json"), b"{").unwrap();
let mut bad = Session::new();
let mut bad = crate::session();
let warnings = bad.attach_preset_store(crate::preset_store::open_dir(&dir));
assert!(warnings.iter().any(|w| w.contains("actions")), "{warnings:?}");
assert!(bad.actions.list.actions().is_empty());
@@ -1434,7 +1434,7 @@ fn actions_persist_with_the_preset_store() {
/// a selection fill and styled text all act on the document the replay runs in.
#[test]
fn a_recorded_edit_run_replays_on_a_second_document() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 64, "height": 64, "background": "white"})).unwrap();
s.execute("actions.record", json!({"name": "Studio"})).unwrap();
s.execute("image.crop", json!({"x": 8, "y": 8, "width": 48, "height": 48})).unwrap();
@@ -1472,7 +1472,7 @@ fn a_recorded_edit_run_replays_on_a_second_document() {
#[test]
fn button_color_is_one_of_the_photoshop_swatches() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("actions.record", json!({"name": "Print"})).unwrap();
s.execute("actions.stop", json!({})).unwrap();
let set = s.execute("actions.setColor", json!({"action": "Print", "color": "blue"})).unwrap();
@@ -1494,7 +1494,7 @@ fn button_color_is_one_of_the_photoshop_swatches() {
/// An arrangement that cannot move the layer must not create a grouped history entry.
fn arrange_that_cannot_move_is_a_noop_in_playback() {
// #8453: imported actions make an adjustment layer, then Bring it to Front, where it already is.
let mut s = Session::new();
let mut s = crate::session();
// Keep individual rows visible so grouping cannot hide an extra no-op record.
s.execute("actions.setHistory", json!({"singleState": false})).unwrap();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
@@ -1613,7 +1613,7 @@ fn scoped_source_slots_do_not_bind_previously_missing_references() {
assert_eq!(called.len(), 4);
assert_eq!(called.last(), list.first(), "the scoped source keeps its embedded index");
assert!(resolve(&called, &called[0].steps[0].params, "actions.play").is_err(), "the ordinary source still has a missing target");
let mut session = Session::new();
let mut session = crate::session();
session.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
session.actions.list = list_of(called);
let (id, params) = steps.last().unwrap();
@@ -1626,7 +1626,7 @@ fn scoped_source_slots_do_not_bind_previously_missing_references() {
/// surrounding spaces (from an older actions.json); a new set name is trimmed.
#[test]
fn record_keeps_an_existing_sets_exact_name() {
let mut s = Session::new();
let mut s = crate::session();
s.actions.list.push(Action { set: Some(" Web ".into()), ..Action::new("Old", Vec::new()) }).unwrap();
s.execute("actions.record", json!({"name": "New", "set": " Web "})).unwrap();
s.execute("actions.stop", json!({})).unwrap();
@@ -1641,10 +1641,10 @@ fn record_keeps_an_existing_sets_exact_name() {
/// exact name too, so the first action recorded into it lands in that folder and saves with it.
#[test]
fn record_keeps_an_empty_loaded_sets_exact_name() {
let mut src = Session::new();
let mut src = crate::session();
src.actions.list.replace(ActionList::from_file(ActionsFile::new(Vec::new(), vec![" Web ".into()])));
let saved = src.execute("actions.save", json!({"set": " Web "})).unwrap();
let mut s = Session::new();
let mut s = crate::session();
assert_eq!(s.execute("actions.load", json!({"data": saved["data"]})).unwrap()["set"], " Web ");
s.execute("actions.record", json!({"name": "First", "set": " Web "})).unwrap();
s.execute("actions.stop", json!({})).unwrap();
@@ -1656,7 +1656,7 @@ fn record_keeps_an_empty_loaded_sets_exact_name() {
#[test]
fn skipped_steps_count_against_the_script_limit() {
let mut s = Session::new();
let mut s = crate::session();
s.actions.list.push(Action::new("A", (0..3).map(|_| ActionStep::new("select.all", json!({}))).collect())).unwrap();
s.actions.script_depth = 1;
s.actions.script_steps = crate::automate_cmds::MAX_SCRIPT_STEPS - 1;
@@ -1718,7 +1718,7 @@ fn rename_leaves_calls_that_reach_another_sets_action_alone() {
]
};
let session = || {
let mut s = Session::new();
let mut s = crate::session();
let file = ["A", "B"]
.map(|set| Action { set: Some(set.into()), ..Action::new("Target", vec![ActionStep::new("image.adjustments.invert", json!({}))]) })
.into_iter()
@@ -1752,7 +1752,7 @@ fn rename_leaves_calls_that_reach_another_sets_action_alone() {
/// a Batch naming the same action in another set and an inline Batch stay as they were.
#[test]
fn rename_follows_named_batch_steps_in_their_set() {
let mut s = Session::new();
let mut s = crate::session();
let mut target = Action::new("Target", vec![ActionStep::new("image.adjustments.invert", json!({}))]);
target.set = Some("S".into());
s.actions.list.push(target).unwrap();
@@ -1783,7 +1783,7 @@ fn playback_stops_when_a_nested_batch_cannot_write_its_error_log() {
let _ = std::fs::remove_dir_all(&dir);
std::fs::create_dir_all(&dir).unwrap();
let dir = dir.to_string_lossy().into_owned();
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 4, "height": 4})).unwrap();
// A folder as the log path: the log write fails while every file succeeds.
let batch = json!({"source": "open", "steps": [], "output": format!("{dir}/out"), "format": "png", "errorLog": dir});
@@ -507,7 +507,7 @@ mod tests {
use crate::actions_cmds::Action;
fn session_with(steps: &[&str]) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
s.actions.list.push(Action::new("A", steps.iter().map(|id| ActionStep::new(*id, json!({}))).collect())).unwrap();
s
@@ -619,7 +619,7 @@ mod tests {
assert_eq!(played["failed"]["step"], 0, "{played}");
assert_ne!(names(&s).last().map(String::as_str), Some("after"));
// Without a document only always/never answer; layer conditions are false.
let t = Session::new();
let t = crate::session();
assert!(evaluate(&t, "always").unwrap());
assert!(!evaluate(&t, "isOpen").unwrap());
assert!(!evaluate(&t, "isBackground").unwrap());
@@ -697,7 +697,7 @@ mod tests {
}
fn record_conditional(width: u32, height: u32) -> (Session, usize) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": width, "height": height})).unwrap();
s.actions.list.push(Action::new("Tall", vec![ActionStep::new("layer.new.layer", json!({"name": "Tall"}))])).unwrap();
let layers = s.active().unwrap().doc.walk().len();
@@ -29,7 +29,7 @@ fn set(caption: &str, action: Option<(&str, u16)>) -> Vec<u8> {
#[test]
fn confirmed_clear_restores_both_shortcut_maps_without_document_history() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width":8,"height":8})).unwrap();
s.actions.list.push(Action::new("Original", Vec::new())).unwrap();
s.actions.list.new_set("Empty").unwrap();
@@ -64,7 +64,7 @@ fn confirmed_clear_restores_both_shortcut_maps_without_document_history() {
// An edit after a library command ends its undo; so does a change to the action shortcuts.
#[test]
fn any_later_edit_ends_the_library_undo() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("actions.reset", json!({"confirm":true,"mode":"replace"})).unwrap();
s.execute("actions.newSet", json!({"name":"Later"})).unwrap();
assert!(s.execute("actions.undoLibrary", json!({})).is_err());
@@ -76,7 +76,7 @@ fn any_later_edit_ends_the_library_undo() {
#[test]
fn reset_appends_a_numbered_set_and_persists_it() {
let store = MemBackend::default();
let mut s = Session::new();
let mut s = crate::session();
s.attach_preset_store(open(Box::new(store.clone())));
s.actions.list.new_set("Existing").unwrap();
assert!(s.execute("actions.reset", json!({"confirm":true,"mode":"bad"})).is_err());
@@ -87,7 +87,7 @@ fn reset_appends_a_numbered_set_and_persists_it() {
assert_eq!(s.actions.list.actions()[0].steps[0].command, "image.adjustments.invert");
assert_eq!(s.actions.list.actions()[1].steps[0].command, "image.adjustments.desaturate");
s.sync_preset_store();
let mut reopened = Session::new();
let mut reopened = crate::session();
reopened.attach_preset_store(open(Box::new(store)));
assert_eq!(reopened.actions.list.actions(), s.actions.list.actions());
assert_eq!(reopened.actions.list.sets(), s.actions.list.sets());
@@ -100,7 +100,7 @@ fn reset_appends_a_numbered_set_and_persists_it() {
#[test]
fn whole_replace_validates_the_tail_and_keeps_every_set_in_order() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("actions.reset", json!({"confirm":true,"mode":"append"})).unwrap();
let prior = s.actions.list.actions().to_vec();
let mut archive = set("Repeated", Some(("Action", 2)));
@@ -129,7 +129,7 @@ fn whole_replace_validates_the_tail_and_keeps_every_set_in_order() {
// Two actions one set gives the same name keep their own function keys.
#[test]
fn atn_load_keeps_function_keys_of_repeated_names_separate() {
let mut s = Session::new();
let mut s = crate::session();
let result = s.execute("actions.load", json!({"data":b64(&set_of("Keys", &[("Same", 2), ("Same", 3)]))})).unwrap();
assert_eq!(result["functionKeys"], json!([{"action":"Same","key":"F2"},{"action":"Same 2","key":"F3"}]));
assert_eq!(s.prefs().shortcuts[&format!("{PLAY_SHORTCUT_PREFIX}Same")], "F2");
@@ -139,7 +139,7 @@ fn atn_load_keeps_function_keys_of_repeated_names_separate() {
/// Imported calls look in their own set before falling back to the first archive name.
#[test]
fn whole_replace_resolves_unqualified_calls_in_their_own_set() {
let mut s = Session::new();
let mut s = crate::session();
let mut archive = set("Repeated", Some(("Child", 0)));
let child = Action::new("Child", Vec::new());
let parent = Action::new("Parent", vec![ActionStep::new("actions.play", json!({"action":"Child"}))]);
@@ -166,7 +166,7 @@ fn whole_replace_follows_explicit_atn_set_scopes() {
let mut archive = set("First", Some(("Target", 0)));
let (tail, _) = crate::atn_cmds::export("Second", &[&second, &caller], &[], false).unwrap();
archive.extend_from_slice(&tail[4..]);
let mut s = Session::new();
let mut s = crate::session();
let result = s.execute("actions.replace", json!({"confirm":true,"data":b64(&archive)})).unwrap();
assert_eq!(result["actions"], json!(["Target", "Target 2", "Caller"]));
let list = s.actions.list.actions();
@@ -187,7 +187,7 @@ fn whole_replace_keeps_diagnostics_on_their_archive_actions() {
let mut archive = set("First", Some(("Target", 0)));
let (tail, _) = crate::atn_cmds::export("Second", &[&first, &second], &[], false).unwrap();
archive.extend_from_slice(&tail[4..]);
let mut s = Session::new();
let mut s = crate::session();
let result = s.execute("actions.replace", json!({"confirm":true,"data":b64(&archive)})).unwrap();
assert_eq!(result["actions"], json!(["Target", "Target 2", "Target 3"]));
assert_eq!(result["unsupported"].as_array().unwrap().len(), 1);
@@ -199,7 +199,7 @@ fn whole_replace_keeps_diagnostics_on_their_archive_actions() {
#[test]
fn shortcut_only_clear_restores_orphan_bindings_on_undo() {
let mut s = Session::new();
let mut s = crate::session();
let orphan = "actions.play:Missing";
s.edit_prefs(|prefs| {
prefs.shortcuts.insert(orphan.into(), "F2".into());
@@ -222,7 +222,7 @@ fn pre_attachment_replacement_persists_without_reloading_disk_and_keeps_undo() {
for undo_before_attachment in [false, true] {
let store = MemBackend::default();
store.write(ACTIONS_FILE, br#"{"version":1,"actions":[{"name":"Disk","set":"Saved"}]}"#).unwrap();
let mut s = Session::new();
let mut s = crate::session();
s.actions.list.push(Action::new("Early", Vec::new())).unwrap();
s.execute("actions.reset", json!({"confirm":true,"mode":"replace"})).unwrap();
if undo_before_attachment {
@@ -236,13 +236,13 @@ fn pre_attachment_replacement_persists_without_reloading_disk_and_keeps_undo() {
assert_eq!(s.actions.list.sets(), ["PhotoCraft Basics"]);
assert_eq!(names(&s), ["Invert Colors", "Desaturate"]);
let mut reopened = Session::new();
let mut reopened = crate::session();
assert!(reopened.attach_preset_store(open(Box::new(store.clone()))).is_empty());
assert_eq!(reopened.actions.list.actions(), s.actions.list.actions());
s.execute("actions.undoLibrary", json!({})).unwrap();
assert_eq!(names(&s), ["Early"]);
s.sync_preset_store();
let mut reopened = Session::new();
let mut reopened = crate::session();
assert!(reopened.attach_preset_store(open(Box::new(store))).is_empty());
assert_eq!(reopened.actions.list.actions(), s.actions.list.actions());
}
@@ -252,14 +252,14 @@ fn pre_attachment_replacement_persists_without_reloading_disk_and_keeps_undo() {
fn pre_attachment_clear_remains_authoritative_after_an_ordinary_edit() {
let store = MemBackend::default();
store.write(ACTIONS_FILE, br#"{"version":1,"actions":[{"name":"Disk"}]}"#).unwrap();
let mut s = Session::new();
let mut s = crate::session();
s.actions.list.push(Action::new("Early", Vec::new())).unwrap();
s.execute("actions.clearAll", json!({"confirm":true})).unwrap();
s.execute("actions.newSet", json!({"name":"New"})).unwrap();
assert!(s.attach_preset_store(open(Box::new(store.clone()))).is_empty());
assert!(s.actions.list.actions().is_empty());
assert_eq!(s.actions.list.sets(), ["New"]);
let mut reopened = Session::new();
let mut reopened = crate::session();
assert!(reopened.attach_preset_store(open(Box::new(store))).is_empty());
assert!(reopened.actions.list.actions().is_empty());
assert_eq!(reopened.actions.list.sets(), ["New"]);
@@ -270,7 +270,7 @@ fn empty_pre_attachment_clear_replaces_the_saved_library() {
for undo in [false, true] {
let store = MemBackend::default();
store.write(ACTIONS_FILE, br#"{"version":1,"actions":[{"name":"Disk"}]}"#).unwrap();
let mut s = Session::new();
let mut s = crate::session();
assert_eq!(s.execute("actions.clearAll", json!({"confirm":true})).unwrap()["cleared"], 0);
let revision = s.actions.list.revision();
assert_eq!(s.execute("actions.clearAll", json!({"confirm":true})).unwrap()["cleared"], 0);
@@ -280,7 +280,7 @@ fn empty_pre_attachment_clear_replaces_the_saved_library() {
}
assert!(s.attach_preset_store(open(Box::new(store.clone()))).is_empty());
assert_eq!(s.actions.list.actions().first().map(|action| action.name.as_str()), undo.then_some("Disk"));
let mut reopened = Session::new();
let mut reopened = crate::session();
assert!(reopened.attach_preset_store(open(Box::new(store))).is_empty());
assert_eq!(reopened.actions.list.actions(), s.actions.list.actions());
}
@@ -221,7 +221,7 @@ mod tests {
/// A matching opaque default cannot allocate gap tiles beyond the existing adjustment budget.
#[test]
fn opaque_gap_budget_refuses_before_pixel_allocation_or_edit() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", serde_json::json!({"width":4,"height":2,"mode":"lab","depth":32,"background":"transparent"})).unwrap();
s.edit("Distant opaque exception", |doc, active| {
let surface = doc.layer_mut(active.unwrap()).unwrap().surface_mut().unwrap();
@@ -248,7 +248,7 @@ mod tests {
#[test]
fn lab_bounds_refuse_subtracted_samples_and_click_order() {
for extra in [serde_json::json!({"subtractPoints": [[1, 1]]}), serde_json::json!({"order": ["+", "-"]}), serde_json::json!({"subtractPoints": []})] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", serde_json::json!({"width": 4, "height": 2})).unwrap();
let before = s.active().unwrap().doc.clone();
let mut p = serde_json::json!({"labMinimum": [0, -10, -10], "labMaximum": [100, 10, 10], "lightness": 50});
@@ -4,7 +4,7 @@ const DEPTHS: [u64; 3] = [8, 16, 32];
const MODES: [&str; 4] = ["rgb", "gray", "cmyk", "lab"];
fn session(depth: u64, mode: &str) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 48, "height": 32, "depth": depth, "mode": mode})).unwrap();
paint(&mut s, |x, y| [0.1 + x as f32 / 60.0, 0.2 + y as f32 / 50.0, 0.6 - x as f32 / 120.0, 1.0]);
s
@@ -131,7 +131,7 @@ fn disabled_without_pixels() {
assert!(!s.is_enabled(id), "{id}");
}
assert!(s.is_enabled("image.adjustments.hdrToning"));
assert!(!Session::new().is_enabled("image.adjustments.hdrToning"));
assert!(!crate::session().is_enabled("image.adjustments.hdrToning"));
}
#[test]
@@ -1242,7 +1242,7 @@ fn black_white_auto_spreads_the_greys() {
assert_eq!(auto_black_white(&[]), BW_DEFAULTS);
// The command: an adjustment layer reads the image under it; the document is unchanged.
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 20, "height": 10})).unwrap();
paint(&mut s, |x, _| if x < 10 { [0.776, 0.2, 0.2, 1.0] } else { [0.29, 0.29, 1.0, 1.0] });
let id = s.execute("layer.newAdjustmentLayer.blackWhite", json!({})).unwrap()["layer"].as_u64().unwrap();
@@ -1260,7 +1260,7 @@ fn black_white_auto_spreads_the_greys() {
assert_eq!(s.execute("image.adjustments.blackWhite.auto", json!({"layer": id})).unwrap(), r);
// Sampling a big canvas still finds a thin painted stripe.
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 512, "height": 512, "background": "transparent"})).unwrap();
paint(&mut s, |x, y| match (x, y < 256) {
(1, true) => [0.776, 0.2, 0.2, 1.0],
@@ -1273,7 +1273,7 @@ fn black_white_auto_spreads_the_greys() {
// Columns alternating with a period that divides the sampling stride (4 here): both colours
// are still sampled, not only the even columns.
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 512, "height": 512})).unwrap();
paint(&mut s, |x, _| if x % 2 == 0 { [0.776, 0.2, 0.2, 1.0] } else { [0.29, 0.29, 1.0, 1.0] });
let r = s.execute("image.adjustments.blackWhite.auto", json!({})).unwrap();
@@ -1299,7 +1299,7 @@ fn black_white_auto_reads_the_whole_input() {
let split = |x: i32, _| if x < 10 { red } else { blue };
// A selection over the red half doesn't narrow Image › Adjustments' Auto.
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 20, "height": 10})).unwrap();
paint(&mut s, split);
s.execute("select.rect", json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap();
@@ -1319,7 +1319,7 @@ fn black_white_auto_reads_the_whole_input() {
assert_eq!(auto(&mut s, json!({"layer": id})), mix.to_vec());
// Nor clipping it to a layer that only covers the red half.
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 20, "height": 10})).unwrap();
paint(&mut s, |_, _| blue);
s.execute("layer.new.layer", json!({})).unwrap();
@@ -1330,7 +1330,7 @@ fn black_white_auto_reads_the_whole_input() {
assert_eq!(auto(&mut s, json!({"layer": id})), mix.to_vec());
// A Black & White smart filter: its own result is grey, its input is the colours.
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 20, "height": 10})).unwrap();
paint(&mut s, split);
s.execute("filter.convertForSmartFilters", json!({})).unwrap();
@@ -1345,7 +1345,7 @@ fn black_white_auto_reads_the_whole_input() {
assert!(s.execute("image.adjustments.blackWhite.auto", json!({"filter": 0})).is_err(), "not a smart object");
// Past the render limit there is nothing to sample.
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 40000, "height": 30000, "background": "transparent"})).unwrap();
let id = s.execute("layer.newAdjustmentLayer.blackWhite", json!({})).unwrap()["layer"].as_u64().unwrap();
assert!(s.execute("image.adjustments.blackWhite.auto", json!({"layer": id})).is_err());
@@ -11,7 +11,7 @@ use crate::Session;
const CMD: &str = "paint.adjustmentBrush";
fn doc() -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 1200, "height": 900, "background": "white"})).unwrap();
s
}
@@ -262,7 +262,7 @@ fn indexed_color_refuses_the_stroke_with_the_alert() {
#[test]
fn bad_params_are_errors_not_panics() {
let mut s = Session::new();
let mut s = crate::session();
assert!(s.execute(CMD, dab("levels")).is_err(), "no document");
let mut s = doc();
for p in [
File renamed without changes.
@@ -33,7 +33,7 @@ fn paint_scene(s: &mut Session, id: LayerId, x0: i32, x1: i32, gain: f32) {
/// The issue's document: Left (the scene at x 0..240) as the Background, its uncovered area
/// white, and Right (the scene at x 160..400, darkened) above it.
fn left_background_and_right() -> (Session, LayerId, LayerId) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 400, "height": 300, "background": "white"})).unwrap();
let bg = s.active().unwrap().doc.background().unwrap().id;
paint_scene(&mut s, bg, 0, 240, 1.0);
@@ -39,7 +39,7 @@ fn select(s: &mut Session, ids: &[LayerId]) {
#[test]
fn auto_align_repositions_at_all_depths() {
for depth in [8, 16, 32] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 300, "height": 240, "depth": depth, "background": "transparent"})).unwrap();
let a = texture_layer(&mut s, "A", 20, 20);
let b = texture_layer(&mut s, "B", 31, 13);
@@ -58,7 +58,7 @@ fn auto_align_repositions_at_all_depths() {
#[test]
fn auto_align_auto_projection_and_errors() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 300, "height": 240, "background": "transparent"})).unwrap();
let a = texture_layer(&mut s, "A", 20, 20);
let b = texture_layer(&mut s, "B", 26, 25);
@@ -75,7 +75,7 @@ fn auto_align_auto_projection_and_errors() {
#[test]
fn auto_align_keeps_a_locked_layer_as_the_reference() {
for lock in ["all", "position", "pixels"] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 300, "height": 240, "background": "transparent"})).unwrap();
let a = texture_layer(&mut s, "A", 20, 20);
let b = texture_layer(&mut s, "B", 31, 13);
@@ -113,7 +113,7 @@ fn auto_align_keeps_a_locked_layer_as_the_reference() {
#[test]
fn auto_align_moves_the_background_as_a_normal_layer() {
let setup = || {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 300, "height": 240, "background": "white"})).unwrap();
let bg = s.active().unwrap().doc.background().unwrap().id;
paint_texture(&mut s, bg, 20, 20);
@@ -155,7 +155,7 @@ fn auto_align_moves_the_background_as_a_normal_layer() {
#[test]
fn auto_align_warps_layer_masks_keeping_their_default() {
for (projection, reveal) in [("reposition", true), ("reposition", false), ("cylindrical", true)] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 300, "height": 240, "background": "transparent"})).unwrap();
let a = texture_layer(&mut s, "A", 20, 20);
let b = texture_layer(&mut s, "B", 31, 13);
@@ -184,7 +184,7 @@ fn auto_align_warps_layer_masks_keeping_their_default() {
#[test]
fn auto_blend_panorama_masks_and_seamless_layer() {
for depth in [8, 16, 32] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 200, "height": 60, "depth": depth, "background": "transparent"})).unwrap();
s.execute("layer.new.layer", json!({"name": "left"})).unwrap();
s.edit("l", |doc, active| {
@@ -218,7 +218,7 @@ fn auto_blend_panorama_masks_and_seamless_layer() {
/// #14214: the Background can't take a mask, and Auto-Blend leaves it the Background (no mask).
#[test]
fn auto_blend_keeps_the_background() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 200, "height": 60, "background": "white"})).unwrap();
let bg = s.active().unwrap().doc.background().unwrap().id;
s.execute("layer.new.layer", json!({"name": "right"})).unwrap();
@@ -241,7 +241,7 @@ fn auto_blend_keeps_the_background() {
/// Seamless Tones and Colors evens out a 10% exposure step between two panorama layers.
#[test]
fn auto_blend_panorama_seamless_matches_exposure() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 200, "height": 60, "background": "transparent"})).unwrap();
let mut ids = Vec::new();
for (name, x0, x1, gain) in [("left", 0, 130, 1.0f32), ("right", 70, 200, 1.1)] {
@@ -266,7 +266,7 @@ fn auto_blend_panorama_seamless_matches_exposure() {
/// wholly over the bottom one. It used to get an all-black mask; now it shows on its side.
#[test]
fn auto_blend_panorama_of_a_layer_the_canvas_crops_to_all_overlap() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 200, "height": 60, "background": "transparent"})).unwrap();
s.execute("layer.new.layer", json!({"name": "left"})).unwrap();
s.edit("l", |doc, active| {
@@ -298,7 +298,7 @@ fn auto_blend_panorama_of_a_layer_the_canvas_crops_to_all_overlap() {
/// its bounds, not cut off at the canvas edge.
#[test]
fn auto_blend_panorama_masks_past_the_canvas() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 200, "height": 60, "background": "transparent"})).unwrap();
s.execute("layer.new.layer", json!({"name": "left"})).unwrap();
s.edit("l", |doc, active| {
@@ -329,7 +329,7 @@ fn auto_blend_panorama_masks_past_the_canvas() {
/// estimate, so the extent past the canvas is capped independently: it keeps to the canvas.
#[test]
fn auto_blend_sparse_huge_bounds_keep_to_the_canvas() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 200, "height": 200, "background": "transparent"})).unwrap();
s.execute("layer.new.layer", json!({"name": "a"})).unwrap();
s.edit("a", |doc, active| {
@@ -373,7 +373,7 @@ fn auto_blend_budget_counts_layers_and_channels() {
#[test]
fn auto_blend_stack_without_seamless() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 64, "height": 64, "background": "transparent"})).unwrap();
s.execute("layer.new.layer", json!({"name": "sharp"})).unwrap();
s.edit("checker", |doc, active| {
@@ -430,7 +430,7 @@ fn smooth_layer(s: &mut Session, name: &str, dx: i32, dy: i32) -> LayerId {
#[test]
fn auto_align_registers_a_smooth_bracket_by_intensity() {
for depth in [8, 16, 32] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 200, "height": 150, "depth": depth, "background": "transparent"})).unwrap();
let a = smooth_layer(&mut s, "A", 0, 0);
let b = smooth_layer(&mut s, "B", 4, 3);
@@ -460,7 +460,7 @@ fn auto_align_registers_a_smooth_bracket_by_intensity() {
/// moving them by whatever pose its search box ends at.
#[test]
fn auto_align_rejects_unrelated_layers_instead_of_guessing_a_pose() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 200, "height": 150, "depth": 8, "background": "transparent"})).unwrap();
let a = smooth_layer(&mut s, "A", 0, 0);
s.execute("layer.new.layer", json!({"name": "stripes"})).unwrap();
@@ -498,7 +498,7 @@ fn auto_align_rejects_unrelated_layers_instead_of_guessing_a_pose() {
fn auto_blend_stack_fuses_the_sharp_halves() {
let checker = |x: i32, y: i32| if (x / 3 + y / 3) % 2 == 0 { 0.2 } else { 0.8 };
for depth in [8, 16, 32] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 96, "height": 64, "depth": depth, "background": "transparent"})).unwrap();
let mut ids = Vec::new();
for (name, sharp_left) in [("left", true), ("right", false)] {
@@ -544,7 +544,7 @@ fn auto_blend_stack_fuses_the_sharp_halves() {
#[test]
fn auto_blend_stack_depth_map() {
for depth in [8, 16, 32] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 96, "height": 48, "depth": depth, "background": "transparent"})).unwrap();
let mut ids = Vec::new();
for k in 0..3 {
@@ -2,7 +2,7 @@ use super::*;
use photocraft_doc::{ColorMode, LayerContent, LayerId};
fn session(w: u32, h: u32, depth: u32) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": w, "height": h, "depth": depth, "background": "white"})).unwrap();
s
}
@@ -78,7 +78,7 @@ fn failed_compound_preserves_a_clean_document() {
fn record_measurements_refuses_an_area_too_large_to_measure() {
// #933: with no selection the whole document is measured, and `width * height` overflowed
// u32 on a legal 65536×65536 document, panicking inside `run`.
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 65536, "height": 65536, "background": "transparent"})).unwrap();
let err = s.execute("image.analysis.recordMeasurements", json!({"source": "selection"})).unwrap_err();
assert!(err.to_string().contains("too large to measure"), "{err}");
@@ -384,7 +384,7 @@ fn place_scale_marker_lays_out_its_label_in_points_at_high_resolution() {
// `fontSize` is in points and `type.create` renders it at resolution/72 px per point, but the
// layout treated it as pixels: at 300 ppi a 12 pt label (50 px) overlapped the bar.
for res in [72.0, 300.0] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 1200, "height": 900, "resolution": res, "background": "white"})).unwrap();
let r = s.execute("image.analysis.placeScaleMarker", json!({"fontSize": 12, "textPosition": "bottom"})).unwrap();
let bar_bottom = r["barRect"][3].as_f64().unwrap();
@@ -440,7 +440,7 @@ fn place_scale_marker_on_a_short_document_errors_without_panicking() {
#[test]
fn analysis_info_and_cmyk_document() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 30, "height": 20, "mode": "cmyk", "background": "white"})).unwrap();
assert_eq!(d(&s).mode, ColorMode::Cmyk);
s.execute("count.add", json!({"x": 3, "y": 4})).unwrap();
@@ -19,14 +19,14 @@ const CMD: &str = "image.analysis.straightenLayer";
/// A white document with a Background, as File > New makes one.
fn session(w: u32, h: u32) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": w, "height": h, "background": "white"})).unwrap();
s
}
/// The same document in CMYK at 16 bits, which the reference also straightens.
fn cmyk_16(w: u32, h: u32) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": w, "height": h, "mode": "cmyk", "depth": 16, "background": "white"})).unwrap();
s
}
@@ -11,7 +11,7 @@ const CMD: &str = "image.analysis.straightenLayer";
/// An 800 × 600 document with a pixel layer "Colors" painted at 100,100 to 400,300, active, and a
/// ruler that tilts it by a few degrees.
fn session() -> (Session, LayerId) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 800, "height": 600, "background": "white"})).unwrap();
let l = LayerId(s.execute("layer.new.layer", json!({"name": "Colors"})).unwrap()["layer"].as_u64().unwrap());
s.edit("paint", |doc, _| {
@@ -8,7 +8,7 @@ use photocraft_geom::Rect;
/// 64 x 48, transparent, with two boards: "Clear" (transparent, a red square inside, half the
/// board left empty) and "White" (white background, empty).
fn session() -> (Session, u64, u64) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 64, "height": 48, "background": "transparent"})).unwrap();
s.edit("Red", |doc, active| {
let fmt = doc.pixel_format();
@@ -10,7 +10,7 @@ const MEASURED: [(&str, [u32; 4]); 3] = [("Red Board", [0, 0, 200, 150]), ("Blue
/// The issue's test document: 800 x 400, RGB, 8 bit, transparent, unsaved and named
/// `abfiles-test`, with `boards` added bottom to top.
fn session(boards: &[(&str, [u32; 4])]) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"name": "abfiles-test", "width": 800, "height": 400, "depth": 8, "background": "transparent"})).unwrap();
for (name, rect) in boards {
s.execute("layer.new.artboard", json!({"name": name, "rect": rect, "background": "transparent"})).unwrap();
@@ -7,7 +7,7 @@ use super::*;
/// Layers panel, then Blue Board 200 x 200, then an empty transparent board on top. 300 ppi, so
/// a page sized from the document resolution would not be 72 ppi.
fn boards() -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 800, "height": 400, "name": "abfiles-test", "background": "transparent"})).unwrap();
for (name, rect, bg) in [
("Red Board", [0, 0, 200, 150], json!({"background": "custom", "color": "#ff0000"})),
@@ -171,7 +171,7 @@ fn unknown_format_is_an_error_and_writes_nothing() {
/// empty buffer (`region data length mismatch`).
#[test]
fn oversized_board_is_a_bad_params_error_for_png8_and_pdf() {
let mut s = Session::new();
let mut s = crate::session();
let mut doc = Document::new("huge", Size::new(40_000, 40_000), ColorMode::Rgb, SampleType::U8);
let mut board = Layer::group("Huge Board", Vec::new());
if let LayerContent::Group(g) = &mut board.content {
@@ -6,7 +6,7 @@ use photocraft_geom::Rect;
/// 800 x 600 with the white Background and a pixel layer "Red" at 100,100 to 300,250.
fn session(depth: u32) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 800, "height": 600, "depth": depth, "background": "white"})).unwrap();
s.edit("Red", |doc, active| {
let fmt = doc.pixel_format();
@@ -17,7 +17,7 @@ fn square(doc: &Document, name: &str, r: Rect, rgba: [f32; 4]) -> Layer {
/// 800 x 600 with the white Background and "Group 1" holding Blue above Red; with `inner`, Blue
/// sits in its own group "Inner". Returns the session and the ids of Group 1, Red and Blue.
fn session(inner: bool) -> (Session, [LayerId; 3]) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 800, "height": 600, "background": "white"})).unwrap();
let ids = s
.edit("Group 1", |doc, active| {
@@ -94,7 +94,7 @@ fn a_hidden_group_inside_hides_its_children_too() {
#[test]
fn a_group_with_every_layer_hidden_is_handled_like_an_empty_group() {
let mut empty = Session::new();
let mut empty = crate::session();
empty.execute("file.new", json!({"width": 800, "height": 600, "background": "white"})).unwrap();
let e = empty.edit("Group 1", |doc, _| Ok(doc.insert_above(None, Layer::group("Group 1", vec![])))).unwrap();
let today = from_group(&mut empty, e);
@@ -9,7 +9,7 @@ use photocraft_doc::LayerMask;
/// 200 x 200 with a top-level group "Group" (one child "Red" with pixels) that has the given
/// blend, opacity, fill opacity and an optional mask.
fn session_with_group(blend: BlendMode, opacity: f32, fill_opacity: f32, mask: bool) -> (Session, LayerId) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 200, "height": 200, "depth": 8, "background": "white"})).unwrap();
let gid = s
.edit("Group", |doc, active| {
@@ -5,7 +5,7 @@ use photocraft_geom::Rect;
/// 100 x 80 RGB at `depth` with a pixel layer "Red" holding a square at 10,10 to 30,30.
fn session(depth: u32) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 100, "height": 80, "depth": depth, "background": "white"})).unwrap();
s.edit("Red", |doc, active| {
let fmt = doc.pixel_format();
@@ -11,7 +11,7 @@ const RED: [f32; 4] = [220.0 / 255.0, 30.0 / 255.0, 30.0 / 255.0, 1.0];
/// The spec's test document: 800 x 400, transparent, `Red Board` 0,0-200,150 (white, a red
/// layer at 20,20-120,100) and `Blue Board` 120,30-320,230 (white, a blue layer at 130,40-230,140).
fn session(depth: u32) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 800, "height": 400, "depth": depth, "background": "transparent"})).unwrap();
board(&mut s, "Red Board", [0, 0, 200, 150], Rect::new(20, 20, 120, 100), RED);
board(&mut s, "Blue Board", [120, 30, 200, 200], Rect::new(130, 40, 230, 140), [30.0 / 255.0, 30.0 / 255.0, 220.0 / 255.0, 1.0]);
@@ -13,7 +13,7 @@ const WHITE: [u8; 3] = [255, 255, 255];
/// (pixel layer `Red` at 20,20-120,100), `Blue Board` 120,30-320,230 (pixel layer `Blue` at
/// 130,40-230,140) and `Empty Board` 600,0-700,100, all with white backgrounds.
fn session(depth: u32) -> (Session, [u64; 3]) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 800, "height": 400, "depth": depth, "background": "transparent"})).unwrap();
let board =
|s: &mut Session, name: &str, rect: [i64; 4]| s.execute("layer.new.artboard", json!({"rect": rect, "name": name})).unwrap()["layer"].as_u64().unwrap();
@@ -10,7 +10,7 @@ const MEASURED: [(&str, [u32; 4]); 3] = [("Red Board", [0, 0, 200, 150]), ("Blue
/// The issue's test document: 800 x 400, RGB, 8 bit, 72 ppi, named `abpdf-test`, with `boards`
/// added bottom to top.
fn session(boards: &[(&str, [u32; 4])]) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"name": "abpdf-test", "width": 800, "height": 400, "depth": 8, "resolution": 72})).unwrap();
for (name, rect) in boards {
s.execute("layer.new.artboard", json!({"rect": rect, "name": name})).unwrap();
@@ -14,7 +14,7 @@ use super::*;
/// The issue's document at `depth` bits. Returns the session and the ids of Red, Blue and Empty
/// Board.
fn session(depth: u32) -> (Session, [u64; 3]) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"name": "abpdf-test", "width": 800, "height": 400, "depth": depth, "background": "transparent"})).unwrap();
let mut board = |name: &str, rect: [u32; 4], layer: Option<(&str, [u32; 4], &str)>| {
let id = s.execute("layer.new.artboard", json!({"name": name, "rect": rect, "background": "white"})).unwrap()["layer"].as_u64().unwrap();
@@ -180,7 +180,7 @@ fn unticked_every_page_with_layers_is_masked_and_the_xref_still_points_at_object
#[test]
fn unticked_a_board_its_layer_covers_entirely_stays_opaque() {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 300, "height": 200, "background": "transparent"})).unwrap();
let id = s.execute("layer.new.artboard", json!({"name": "Full", "rect": [0, 0, 120, 80]})).unwrap()["layer"].as_u64().unwrap();
s.execute("layer.select", json!({"layer": id})).unwrap();
@@ -14,7 +14,7 @@ const CMD: &str = "file.export.artboardsToPdf";
/// (pixel layer `Red` at 20,20-120,100), `Blue Board` 120,30-320,230 (pixel layer `Blue` at
/// 130,40-230,140) and `Empty Board` 600,0-700,100, all with white backgrounds.
fn session(depth: u32) -> (Session, [u64; 3]) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 800, "height": 400, "depth": depth, "background": "transparent"})).unwrap();
let board =
|s: &mut Session, name: &str, rect: [i64; 4]| s.execute("layer.new.artboard", json!({"rect": rect, "name": name})).unwrap()["layer"].as_u64().unwrap();
@@ -5,7 +5,7 @@ use super::*;
/// The measured document, and the ids of Red, Blue and Empty Board (bottom to top).
fn session() -> (Session, [u64; 3]) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 800, "height": 400, "depth": 8, "resolution": 72})).unwrap();
let mut board = |rect: [i64; 4], name: &str| {
let r = s.execute("layer.new.artboard", json!({"rect": rect, "name": name})).unwrap();
@@ -6,7 +6,7 @@ use super::*;
/// The measured document, and the ids of Red, Blue and Empty Board (bottom to top).
fn session() -> (Session, [u64; 3]) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 800, "height": 400, "depth": 8, "resolution": 72})).unwrap();
let mut board = |rect: [i64; 4], name: &str| {
let r = s.execute("layer.new.artboard", json!({"rect": rect, "name": name})).unwrap();
@@ -2,7 +2,7 @@ use super::*;
use photocraft_geom::Rect;
fn session(depth: u32) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 100, "height": 80, "depth": depth})).unwrap();
s
}
@@ -593,7 +593,7 @@ fn moving_an_artboard_past_the_canvas_keeps_its_shapes_whole() {
// Partly past the edge: the whole shape, not just the part inside the old canvas.
("layer.artboard.set", json!({"x": 90}), (120, 100), [(91, 21), (95, 30), (110, 30)], Some((15, 30))),
] {
let mut s = Session::new();
let mut s = crate::session();
let sh = shape_board(&mut s);
s.execute(cmd, p.clone()).unwrap();
assert_eq!((doc(&s).size.width, doc(&s).size.height), size, "{cmd} {p}");
@@ -868,7 +868,7 @@ fn new_document_with_an_artboard() {
("transparent", ArtboardBackground::Transparent),
("#336699", ArtboardBackground::Custom(Color::rgba(0x33 as f32 / 255.0, 0x66 as f32 / 255.0, 0x99 as f32 / 255.0, 1.0))),
] {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 120, "height": 90, "background": background, "artboard": true})).unwrap();
let d = doc(&s);
assert_eq!(d.layers.len(), 1, "{background}: only the board");
@@ -881,7 +881,7 @@ fn new_document_with_an_artboard() {
assert!(!d.layers.iter().any(|l| d.is_background(l.id)), "{background}: no Background layer");
}
// Without the option nothing changes; a non-boolean is refused.
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 20, "height": 10, "artboard": false})).unwrap();
assert!(doc(&s).artboards().is_empty());
assert!(s.execute("file.new", json!({"artboard": "yes"})).is_err());
@@ -924,7 +924,7 @@ fn from_layers_defaults_are_the_selected_layers_size() {
let mut s = session(8);
s.execute("layer.new.layer", json!({})).unwrap();
assert_eq!(from_layers_defaults(&s), Some(("Artboard 1".to_string(), [100, 80])), "an empty layer: the canvas");
assert_eq!(from_layers_defaults(&Session::new()), None);
assert_eq!(from_layers_defaults(&crate::session()), None);
}
/// #10258: with the active layer on an artboard (the board, or a layer inside it), Select All
@@ -12,7 +12,7 @@ const CMD: &str = "edit.assignProfile";
/// A white document of `mode` (as `file.new` names it) at `depth` bits.
fn session(mode: &str, depth: u32) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 8, "mode": mode, "depth": depth, "background": "white"})).unwrap();
s
}
@@ -32,7 +32,7 @@ fn assert_refused(s: &mut Session, what: &str) {
#[test]
fn no_document_greys_it_out() {
assert_refused(&mut Session::new(), "no document");
assert_refused(&mut crate::session(), "no document");
}
#[test]
File renamed without changes.
@@ -64,7 +64,7 @@ fn load(items: Vec<AtnItem>) -> (Session, Value) {
actions: vec![AtnAction { name: UnicodeString::new_nul("A"), items, ..Default::default() }],
..Default::default()
};
let mut s = Session::new();
let mut s = crate::session();
let r = s.execute("actions.load", json!({"data": photocraft_paint::tile::b64_encode(&atn::write(&file).unwrap())})).unwrap();
(s, r)
}
@@ -28,7 +28,7 @@ fn load(items: Vec<AtnItem>) -> (Session, Value) {
actions: vec![AtnAction { name: UnicodeString::new_nul("A"), items, ..Default::default() }],
..Default::default()
};
let mut s = Session::new();
let mut s = crate::session();
let r = s.execute("actions.load", json!({"data": photocraft_paint::tile::b64_encode(&atn::write(&file).unwrap())})).unwrap();
(s, r)
}
@@ -20,7 +20,7 @@ fn canvas_file(descriptor: Descriptor) -> Vec<u8> {
/// The 400 x 300 test document: a white Background with a red square at the top left and a blue
/// one at the bottom right, plus a layer "Top" with a green 50 x 50 square in the middle.
fn test_document() -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 400, "height": 300, "background": "white"})).unwrap();
s.execute("layer.new.layer", json!({"name": "Top"})).unwrap();
s.edit("paint", |doc, _| {
@@ -27,7 +27,7 @@ fn imported(descriptor: Descriptor) -> (String, f64, String) {
/// An 8 x 8 image, inverted so there is an edit to fade.
fn inverted(depth: u8) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width":8,"height":8,"depth":depth,"background":"transparent"})).unwrap();
s.execute("edit.fill", json!({"contents":"color","color":"#4080c0"})).unwrap();
s.execute("image.adjustments.invert", json!({})).unwrap();
@@ -48,7 +48,7 @@ fn load(ds: Vec<Descriptor>) -> (Session, Value) {
actions: vec![AtnAction { name: UnicodeString::new_nul("A"), items: items.collect(), ..Default::default() }],
..Default::default()
};
let mut s = Session::new();
let mut s = crate::session();
let r = s.execute("actions.load", json!({"data": photocraft_paint::tile::b64_encode(&atn::write(&file).unwrap())})).unwrap();
(s, r)
}
@@ -163,7 +163,7 @@ fn a_loaded_step_plays_with_no_layer_selected() {
/// Without a layer of its own the command still frames the selected layers.
#[test]
fn without_a_layer_the_selected_layers_are_framed() {
let mut s = Session::new();
let mut s = crate::session();
let (photo, other) = two_layers(&mut s);
s.execute(FRAME, json!({"name": "Frame 1"})).unwrap();
assert_eq!(frames(&s, "Frame 1").into_iter().map(|f| f.1).collect::<Vec<_>>(), vec![[60.0, 5.0, 30.0, 20.0]]);
@@ -13,7 +13,7 @@ fn item(event: &str, label: &str, d: Option<Descriptor>) -> AtnItem {
}
fn two_layers() -> (Session, u64, u64) {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 16, "height": 16})).unwrap();
s.execute("layer.new.layer", json!({"name": "First"})).unwrap();
s.execute("layer.new.layer", json!({"name": "Second"})).unwrap();
@@ -114,7 +114,7 @@ fn expanded_properties_replay_like_direct_edits_at_every_depth() {
for depth in [8, 16, 32] {
for named in [false, true] {
let prepare = || {
let mut session = Session::new();
let mut session = crate::session();
session.execute("file.new", json!({"width": 2, "height": 2, "depth": depth})).unwrap();
session.execute("layer.new.layer", json!({"name": "Original"})).unwrap();
session.execute("layer.new.layer", json!({"name": "Other"})).unwrap();
@@ -35,7 +35,7 @@ fn load(items: Vec<AtnItem>) -> (Session, Value) {
actions: vec![AtnAction { name: UnicodeString::new_nul("A"), items, ..Default::default() }],
..Default::default()
};
let mut s = Session::new();
let mut s = crate::session();
let r = s.execute("actions.load", json!({"data": photocraft_paint::tile::b64_encode(&atn::write(&file).unwrap())})).unwrap();
(s, r)
}
@@ -116,7 +116,7 @@ fn whole_atn_and_native_insert_path_replay_keep_geometry() {
assert!(skipped.is_empty());
assert_eq!(atn::parse(&bytes).unwrap().actions[0].items[0].descriptor, Some(original.clone()));
let expected = path_from(&original).unwrap();
let mut s = crate::Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width":400,"height":300})).unwrap();
s.execute("path.set", json!({"name":"Source","path":crate::vector_cmds::path_json(&expected)})).unwrap();
s.actions.list.push(Action::new("Captured", Vec::new())).unwrap();
@@ -65,7 +65,7 @@ fn gradient_tool_steps_load_play_and_save_back() {
.with("null", target_ref("contentLayer"))
.with("T ", D::Descriptor(tool_gradient(-35.0, 140.0, (12.5, -8.0)).with("Algn", D::Boolean(false))));
let items = vec![step(b"Mk ", "Make", make.clone()), step(b"setd", "Set", set.clone())];
let mut s = Session::new();
let mut s = crate::session();
let loaded = s.execute("actions.load", json!({"data": photocraft_paint::tile::b64_encode(&action(items))})).unwrap();
assert_eq!(loaded["unsupported"], json!([]), "{loaded}");
let ids: Vec<&str> = s.actions.list.actions()[0].steps.iter().map(|st| st.command.as_str()).collect();
@@ -115,7 +115,7 @@ fn create_droplet_step_loads_plays_and_saves_back() {
let file = dir.join("Sharpen.pcdroplet").to_string_lossy().into_owned();
let out = dir.join("out").to_string_lossy().into_owned();
let recorded = droplet(&file, &out, &[("OvrO", D::Boolean(true))]);
let mut s = Session::new();
let mut s = crate::session();
// The action the droplet runs.
s.actions.list.push(crate::actions_cmds::Action::new("Sharpen", vec![ActionStep::new("filter.sharpen.sharpen", json!({}))])).unwrap();
s.actions.list.assign_set(0, Some("Tools".into())).unwrap();
@@ -204,7 +204,7 @@ fn create_droplet_steps_follow_a_renamed_loaded_action() {
..Default::default()
})
.unwrap();
let mut s = Session::new();
let mut s = crate::session();
s.actions.list.push(crate::actions_cmds::Action::new("Sharpen", vec![])).unwrap();
s.actions.list.assign_set(0, Some("Tools".into())).unwrap();
let r = s.execute("actions.load", json!({"data": photocraft_paint::tile::b64_encode(&file), "set": "Loaded"})).unwrap();
@@ -65,7 +65,7 @@ fn code_spellings_in_text_steps_keep_their_bytes_and_flags() {
original.actions[0].items[0].with_dialog = true;
original.actions[0].items[0].dialog_options = 2;
let bytes = atn::write(&original).unwrap();
let mut s = Session::new();
let mut s = crate::session();
let loaded = s.execute("actions.load", json!({"data": photocraft_paint::tile::b64_encode(&bytes)})).unwrap();
assert_eq!(loaded["unsupported"].as_array().unwrap().len(), 1, "{:?}", original.actions[0].items[0].event);
assert_eq!(s.actions.list.actions()[0].steps[0].command, PHOTOSHOP_STEP);
@@ -114,7 +114,7 @@ fn clouds_events_map_and_refuse_unrepresentable_native_settings() {
#[test]
fn clouds_recorded_through_the_dialog_save() {
for id in ["filter.render.clouds", "filter.render.differenceClouds"] {
let mut s = Session::new();
let mut s = crate::session();
s.actions.list.push(Action::new("Render", vec![ActionStep::new(id, json!({"seed": 0}))])).unwrap();
let saved = s.execute("actions.save", json!({"action": "Render"})).unwrap();
assert_eq!(saved["skipped"], json!([]), "{id}");
@@ -140,7 +140,7 @@ fn render_descriptors_load_and_save_without_losing_values() {
events.push(AtnEvent::name(name));
}
for event in events {
let mut s = Session::new();
let mut s = crate::session();
let loaded = s.execute("actions.load", json!({"data": photocraft_paint::tile::b64_encode(&file(event, descriptor.clone()))})).unwrap();
assert_eq!(loaded["unsupported"], json!([]));
let saved = s.execute("actions.save", json!({"action": "Render"})).unwrap();
@@ -240,7 +240,7 @@ fn duplicate_render_keys_keep_their_bytes_and_flags() {
original.actions[0].items[0].with_dialog = true;
original.actions[0].items[0].dialog_options = 2;
let bytes = atn::write(&original).unwrap();
let mut s = Session::new();
let mut s = crate::session();
let loaded = s.execute("actions.load", json!({"data": photocraft_paint::tile::b64_encode(&bytes)})).unwrap();
assert_eq!(loaded["unsupported"].as_array().unwrap().len(), 1, "{event}/{key}");
assert_eq!(s.actions.list.actions()[0].steps[0].command, PHOTOSHOP_STEP);
@@ -271,7 +271,7 @@ fn render_actions_match_direct_filters_and_undo() {
for depth in [8, 16, 32] {
for (event, descriptor, id, params) in &cases {
let setup = || {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width": 8, "height": 6, "mode": mode, "depth": depth, "background": "transparent"})).unwrap();
s.execute("edit.fill", json!({"contents": "color", "color": "#304050"})).unwrap();
s.execute("tools.setColors", json!({"foreground": "#fe1020", "background": "#1050e0"})).unwrap();
@@ -77,7 +77,7 @@ fn group_f_load_save_preserves_recorded_descriptors() {
events.push(AtnEvent::name(name));
}
for event in events {
let mut s = Session::new();
let mut s = crate::session();
let loaded = s.execute("actions.load", json!({"data":photocraft_paint::tile::b64_encode(&file(event.clone(),d.clone()))})).unwrap();
assert_eq!(loaded["unsupported"], json!([]), "{id}");
let saved = s.execute("actions.save", json!({"action":"Step"})).unwrap();
@@ -95,7 +95,7 @@ fn assert_kept(id: &str, name: Option<&str>, descriptor: Descriptor) {
original.actions[0].items[0].enabled = false;
original.actions[0].items[0].with_dialog = true;
original.actions[0].items[0].dialog_options = 2;
let mut s = Session::new();
let mut s = crate::session();
let loaded = s.execute("actions.load", json!({"data":photocraft_paint::tile::b64_encode(&atn::write(&original).unwrap())})).unwrap();
assert_eq!(loaded["unsupported"].as_array().unwrap().len(), 1, "{id}/{name:?}/{descriptor:?}");
assert_eq!(s.actions.list.actions()[0].steps[0].command, PHOTOSHOP_STEP);
@@ -358,7 +358,7 @@ fn play(s: &mut Session, event: AtnEvent, d: Descriptor) -> Value {
/// A small image with real pixels; all witnesses operate through the public command boundary.
fn image(depth: u8) -> Session {
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width":8,"height":8,"depth":depth,"background":"transparent"})).unwrap();
s.execute("edit.fill", json!({"contents":"color","color":"#4080c0"})).unwrap();
s
@@ -434,7 +434,7 @@ fn fade_action_consumes_the_previous_edit_and_fails_without_it() {
assert!(result.get("failed").is_none(), "{result}");
assert_eq!(s.execute("document.pixel", json!({"x":3,"y":3})).unwrap(), before);
}
let mut s = Session::new();
let mut s = crate::session();
s.execute("file.new", json!({"width":8,"height":8})).unwrap();
let before = s.active().unwrap().doc.clone();
let result = play(&mut s, AtnEvent::Code(*b"Fade"), desc("null").with("Opct", pct(50.0)).with("Md ", enm("BlnM", "Mltp")));
Loaded 100 of 667 files, more files were not shown because too many files have changed in this diff. Show more