Commit Graph

63 Commits

Author SHA1 Message Date
d1cab8a691 Fix 40+ bugs from audit passes 9-12
- PNG chunk parsing overflow protection with checked arithmetic
- Font directory traversal bounded with global result limit
- find_unique_path TOCTOU race fixed with create_new + marker byte
- Watch mode "processed" dir exclusion narrowed to prevent false skips
- Metadata copy now checks format support before little_exif calls
- Clipboard temp files cleaned up on app exit
- Atomic writes for file manager integration scripts
- BMP format support added to encoder and convert step
- Regex DoS protection with DFA size limit
- Watermark NaN/negative scale guard
- Selective EXIF stripping for privacy/custom metadata modes
- CLI watch mode: file stability checks, per-file history saves
- High contrast toggle preserves and restores original theme
- Image list deduplication uses O(1) HashSet lookups
- Saturation/trim/padding overflow guards in adjustments
2026-03-07 22:14:48 +02:00
adef810691 Fix 30 critical and high severity bugs from audit passes 6-8
Critical fixes:
- Prevent path traversal via rename templates (sanitize_filename)
- Prevent input == output data loss (paths_are_same check)
- Undo now uses actual executor output paths instead of scanning directory
- Filter empty paths from output_files (prevents trashing CWD on undo)
- Sanitize URL download filenames to prevent path traversal writes

High severity fixes:
- Fix EXIF orientation 5/7 transforms per spec
- Atomic file creation in find_unique_path (TOCTOU race)
- Clean up 0-byte placeholder files on encoding failure
- Cap canvas padding to 10000px, total dimensions to 65535
- Clamp crop dimensions to minimum 1px
- Clamp DPI to 65535 before u16 cast in JPEG encoder
- Force pixel path for non-JPEG/TIFF metadata stripping
- Fast path now applies regex find/replace on rename stem
- Add output_dpi to needs_pixel_processing check
- Cap watermark image scale dimensions to 16384
- Cap template counter padding to 10
- Cap URL download size to 100MB
- Fix progress bar NaN when total is zero
- Fix calculate_eta underflow when current > total
- Fix loaded.len()-1 underflow in preview callbacks
- Replace ListItem downcast unwrap with if-let
- Fix resize preview division by zero on degenerate images
- Clamp rename cursor position to prevent overflow panic
- Watch mode: skip output dirs to prevent infinite loop
- Watch mode: drop tx sender so channel closes on exit
- Watch mode: add delay for partially-written files
- Watch mode: warn and skip unmatched files instead of wrong preset
- Clean temp download directory on app close
- Replace action downcast unwrap with checked if-let
- Add BatchResult.output_files for accurate undo tracking
2026-03-07 20:49:10 +02:00
b432cc7431 Fix 26 bugs, edge cases, and consistency issues from fifth audit pass
Critical: undo toast now trashes only batch output files (not entire dir),
JPEG scanline write errors propagated, selective metadata write result returned.

High: zero-dimension guards in ResizeConfig/fit_within, negative aspect ratio
rejection, FM integration toggle infinite recursion guard, saturating counter
arithmetic in executor.

Medium: PNG compression level passed to oxipng, pct mode updates job_config,
external file loading updates step indicator, CLI undo removes history entries,
watch config write failures reported, fast-copy path reads image dimensions for
rename templates, discovery excludes unprocessable formats (heic/svg/ico/jxl),
CLI warns on invalid algorithm/overwrite values, resolve_collision trailing dot
fix, generation guards on all preview threads to cancel stale results, default
DPI aligned to 0, watermark text width uses char count not byte length.

Low: binary path escaped in Nautilus extension, file dialog filter aligned with
discovery, reset_wizard clears preset_mode and output_dir.
2026-03-07 19:47:23 +02:00
270a7db60d Fix step indicator layout warnings on narrow windows 2026-03-06 18:44:41 +02:00
4f23d25511 Add AppImage packaging, app icon, and AppStream metainfo 2026-03-06 18:31:18 +02:00
a666fbad05 Fix pipeline order, add selective metadata stripping, rename case/regex
- Move watermark step after compress in processing pipeline to match
  design doc order (resize, adjustments, convert, compress, metadata,
  watermark, rename)
- Implement selective EXIF metadata stripping for Privacy and Custom
  modes using little_exif tag filtering (GPS, camera, software,
  timestamps, copyright categories)
- Add case conversion support to rename (none/lower/upper/title)
- Add regex find-and-replace on original filenames
- Wire case and regex controls in rename step UI to JobConfig
- Add regex crate dependency to pixstrip-core
2026-03-06 18:12:18 +02:00
e2aee57bd9 Integrate watch folder monitoring into GTK app
Active watch folders from settings are now monitored using the notify
crate. When new images appear, they are automatically processed using
the folder's linked preset. Toast notifications inform the user.
2026-03-06 17:53:41 +02:00
afabdf3548 Persist advanced options expand/collapse state per section
Each ExpanderRow now remembers its expanded state between sessions
using a per-section key stored in SessionState. Replaces the global
detailed_mode toggle with granular per-section persistence.
2026-03-06 17:49:07 +02:00
d8bb1a726a Add watermark tiling, rotation types, margin/scale controls
Wire tiled, margin, and scale UI controls to JobConfig and pass
through to WatermarkConfig. Add tiled text and image watermark
implementations that repeat across the full image. Add font family
filesystem search for named fonts. Add WatermarkRotation enum.
2026-03-06 17:36:07 +02:00
45247cdac5 Add collapsible watch folders panel in main window
Toggle button in the header bar reveals a bottom panel showing active
watch folders with their linked presets and watching status. The add
button opens Settings for full watch folder configuration.
2026-03-06 17:29:02 +02:00
d9ce1f8731 Add font family selector for watermark text
Font picker using GTK FontDialog/FontDialogButton lets users choose
any installed system font for text watermarks. The selected font family
is passed through the processing pipeline and used to find the matching
font file on disk.
2026-03-06 17:12:23 +02:00
3109f97786 Add overwrite confirmation dialog and preset file drop import
- When overwrite behavior is "Ask", show dialog before processing
  listing conflicting files with Overwrite/Skip/Auto-rename options
- Workflow page accepts .pixstrip-preset file drag-and-drop for import
- Split run_processing into two phases to support async dialog
2026-03-06 17:07:53 +02:00
683422f8f5 Improve screen reader support for wizard navigation
- Announce step number and name when navigating between steps
- Add accessible label to batch queue toggle button
- Add accessible label to navigation view with shortcut hint
- Step transitions update accessible property for screen readers
2026-03-06 17:02:04 +02:00
b9775d5632 Add single-instance file handling via GIO HANDLES_OPEN
- App flag HANDLES_OPEN enables receiving files from file manager
- connect_open handler filters for image files and activates window
- load-external-files action receives paths and adds to loaded files
- Auto-navigates to step 2 (images) when files arrive externally
- Second instance sends files to existing window instead of launching
2026-03-06 16:58:23 +02:00
a7dda7ad6f Enhance history dialog with expandable details and DPI support
- History entries now use ExpanderRow with detailed sub-rows
- Show formatted timestamp, input/output directories, size breakdown
- Clickable output directory row opens file manager
- Per-entry undo and open folder action buttons
- Error count shown for batches with failures
2026-03-06 16:56:23 +02:00
5a56e25c2c Add sequential batch queue processing
- After a batch completes, automatically start next pending batch
- Mark completed/failed batches in queue with correct status
- Failed batches don't block the queue - next pending batch starts
- Queue processes batches in order, one at a time
2026-03-06 16:17:25 +02:00
e976ca2c0a Add rename template presets and watermark color picker
- Rename step: quick-fill buttons for common patterns (Date+Name,
  EXIF Date+Name, Sequential, Dimensions, Camera+Date, Web-safe)
- Watermark step: color picker in advanced options using ColorDialogButton
- Add watermark_color field to JobConfig, wire through to core
2026-03-06 16:10:05 +02:00
fcb4b0e727 Improve output step with individual operation summary rows
Replace single-line arrow-delimited summary with a proper ListBox
showing each enabled operation as its own row with check icons.
Dynamically rebuilt when navigating to the output step. Also make
walk_widgets public for cross-module use.
2026-03-06 15:57:06 +02:00
a09462fd53 Add batch queue with slide-out side panel
Queue panel with OverlaySplitView sidebar. Users can add batches
from the results page via "Add to Queue" action. Queue shows
pending/active/completed batches with status icons. Toggle via
header bar button. Batches can be removed while pending.
2026-03-06 15:52:18 +02:00
33659a323b Enhance save preset dialog with settings summary and update option
Replace simple alert dialog with full dialog showing workflow summary,
new preset name entry, and option to update existing user presets.
Never overwrites built-in presets.
2026-03-06 15:43:45 +02:00
1d33be1e3d Wire DPI setting from resize step through to processing job
Add output_dpi field to JobConfig, ProcessingJob, and Preset.
Connect the DPI SpinRow in the resize step's advanced options to
update the config value.
2026-03-06 15:41:25 +02:00
5bdeb8a2e3 Wire skill level and accessibility settings to UI
- Add detailed_mode to AppState, derived from skill_level setting
- Expand advanced option sections by default in Detailed mode
  (resize, convert, compress, watermark steps)
- Fix high contrast to use HighContrast GTK theme
- Add completion sound via canberra-gtk-play
2026-03-06 15:28:02 +02:00
d6f7fc9c88 Initialize overwrite behavior from app settings
The overwrite behavior in the output step now defaults to the value
configured in Settings rather than always defaulting to "Ask".
2026-03-06 15:24:51 +02:00
4dd868078a Add completion sound, preserve directory structure support
- Play system notification sound via canberra-gtk-play when enabled
- Implement preserve_directory_structure in output_path_for to maintain
  relative paths from input directory in output
2026-03-06 15:24:04 +02:00
1e3ffaadd3 Add history pruning with configurable max entries and max days
- Add history_max_entries (default 50) and history_max_days (default 30)
  to AppConfig
- Add prune() method to HistoryStore that removes old entries by age
  and count limits
- Call prune after each history entry is added in the GUI
- Preserve history settings through settings dialog save/load cycle
2026-03-06 15:22:17 +02:00
a29256921e Wire resize algorithm selection, overwrite behavior, and fix rotation/flip scope
- Add ResizeAlgorithm enum (Lanczos3/CatmullRom/Bilinear/Nearest) to core
- Thread algorithm selection from UI ComboRow through ProcessingJob to resize_image
- Add OverwriteBehavior enum (AutoRename/Overwrite/Skip) to core
- Implement overwrite handling in executor with auto-rename suffix logic
- Wire overwrite behavior from output step through to processing job
- Fix rotation/flip to apply when resize step is enabled, not just adjustments
2026-03-06 15:17:59 +02:00
064194df3d Fix imported presets not persisting, remove duplicate help handler 2026-03-06 15:12:06 +02:00
5881fb6eae Restore session settings for convert format, quality preset, and metadata mode
- Parse stored format/quality/metadata strings back to enum values on launch
- Remove duplicate help button handler
- Session now properly round-trips all wizard state between launches
2026-03-06 15:10:28 +02:00
fdaedd8d1a Wire progressive JPEG, AVIF speed, and custom per-format quality to encoder
- Add EncoderOptions struct with progressive_jpeg and avif_speed fields
- Pass encoder options through ProcessingJob to PipelineExecutor
- mozjpeg set_progressive_mode() called when progressive JPEG enabled
- AVIF encoder speed now configurable (was hardcoded to 6)
- run_processing uses CompressConfig::Custom when user overrides preset defaults
- Executor properly handles AVIF quality and PNG level in Custom mode
2026-03-06 15:07:54 +02:00
52b7a7fed2 Wire help button to show contextual step help dialog
Connect the header bar help button to the existing show_step_help
function, showing context-aware help for the current wizard step.
Remove duplicate function definition.
2026-03-06 14:59:29 +02:00
edc5b1acee Guard output summary adjustments behind adjustments_enabled flag
Rotation, flip, brightness, contrast, and other adjustment operations
only appear in the output step summary when the adjustments step is
enabled in the workflow configuration.
2026-03-06 14:57:38 +02:00
abd8393079 Auto-show What's New dialog on first launch after update
Track last_seen_version in session state. Show the What's New dialog
automatically when the version changes, but not on very first run
(where the welcome wizard is shown instead).
2026-03-06 14:54:43 +02:00
d1b811aa6a Add wizard step-skipping for disabled operations
Steps for disabled operations (resize, adjustments, convert, compress,
metadata, watermark, rename) are automatically skipped when navigating
forward or backward. Jump-to-step also respects skip logic.
2026-03-06 14:53:04 +02:00
23c1f33d32 Support per-format conversion mapping in processing pipeline
Build FormatMapping when per-format overrides are set in the convert
step advanced options, falling back to SingleFormat when no overrides
are configured.
2026-03-06 14:51:17 +02:00
2c28c092d4 Wire missing UI controls to job config
- Add adjustments_enabled field and guard rotation/flip/adjustments behind it
- Wire adjustments toggle in workflow step
- Wire progressive JPEG toggle in convert and compress steps
- Wire format mapping ComboRows (JPEG/PNG/WebP/TIFF) in convert step
- Wire AVIF quality, WebP effort, AVIF speed controls in compress step
- Initialize all new controls from current config values
2026-03-06 14:50:12 +02:00
3aeb05c9a0 Replace custom shortcuts dialog with GtkShortcutsWindow, fix Process More button
- Use proper GtkShortcutsWindow with ShortcutsSection/Group/Shortcut widgets
  instead of custom AdwDialog with ActionRows
- Hide step indicator during processing and results screens
- Fix "Process More" button re-triggering processing instead of resetting wizard
- Add accessible label to resize step size preview DrawingArea
2026-03-06 14:46:54 +02:00
f71b55da72 Add image adjustments pipeline (brightness, contrast, crop, effects)
New AdjustmentsConfig with brightness, contrast, saturation, sharpen,
grayscale, sepia, crop to aspect ratio, trim whitespace, and canvas
padding. All wired from UI through to executor.

- Saturation uses luminance-based color blending
- Sepia uses standard matrix transformation
- Crop calculates center crop from aspect ratio
- Trim whitespace detects uniform border by corner pixel comparison
- Canvas padding adds white border around image
2026-03-06 14:24:14 +02:00
3070980241 Add CSS provider for thumbnail grid styling
Load application CSS at startup with rounded corners for thumbnail
frames and grid padding.
2026-03-06 14:02:49 +02:00
b79ce58338 Add accessible value updates to processing progress bar
Screen readers now announce progress bar value with descriptive
text like "Processing 5 of 47: sunset.jpg" during batch processing,
instead of just reporting the fraction.
2026-03-06 13:53:32 +02:00
abd794b3b9 Wire thread count and error behavior settings into executor
The PipelineExecutor now stores thread_count and pause_on_error
fields. When pause_on_error is enabled, the executor sets the
pause flag on failures so the user can review errors. The GUI
reads these settings from AppConfig before starting processing.
2026-03-06 13:52:08 +02:00
bcf57927e9 Add per-step contextual help button in header bar
A "?" button in the header bar shows an AlertDialog with help
text specific to the current wizard step, explaining what each
step does and key shortcuts available.
2026-03-06 13:48:13 +02:00
257fd53bbc Add Ctrl+V clipboard paste for images
Reads image textures from the system clipboard, saves as temporary
PNG files, and adds them to the batch. Shows toast notification
on success or when no image is found.
2026-03-06 13:46:20 +02:00
0ca15536ae Add Escape key shortcut and subfolder prompt for folder drops
Escape now goes to previous wizard step (cancel/go back). When
a folder with subfolders is dropped on the images step, an alert
dialog asks whether to include subfolder images. The choice is
remembered for the rest of the session.
2026-03-06 13:45:06 +02:00
e02d677e5c Add Ctrl+Z undo last batch and register select/deselect shortcuts
- Ctrl+Z moves output files from last batch to system trash via GIO
- Select all / deselect all actions now registered as window actions
- Shortcuts registered: Ctrl+A, Ctrl+Shift+A, Ctrl+Z
2026-03-06 13:35:45 +02:00
137bb77faa Add Ctrl+A and Ctrl+Shift+A keyboard shortcuts for select/deselect all
- Register select-all-images and deselect-all-images actions
- Wire Ctrl+A to clear exclusion set, Ctrl+Shift+A to exclude all
- Both shortcuts update checkbox state and count label in images step
- Make set_all_checkboxes_in public for cross-module access
2026-03-06 13:33:06 +02:00
819ac963de Respect excluded files in output step counts and processing validation
- Output step now shows only included (non-excluded) image count and size
- Navigate-to-step refresh accounts for exclusions
- Process action checks for included images, not just loaded files
2026-03-06 13:31:35 +02:00
2911c608c2 Add per-image checkboxes and wire Select All / Deselect All buttons
- Each image row now has a CheckButton for include/exclude from processing
- Select All clears exclusion set, Deselect All adds all files to it
- Count label shows "X/Y images selected" when some are excluded
- Processing respects excluded files - only processes checked images
- Clear All also resets exclusion set
- AppState gains excluded_files HashSet for tracking
2026-03-06 13:24:18 +02:00
b78f1cd7c4 Add What's New dialog, accessibility labels, focus management
Add What's New dialog accessible from hamburger menu showing version
changelog. Add accessible property labels to step indicator for screen
reader support with current step/total announcements. Add focus
management on step transitions - focus moves to first interactive
element when navigating to a new step.
2026-03-06 13:13:39 +02:00
3ae84297d5 Add crop/trim/canvas padding to adjustments, wire all sliders to config
Add crop to aspect ratio (8 ratios), trim whitespace, and canvas padding
controls to the adjustments step per design doc. Wire brightness,
contrast, saturation, sharpen, grayscale, and sepia to JobConfig. Add
Select All / Deselect All toolbar buttons to images step. Include new
adjustment operations in output step summary.
2026-03-06 13:09:45 +02:00
0234f872bc Add custom workflow operation toggles, improve output step summary
Workflow step: replace the auto-advancing Custom card with a proper
operation checklist using SwitchRow toggles for each operation (Resize,
Adjustments, Convert, Compress, Metadata, Watermark, Rename). Wired
to job config so selections persist through the wizard.

Output step: show actual file size alongside image count. Refresh
both count and size dynamically when navigating to the output step.
2026-03-06 13:00:52 +02:00