Skip to content

[_]: fix/preview the HEIC photos of recent iPhones - #2274

Merged
xabg2 merged 3 commits into
masterfrom
fix/viewer-heic-preview
Nov 20, 2026
Merged

xabg2 merged 3 commits into
masterfrom
fix/viewer-heic-preview

Conversation

@xabg2

@xabg2 xabg2 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

HEIC photos taken with recent iPhones could not be previewed: the viewer showed "No preview available" because the library used to convert them (heic2any, unmaintained since 2023) does not support their format (ERR_LIBHEIF format not supported). The conversion now uses heic-to, which ships a recent libheif, and outputs JPEG.

Related Issues

N/A

Related Pull Requests

N/A

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

  • Opened HEIC photos from a recent iPhone in the viewer: they failed with ERR_LIBHEIF format not supported before the change.
  • Unit tests cover the conversion to JPEG and the fallback when a HEIC file cannot be converted.

Additional Notes

Replaces the heic2any dependency with heic-to.

Summary by CodeRabbit

  • Bug Fixes
    • Improved HEIC image previews by converting them to JPEG for display.
    • When conversion fails, the viewer now reports the error instead of presenting the image as successfully converted.

@xabg2 xabg2 added the bug Something isn't working label Nov 3, 2026
@xabg2 xabg2 self-assigned this Nov 3, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

HEIC preview conversion now uses heic-to to produce JPEG output at quality 0.92. The tests check successful conversion and verify error handling when conversion is rejected.

Changes: HEIC preview conversion

Layer / File(s) Summary
HEIC conversion and validation
package.json, src/app/drive/components/FileViewer/viewers/FileImageViewer/useDisplayableImage.ts, src/app/drive/components/FileViewer/viewers/FileImageViewer/FileImageViewer.test.tsx
The dependency changes from heic2any to heic-to. The preview hook requests JPEG output at quality 0.92. Tests check JPEG conversion and verify that a rejection calls onError without reporting converted content.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: terrerox

Merge Risk: Minimal · up to bc7bd

This change switches HEIC preview conversion to a library with newer HEIC support so recent iPhone photos can preview as JPEG. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix/preview the HEIC photos of recent iPhones" matches the main change. The PR replaces heic2any with heic-to so HEIC photos from recent iPhones can be previewed. The title uses a branch-st…
Description check Passed The description explains the problem ("No preview available" for HEIC photos from recent iPhones, caused by heic2any not supporting the format), the fix (heic-to with JPEG output), and the testing per…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix/preview the HEIC photos of recent iPhones" matches the main change. The PR replaces heic2any with heic-to so HEIC photos from recent iPhones can be previewed. The title uses a branch-style "fix/" prefix and a bracketed placeholder-like "[_]:" marker, which add noise but do not hide the meaning.

Full details: Description check

Explanation

The description explains the problem ("No preview available" for HEIC photos from recent iPhones, caused by heic2any not supporting the format), the fix (heic-to with JPEG output), and the testing performed. All template sections are present. Related Issues and Related Pull Requests are marked N/A. Three checklist items are unchecked: documentation, SonarCloud review, and QA. The Testing Process section lists local testing and unit tests but gives no details on the test configuration. The unchecked items are non-critical for this change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 98eb6c67-596c-4c40-a235-9e0b531b13ec
Commits

Reviewing files that changed from the base of the PR and between 5ecc593 and bc7bd32.

Files ignored due to path filters: 1

  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing: 3

  • package.json
  • src/app/drive/components/FileViewer/viewers/FileImageViewer/FileImageViewer.test.tsx
  • src/app/drive/components/FileViewer/viewers/FileImageViewer/useDisplayableImage.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: bc7bd32
Status: ✅  Deploy successful!
Preview URL: https://8a4154af.drive-web.pages.dev
Branch Preview URL: https://fix-viewer-heic-preview.drive-web.pages.dev

View logs

@xabg2
xabg2 marked this pull request as ready for review November 20, 2026 11:46
@sonarqubecloud

Copy link
Copy Markdown

@xabg2
xabg2 merged commit 983d4fd into master Nov 20, 2026
12 checks passed
@xabg2
xabg2 deleted the fix/viewer-heic-preview branch November 20, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants