Skip to content

Raw support#4130

Merged
ildyria merged 10 commits intomasterfrom
raw-support
Feb 28, 2026
Merged

Raw support#4130
ildyria merged 10 commits intomasterfrom
raw-support

Conversation

@ildyria
Copy link
Member

@ildyria ildyria commented Feb 28, 2026

Fixes #1554

Summary by CodeRabbit

  • New Features

    • Preserve uploaded RAW/HEIC/PSD originals, auto-convert for display, and add optional "Download RAW" in the gallery when available and enabled.
    • Storage/space reporting now accounts for RAW files.
  • Documentation

    • Added full feature plan, spec, roadmap entries, tasks, scenarios, and knowledge-map updates for RAW upload support.
  • Tests

    • New unit and integration tests covering RAW detection, conversion, and download behavior.
  • Chores

    • New config to enable/disable RAW downloads and many translation entries for the new UI text.

@ildyria ildyria requested a review from a team as a code owner February 28, 2026 12:05
@coderabbitai
Copy link

coderabbitai bot commented Feb 28, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between faef288 and 6ae60c5.

📒 Files selected for processing (1)
  • app/Actions/Diagnostics/Pipes/Checks/DBIntegrityCheck.php

📝 Walkthrough

Walkthrough

Adds Feature 020 (Raw Upload Support): introduces a RAW size variant (value 0) and shifts existing variants +1; detects and preserves RAW/HEIC/PSD originals, converts to JPEG for display, adds RAW storage/DB pipeline, gated RAW download config, migrations, docs, tests, and frontend/state updates.

Changes

Cohort / File(s) Summary
Feature docs & planning
docs/specs/4-architecture/features/020-raw-upload-support/*, docs/specs/4-architecture/knowledge-map.md, docs/specs/4-architecture/roadmap.md, docs/specs/4-architecture/open-questions.md, docs/specs/3-reference/image-processing.md, docs/specs/4-architecture/features/020-raw-upload-support/tasks.md
New comprehensive spec, plan, task checklist, knowledge map, scenarios, and reference updates describing RAW pipeline, migrations, increments, and exit criteria.
Enums & types
app/Enum/SizeVariantType.php, app/Enum/DownloadVariantType.php, resources/js/lychee.d.ts, resources/js/components/maintenance/MaintenanceGenSizevariants.vue, resources/js/utils/StatsSizeVariantToColours.ts
Adds RAW = 0, shifts existing SizeVariantType values +1; adds DownloadVariantType::RAW; updates TypeScript and frontend mappings/colors to new numbering.
Pipes & converters
app/Actions/Photo/Pipes/Init/DetectAndStoreRaw.php, app/Actions/Photo/Pipes/Standalone/CreateRawSizeVariant.php, app/Actions/Photo/Convert/RawToJpeg.php, app/Actions/Photo/Pipes/Init/ConvertUnsupportedMedia.php (removed), app/Actions/Photo/Convert/PhotoConverterFactory.php (removed), app/Contracts/PhotoCreate/PhotoConverter.php (removed), app/Enum/ConvertableImageType.php (removed)
Replaces ConvertUnsupportedMedia with DetectAndStoreRaw; adds CreateRawSizeVariant; introduces RawToJpeg (preserves source); removes legacy factory/contract/enum used for HEIC handling.
Create pipeline wiring
app/Actions/Photo/Create.php, app/DTO/PhotoCreate/InitDTO.php, app/DTO/PhotoCreate/StandaloneDTO.php
Wires DetectAndStoreRaw into init pipeline; adds raw_source_file property to InitDTO and StandaloneDTO; inserts CreateRawSizeVariant into standalone flows.
Storage, naming & defaults
app/Assets/BaseSizeVariantNamingStrategy.php, app/Contracts/Models/AbstractSizeVariantNamingStrategy.php, app/Image/SizeVariantDefaultFactory.php, app/Actions/Photo/BaseArchive.php
Adjusts extension/naming logic for RAW, adds public getExtension(), treats RAW like ORIGINAL for some defaults, and ensures archive filenames omit width×height suffix for ORIGINAL and RAW.
Watermarking & metadata
app/Image/Watermarker.php, app/Actions/Photo/Pipes/Init/LoadFileMetadata.php
Skips watermarking for RAW; prevents deriving watermark path for RAW; metadata extraction prefers RAW source for EXIF/title when present.
Model & statistics
app/Models/Extensions/SizeVariants.php, app/Models/AlbumSizeStatistics.php, app/Actions/Statistics/Spaces.php, app/Jobs/RecomputeAlbumSizeJob.php, database/factories/SizeVariantFactory.php
Adds RAW size variant to SizeVariants model, AlbumSizeStatistics (size_raw), statistics queries and recompute job; factory includes RAW dimensions.
Config, migrations & DB
database/migrations/2026_02_28_000001_shift_size_variant_type_for_raw.php, database/migrations/2026_02_28_000002_add_raw_download_enabled_config.php, database/migrations/2026_02_28_000003_reclassify_existing_raw_format_files.php, database/migrations/2026_02_28_000004_add_size_raw_to_album_size_statistics.php
Adds migrations: two-phase enum shift to avoid unique constraint, config raw_download_enabled (default false), reclassification of existing originals matching configured raw formats, and size_raw column.
Acceptance & file extensions
app/Services/Image/FileExtensionService.php, app/Enum/SizeVariantType.php
Introduces CONVERTIBLE_RAW_EXTENSIONS constant and integrates into accepted extensions logic; excludes PDFs from RAW conversion; updates SizeVariantType name/localization to include RAW.
Authorization, resources & API
app/Http/Requests/Album/ZipRequest.php, app/Http/Resources/GalleryConfigs/InitConfig.php, app/Http/Resources/Models/SizeVariantsResouce.php
Adds ZipRequest guard for RAW downloads based on raw_download_enabled; exposes is_raw_download_enabled in InitConfig; SizeVariantsResource optionally includes raw resource when enabled.
Frontend & state
resources/js/components/modals/DownloadPhoto.vue, resources/js/stores/LycheeState.ts, resources/js/views/Maintenance.vue, resources/js/components/forms/sharing/CreateSharing.vue, resources/js/composables/contextMenus/contextMenu.ts, resources/js/services/album-service.ts
Adds RAW download button and conditional rendering, is_raw_download_enabled state, downloadVariant helper, updates variant mappings and maintenance view; replaces some AlbumResource types with Head variants; removes album-service.get().
Localization
lang/*/all_settings.php, lang/*/gallery.php (multiple locales)
Adds raw_download_enabled translations in settings and raw/download_raw keys in gallery translations across many locales.
Tests & fixtures
tests/Unit/Actions/Photo/Pipes/Init/DetectAndStoreRawTest.php, tests/Unit/Actions/Photo/Pipes/Init/ConvertUnsupportedMediaTest.php (removed), tests/ImageProcessing/Image/Handlers/RawUploadImagickTest.php, tests/Feature_v2/Maintenance/GenSizeVariantsTest.php, tests/Constants/TestConstants.php
Introduces DetectAndStoreRaw unit tests and RawUploadImagick integration tests; removes ConvertUnsupportedMediaTest; updates test constants and GenSizeVariantsTest to reflect variant numbering shift and new behavior.
Diagnostics & integrity
app/Actions/Diagnostics/Pipes/Checks/DBIntegrityCheck.php
Replaces literal size variant type checks with enum usage (SizeVariantType::ORIGINAL) and adjusts subquery selection.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 I nibble bits of RAW and JPEG light,
I stash originals through the quiet night,
Enums hop one step, pipelines softly hum,
Downloads wait behind a guarded thumb—
Hooray for bytes preserved and bright! 📸

🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.04% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/specs/4-architecture/open-questions.md (1)

1770-1770: ⚠️ Potential issue | 🟡 Minor

Update the last modified date.

The last updated date is 2026-01-02, but this PR was created on 2026-02-28 and adds new Feature 020 content. The date should reflect the most recent changes.

📅 Proposed fix
-*Last updated: 2026-01-02*
+*Last updated: 2026-02-28*
docs/specs/4-architecture/roadmap.md (1)

101-101: ⚠️ Potential issue | 🟡 Minor

Update the last modified date.

The last updated date is 2026-02-26, but this PR adds Feature 020 content on 2026-02-28. The date should reflect the most recent changes.

📅 Proposed fix
-*Last updated: 2026-02-26*
+*Last updated: 2026-02-28*

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ee6e26 and 0ca8af2.

📒 Files selected for processing (5)
  • docs/specs/4-architecture/features/020-raw-upload-support/plan.md
  • docs/specs/4-architecture/features/020-raw-upload-support/spec.md
  • docs/specs/4-architecture/features/020-raw-upload-support/tasks.md
  • docs/specs/4-architecture/open-questions.md
  • docs/specs/4-architecture/roadmap.md

Add first-class RAW file support: camera RAW/HEIC/PSD files are preserved
as a dedicated RAW size variant (type=0) while being converted to JPEG for
display. All existing variant types shifted by +1.

Backend:
- SizeVariantType: RAW=0, ORIGINAL=1, ..., PLACEHOLDER=8 (4 migrations)
- RawToJpeg: Imagick converter (quality 92, preserves source)
- DetectAndStoreRaw: Init pipe replacing ConvertUnsupportedMedia
- CreateRawSizeVariant: Standalone pipe after CreateOriginalSizeVariant
- CONVERTIBLE_RAW_EXTENSIONS: .nef .cr2 .cr3 .arw .dng .orf .rw2 .raf
  .pef .srw .nrw .psd .heic .heif (14 formats)
- Removed: HeifToJpeg, ConvertUnsupportedMedia, PhotoConverterFactory,
  ConvertableImageType, PhotoConverter interface
- PhotoResource: has_raw flag (bool)
- ZipRequest: raw_download_enabled config gate for RAW downloads
- DownloadVariantType::RAW = 'RAW'
- InitConfig: is_raw_download_enabled exposed to frontend
- AlbumSizeStatistics + Spaces.php: size_raw column throughout
- RecomputeAlbumSizeJob: size_raw in computeSizes()

Migrations:
- 000001: two-phase type column shift (safe for SQLite/MySQL/PostgreSQL)
- 000002: add raw_download_enabled config (default false)
- 000003: reclassify existing raw-format ORIGINAL rows to RAW (excl. PDF)
- 000004: add size_raw to album_size_statistics

Frontend:
- DownloadPhoto.vue: conditional RAW download button, updated svtoVariant
  and isDownloadable for new enum values
- LycheeState.ts: is_raw_download_enabled state
- StatsSizeVariantToColours.ts + MaintenanceGenSizevariants.vue: updated
  for shifted enum values
- Maintenance.vue: updated :sv prop values
- TypeScript types regenerated (has_raw, RAW variant, SizeVariantType 0-8)

Translations:
- lang/en/gallery.php: 'raw', 'download_raw'
- lang/en/all_settings.php: raw_download_enabled description + details
- Placeholders in 21 other languages

Tests:
- RawUploadImagickTest: 4 integration tests (HEIC creates RAW, JPEG/PNG
  unaffected, TIFF in raw_formats stays ORIGINAL)
- DetectAndStoreRawTest: 4 unit tests
- All 38 RAW-related tests passing; PHPStan 0 errors; php-cs-fixer clean

Spec impact: All 47 tasks (T-020-01 to T-020-47) complete. Roadmap status
updated to Complete. knowledge-map.md and image-processing.md updated.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/Image/SizeVariantDimensionHelpers.php (1)

63-77: ⚠️ Potential issue | 🟠 Major

isEnabledByConfiguration() still throws for RAW/ORIGINAL (unreachable false branch).

Because getMaxDimensions() is called first, RAW/ORIGINAL hit exceptions from getMaxWidth()/getMaxHeight() before the new match arm can return false.

💡 Proposed fix
 public function isEnabledByConfiguration(SizeVariantType $size_variant): bool
 {
+	if ($size_variant === SizeVariantType::RAW || $size_variant === SizeVariantType::ORIGINAL) {
+		return false;
+	}
+
 	$max_dim = $this->getMaxDimensions($size_variant);
 	if ($max_dim->width === 0 && $max_dim->height === 0) {
 		return false;
 	}

 	return match ($size_variant) {
 		SizeVariantType::MEDIUM2X => $this->config_manager->getValueAsBool('medium_2x'),
 		SizeVariantType::SMALL2X => $this->config_manager->getValueAsBool('small_2x'),
 		SizeVariantType::THUMB2X => $this->config_manager->getValueAsBool('thumb_2x'),
 		SizeVariantType::PLACEHOLDER => $this->config_manager->getValueAsBool('low_quality_image_placeholder'),
 		SizeVariantType::SMALL, SizeVariantType::MEDIUM, SizeVariantType::THUMB => true,
-		SizeVariantType::RAW, SizeVariantType::ORIGINAL => false,
 	};
 }

Also applies to: 112-113, 129-130

🧹 Nitpick comments (3)
lang/el/gallery.php (1)

29-29: Empty translation value for 'download_raw'.

The translation key follows the correct snake_case convention, but the value is an empty string. This will result in no visible text for Greek users when the RAW download option is displayed. Consider providing a Greek translation (e.g., 'Λήψη RAW' or similar) or using a fallback English value like 'Download RAW'.

Based on learnings: ildyria does not prioritize strict localization consistency for new menu items, so this may be intentional.

lang/bg/gallery.php (1)

29-29: Use a non-empty fallback value for download_raw.

Line 29 currently sets download_raw to an empty string; this can produce a blank menu/button label in UI. Prefer a non-empty fallback string.

Proposed change
-    'download_raw' => '',
+    'download_raw' => 'Download RAW',
docs/specs/4-architecture/knowledge-map.md (1)

294-294: Update the "Last updated" date.

As per coding guidelines, the last updated date should reflect when the document was modified. This should be updated to "February 28, 2026" to match the current changes.

-*Last updated: January 14, 2026*
+*Last updated: February 28, 2026*

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ca8af2 and 85e535c.

📒 Files selected for processing (89)
  • app/Actions/Photo/BaseArchive.php
  • app/Actions/Photo/Convert/PhotoConverterFactory.php
  • app/Actions/Photo/Convert/RawToJpeg.php
  • app/Actions/Photo/Create.php
  • app/Actions/Photo/Pipes/Init/ConvertUnsupportedMedia.php
  • app/Actions/Photo/Pipes/Init/DetectAndStoreRaw.php
  • app/Actions/Photo/Pipes/Standalone/CreateRawSizeVariant.php
  • app/Actions/Statistics/Spaces.php
  • app/Assets/BaseSizeVariantNamingStrategy.php
  • app/Contracts/Models/AbstractSizeVariantNamingStrategy.php
  • app/Contracts/PhotoCreate/PhotoConverter.php
  • app/DTO/PhotoCreate/InitDTO.php
  • app/DTO/PhotoCreate/StandaloneDTO.php
  • app/Enum/ConvertableImageType.php
  • app/Enum/DownloadVariantType.php
  • app/Enum/SizeVariantType.php
  • app/Http/Requests/Album/ZipRequest.php
  • app/Http/Resources/GalleryConfigs/InitConfig.php
  • app/Http/Resources/Models/PhotoResource.php
  • app/Image/SizeVariantDefaultFactory.php
  • app/Image/SizeVariantDimensionHelpers.php
  • app/Image/Watermarker.php
  • app/Jobs/RecomputeAlbumSizeJob.php
  • app/Models/AlbumSizeStatistics.php
  • app/Models/Extensions/SizeVariants.php
  • database/factories/SizeVariantFactory.php
  • database/migrations/2026_02_28_000001_shift_size_variant_type_for_raw.php
  • database/migrations/2026_02_28_000002_add_raw_download_enabled_config.php
  • database/migrations/2026_02_28_000003_reclassify_existing_raw_format_files.php
  • database/migrations/2026_02_28_000004_add_size_raw_to_album_size_statistics.php
  • docs/specs/3-reference/image-processing.md
  • docs/specs/4-architecture/features/020-raw-upload-support/tasks.md
  • docs/specs/4-architecture/knowledge-map.md
  • docs/specs/4-architecture/roadmap.md
  • lang/ar/all_settings.php
  • lang/ar/gallery.php
  • lang/bg/all_settings.php
  • lang/bg/gallery.php
  • lang/cz/all_settings.php
  • lang/cz/gallery.php
  • lang/de/all_settings.php
  • lang/de/gallery.php
  • lang/el/all_settings.php
  • lang/el/gallery.php
  • lang/en/all_settings.php
  • lang/en/gallery.php
  • lang/es/all_settings.php
  • lang/es/gallery.php
  • lang/fa/all_settings.php
  • lang/fa/gallery.php
  • lang/fr/all_settings.php
  • lang/fr/gallery.php
  • lang/hu/all_settings.php
  • lang/hu/gallery.php
  • lang/it/all_settings.php
  • lang/it/gallery.php
  • lang/ja/all_settings.php
  • lang/ja/gallery.php
  • lang/nl/all_settings.php
  • lang/nl/gallery.php
  • lang/no/all_settings.php
  • lang/no/gallery.php
  • lang/pl/all_settings.php
  • lang/pl/gallery.php
  • lang/pt/all_settings.php
  • lang/pt/gallery.php
  • lang/ru/all_settings.php
  • lang/ru/gallery.php
  • lang/sk/all_settings.php
  • lang/sk/gallery.php
  • lang/sv/all_settings.php
  • lang/sv/gallery.php
  • lang/vi/all_settings.php
  • lang/vi/gallery.php
  • lang/zh_CN/all_settings.php
  • lang/zh_CN/gallery.php
  • lang/zh_TW/all_settings.php
  • lang/zh_TW/gallery.php
  • resources/js/components/maintenance/MaintenanceGenSizevariants.vue
  • resources/js/components/modals/DownloadPhoto.vue
  • resources/js/lychee.d.ts
  • resources/js/stores/LycheeState.ts
  • resources/js/utils/StatsSizeVariantToColours.ts
  • resources/js/views/Maintenance.vue
  • tests/Constants/TestConstants.php
  • tests/Feature_v2/Maintenance/GenSizeVariantsTest.php
  • tests/ImageProcessing/Image/Handlers/RawUploadImagickTest.php
  • tests/Unit/Actions/Photo/Pipes/Init/ConvertUnsupportedMediaTest.php
  • tests/Unit/Actions/Photo/Pipes/Init/DetectAndStoreRawTest.php
💤 Files with no reviewable changes (5)
  • tests/Unit/Actions/Photo/Pipes/Init/ConvertUnsupportedMediaTest.php
  • app/Actions/Photo/Pipes/Init/ConvertUnsupportedMedia.php
  • app/Actions/Photo/Convert/PhotoConverterFactory.php
  • app/Contracts/PhotoCreate/PhotoConverter.php
  • app/Enum/ConvertableImageType.php
✅ Files skipped from review due to trivial changes (3)
  • lang/fr/gallery.php
  • lang/sk/gallery.php
  • lang/nl/all_settings.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/specs/4-architecture/roadmap.md

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
lang/ja/gallery.php (1)

19-30: ⚠️ Potential issue | 🟡 Minor

Avoid empty translations for visible UI labels.

Line 19 (raw) and Line 30 (download_raw) are set to empty strings, which can render blank labels in the Japanese UI. Please provide non-empty values (or temporarily omit the keys so fallback text can be used).

Suggested fix
-    'raw' => '',
+    'raw' => 'RAW',
@@
-    'download_raw' => '',
+    'download_raw' => 'RAWをダウンロード',
lang/no/gallery.php (1)

19-30: ⚠️ Potential issue | 🟡 Minor

Fill RAW labels with non-empty translations.

Line 19 and Line 30 currently use empty strings, which will render blank labels in Norwegian UI for RAW-related actions. Please set fallback text (Norwegian preferred, English acceptable until translated).

💡 Suggested patch
-    'raw' => '',
+    'raw' => 'RAW',
...
-    'download_raw' => '',
+    'download_raw' => 'Last ned RAW',
🧹 Nitpick comments (1)
lang/ru/gallery.php (1)

18-18: Empty translation values for new RAW-related keys.

The 'raw' and 'download_raw' keys have empty string values. Russian users will see blank labels in the UI for these elements. Consider adding placeholder text (e.g., English fallback or Russian translation like 'RAW' / 'Скачать RAW') to avoid empty UI elements.

Based on learnings: maintainer does not prioritize strict localization consistency, so this may be intentional.

💬 Suggested Russian translations
-    'raw' => '',
+    'raw' => 'RAW',
-    'download_raw' => '',
+    'download_raw' => 'Скачать RAW',

Also applies to: 29-29


ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85e535c and 105c5c1.

📒 Files selected for processing (25)
  • lang/ar/gallery.php
  • lang/bg/gallery.php
  • lang/cz/gallery.php
  • lang/de/gallery.php
  • lang/el/gallery.php
  • lang/es/gallery.php
  • lang/fa/gallery.php
  • lang/fr/gallery.php
  • lang/hu/gallery.php
  • lang/it/gallery.php
  • lang/ja/gallery.php
  • lang/nl/gallery.php
  • lang/no/gallery.php
  • lang/pl/gallery.php
  • lang/pt/gallery.php
  • lang/ru/gallery.php
  • lang/sk/gallery.php
  • lang/sv/gallery.php
  • lang/vi/gallery.php
  • lang/zh_CN/gallery.php
  • lang/zh_TW/gallery.php
  • resources/js/components/forms/sharing/CreateSharing.vue
  • resources/js/composables/contextMenus/contextMenu.ts
  • resources/js/lychee.d.ts
  • resources/js/services/album-service.ts
💤 Files with no reviewable changes (1)
  • resources/js/services/album-service.ts
🚧 Files skipped from review as they are similar to previous changes (13)
  • lang/it/gallery.php
  • lang/zh_TW/gallery.php
  • lang/el/gallery.php
  • lang/hu/gallery.php
  • lang/bg/gallery.php
  • lang/pl/gallery.php
  • lang/vi/gallery.php
  • lang/cz/gallery.php
  • lang/de/gallery.php
  • lang/fa/gallery.php
  • lang/ar/gallery.php
  • lang/es/gallery.php
  • lang/nl/gallery.php

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 84.61538% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.52%. Comparing base (88ef5f9) to head (6ae60c5).
⚠️ Report is 1 commits behind head on master.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (7)
lang/es/all_settings.php (1)

58-58: New settings entries are in English within the Spanish locale file.

The new raw_download_enabled entries are in English, which is consistent with the rest of this file (all entries are currently in English). If this file is intended as a Spanish translation rather than a fallback, these strings should eventually be translated:

  • Line 58: 'Allow users to download the original RAW file' → Spanish translation needed
  • Line 393: 'When enabled, users with download permissions can download the untouched RAW/HEIC/PSD file that was preserved during upload.' → Spanish translation needed

If the entire file is intentionally using English as a fallback, this is fine as-is.

Also applies to: 393-393

lang/vi/gallery.php (1)

30-30: Consider translating to Vietnamese for consistency.

The value 'Download RAW' is in English. For consistency with other Vietnamese translations in this file (e.g., 'Ghim', 'Album được ghim', 'công khai nhưng ẩn'), consider using a Vietnamese translation like 'Tải xuống RAW'.

That said, this follows the existing pattern where some strings remain untranslated, so it's acceptable as-is.

lang/ar/all_settings.php (1)

58-58: Consider aligning wording for supported source formats.

documentation.raw_download_enabled mentions only “RAW”, while details.raw_download_enabled mentions “RAW/HEIC/PSD”. Using consistent text (e.g., “original source file (RAW/HEIC/PSD)”) in both places would reduce ambiguity in settings UI.

Also applies to: 393-393

lang/fr/all_settings.php (1)

56-56: French translations are in English.

Both raw_download_enabled entries contain English text instead of French translations. Other entries in this file use empty strings '' as placeholders for untranslated content (see lines 9-16), or provide actual French text.

Consider either:

  1. Providing French translations, or
  2. Using empty strings as placeholders for consistency with other untranslated entries
Suggested French translations
-        'raw_download_enabled' => 'Allow users to download the original RAW file',
+        'raw_download_enabled' => 'Autoriser les utilisateurs à télécharger le fichier RAW original',
-        'raw_download_enabled' => 'When enabled, users with download permissions can download the untouched RAW/HEIC/PSD file that was preserved during upload.',
+        'raw_download_enabled' => 'Lorsqu\'activé, les utilisateurs avec les permissions de téléchargement peuvent télécharger le fichier RAW/HEIC/PSD original qui a été conservé lors du téléversement.',

Also applies to: 391-391

app/Services/Image/FileExtensionService.php (2)

187-187: Fix typo in comment.

Minor typo: "We imagick is enabeld" should be "If Imagick is enabled" or "When Imagick is enabled".

Proposed fix
-			// We imagick is enabeld, then we can allow PDF files.
+			// If Imagick is enabled, we can allow PDF files.

93-114: Document ImageMagick/LibRaw delegate requirements for RAW format conversion.

The CONVERTIBLE_RAW_EXTENSIONS constant assumes Imagick can convert all listed formats, but this depends entirely on how the deployed ImageMagick was built. CR3 specifically requires ImageMagick to be compiled with LibRaw ≥ 0.20; without it, CR3 conversion will fail at runtime. Other formats (.nef, .cr2, etc.) may fall back to older delegates like dcraw or ufraw-batch, but CR3 is not reliably handled by these tools. Add a comment documenting the ImageMagick build requirement (LibRaw delegate support) to clarify the deployment dependency, or consider adding a runtime verification method that checks ImageMagick's delegate capabilities before attempting conversion.

tests/Unit/Actions/Photo/Pipes/Init/DetectAndStoreRawTest.php (1)

119-129: Consider adding tests for conversion success/failure paths.

The current tests cover pass-through behavior for non-convertible formats. For complete coverage of DetectAndStoreRaw, consider adding:

  1. Successful conversion test: Mock RawToJpeg to return a converted file, verify raw_source_file is set and source_file is replaced
  2. Conversion failure test: Mock RawToJpeg to throw CannotConvertMediaFileException, verify graceful fallback behavior

Would you like me to generate the additional test cases?


ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 105c5c1 and faef288.

📒 Files selected for processing (57)
  • app/Actions/Photo/Pipes/Init/DetectAndStoreRaw.php
  • app/Actions/Photo/Pipes/Init/LoadFileMetadata.php
  • app/Actions/Photo/Pipes/Standalone/CreateRawSizeVariant.php
  • app/Http/Resources/Models/SizeVariantsResouce.php
  • app/Image/SizeVariantDimensionHelpers.php
  • app/Services/Image/FileExtensionService.php
  • database/migrations/2026_02_28_000003_reclassify_existing_raw_format_files.php
  • docs/specs/3-reference/image-processing.md
  • docs/specs/4-architecture/knowledge-map.md
  • docs/specs/4-architecture/roadmap.md
  • lang/ar/all_settings.php
  • lang/ar/gallery.php
  • lang/bg/all_settings.php
  • lang/bg/gallery.php
  • lang/cz/all_settings.php
  • lang/cz/gallery.php
  • lang/de/all_settings.php
  • lang/de/gallery.php
  • lang/el/all_settings.php
  • lang/el/gallery.php
  • lang/es/all_settings.php
  • lang/es/gallery.php
  • lang/fa/all_settings.php
  • lang/fa/gallery.php
  • lang/fr/all_settings.php
  • lang/fr/gallery.php
  • lang/hu/all_settings.php
  • lang/hu/gallery.php
  • lang/it/all_settings.php
  • lang/it/gallery.php
  • lang/ja/all_settings.php
  • lang/ja/gallery.php
  • lang/nl/all_settings.php
  • lang/nl/gallery.php
  • lang/no/all_settings.php
  • lang/no/gallery.php
  • lang/pl/all_settings.php
  • lang/pl/gallery.php
  • lang/pt/all_settings.php
  • lang/pt/gallery.php
  • lang/ru/all_settings.php
  • lang/ru/gallery.php
  • lang/sk/all_settings.php
  • lang/sk/gallery.php
  • lang/sv/all_settings.php
  • lang/sv/gallery.php
  • lang/vi/all_settings.php
  • lang/vi/gallery.php
  • lang/zh_CN/all_settings.php
  • lang/zh_CN/gallery.php
  • lang/zh_TW/all_settings.php
  • lang/zh_TW/gallery.php
  • resources/js/components/modals/DownloadPhoto.vue
  • resources/js/lychee.d.ts
  • tests/Constants/TestConstants.php
  • tests/ImageProcessing/Image/Handlers/RawUploadImagickTest.php
  • tests/Unit/Actions/Photo/Pipes/Init/DetectAndStoreRawTest.php
🚧 Files skipped from review as they are similar to previous changes (32)
  • lang/bg/gallery.php
  • lang/ru/gallery.php
  • lang/sv/all_settings.php
  • lang/zh_TW/all_settings.php
  • resources/js/components/modals/DownloadPhoto.vue
  • app/Image/SizeVariantDimensionHelpers.php
  • tests/ImageProcessing/Image/Handlers/RawUploadImagickTest.php
  • app/Actions/Photo/Pipes/Standalone/CreateRawSizeVariant.php
  • lang/ja/all_settings.php
  • lang/fa/all_settings.php
  • lang/zh_TW/gallery.php
  • lang/bg/all_settings.php
  • lang/el/all_settings.php
  • lang/nl/gallery.php
  • lang/el/gallery.php
  • lang/de/all_settings.php
  • lang/zh_CN/gallery.php
  • lang/hu/gallery.php
  • lang/vi/all_settings.php
  • lang/sk/all_settings.php
  • lang/pl/all_settings.php
  • docs/specs/4-architecture/knowledge-map.md
  • lang/cz/all_settings.php
  • lang/fr/gallery.php
  • lang/cz/gallery.php
  • lang/pt/gallery.php
  • lang/it/all_settings.php
  • lang/ru/all_settings.php
  • lang/zh_CN/all_settings.php
  • lang/nl/all_settings.php
  • lang/sv/gallery.php
  • docs/specs/4-architecture/roadmap.md

@ildyria ildyria merged commit 17e9ccb into master Feb 28, 2026
43 checks passed
@ildyria ildyria deleted the raw-support branch February 28, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RAW images support

1 participant