You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEVELOPER_GUIDE.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ The application is structured into two main packages: `core` and `ui`.
15
15
-**`model_rotation_detector.py`**: Lazy-loading ONNX orientation detector. Heavy dependencies (onnxruntime / torchvision / Pillow) are imported only on first prediction request. Never gate imports with environment variables—extend the lazy loader if further deferral is needed.
16
16
-**`rotation_detector.py`**: Orchestrates batch rotation detection using the model rotation detector (instantiated lazily on demand).
17
17
-**`image_processing/`**: Low-level image manipulation, such as RAW processing and rotation.
18
+
-**RAW Processing**: RAW images (.arw, .cr2, .cr3, .nef, .dng, etc.) are automatically detected by file extension and receive brightness and contrast adjustments during preview and thumbnail generation. This behavior is built into the image pipeline using internal `is_raw_extension()` detection and applies to all RAW files without requiring external parameters. The system uses `RAW_AUTO_EDIT_BRIGHTNESS_STANDARD = 1.15` for automatic brightness adjustment.
18
19
-**`image_orientation_handler.py`**: Handles EXIF-based image orientation correction and composite rotation calculations.
19
20
-**`file_scanner.py`**: Scans directories for image files.
20
21
-**`image_file_ops.py`**: Handles all file system operations, such as moving, renaming, and deleting files. This is the single source of truth for file manipulations.
@@ -93,7 +94,7 @@ The application is structured into two main packages: `core` and `ui`.
93
94
94
95
## 3. Coding Conventions
95
96
96
-
-**Configuration Constants**: All hardcoded values, thresholds, and configurable parameters must be centralized in `src/core/app_settings.py`. This includes UI dimensions, processing thresholds, cache sizes, AI/ML parameters, and other constants. Never use hardcoded values directly in the code - always import from `app_settings.py`.
97
+
-**Configuration Constants**: All hardcoded values, thresholds, and configurable parameters must be centralized in `src/core/app_settings.py`. This includes UI dimensions, processing thresholds, cache sizes, AI/ML parameters, RAW processing constants (like `RAW_AUTO_EDIT_BRIGHTNESS_STANDARD`), and other constants. Never use hardcoded values directly in the code - always import from `app_settings.py`.
97
98
98
99
-**Logging**: Use Python's `logging` module for all logging. **Do not use `print()`**.
99
100
@@ -171,12 +172,14 @@ Current layers:
171
172
- Integration tests for rotation acceptance (skipped automatically if `sample/` assets absent or GUI constraints unmet).
172
173
- Lazy loader tests ensure model instantiation is deferred and disabled mode returns 0.
173
174
- About dialog test runs with `block=False` to avoid modal blocking.
175
+
- Automatic RAW processing tests validate that file extension detection works correctly and that RAW files receive appropriate processing without external parameters.
174
176
175
177
Guidelines for new tests:
176
178
1. Favor pure function extraction for logic heavy UI code to enable headless unit tests.
177
179
2. Use non-blocking dialog patterns (`block=False`) where modal exec would hang CI.
178
180
3. Skip GUI-heavy tests gracefully when prerequisites (sample assets, GPU libs) are missing instead of failing.
179
181
4. When asserting selection advancement, test the helper function directly with synthetic path lists—only one integration test should cover the end-to-end GUI path.
182
+
5.**Critical Windows Testing Requirement**: All test files must start with `import pyexiv2 # noqa: F401 # Must be first to avoid Windows crash with pyexiv2` to prevent access violations in the native library. This import must be the very first import in every test file.
180
183
181
184
182
185
## 7. Adding New Image Feature Pipelines
@@ -217,6 +220,8 @@ When adding new controllers, follow the listed Extension Pattern to maintain con
217
220
| Rotation view crashes due to empty model | Guard with early returns; tests should skip rather than fail |
218
221
| Adding file operations outside `ImageFileOperations`| Refactor into `ImageFileOperations` to centralize side effects |
219
222
| Blocking modal dialogs in CI | Use `block=False` in tests, keep blocking in production UI |
223
+
| Test suite fails with Windows access violations | Ensure every test file starts with `import pyexiv2` as the first import |
224
+
| RAW processing not working | Check that `is_raw_extension()` detection is used instead of external `apply_auto_edits` parameters |
220
225
221
226
---
222
-
This guide reflects the state after introducing auto-advance rotation acceptance, selection heuristic refactor, lazy model loading, and updated testing patterns.
227
+
This guide reflects the state after introducing auto-advance rotation acceptance, selection heuristic refactor, lazy model loading, automatic RAW processing refactor, and updated testing patterns.
0 commit comments