Skip to content

fix: display HEIC/DNG/ARW/TIFF photos in non-Safari browsers#1161

Closed
vqminh wants to merge 1 commit into
bpatrik:masterfrom
vqminh:fix/heic-display
Closed

fix: display HEIC/DNG/ARW/TIFF photos in non-Safari browsers#1161
vqminh wants to merge 1 commit into
bpatrik:masterfrom
vqminh:fix/heic-display

Conversation

@vqminh

@vqminh vqminh commented Jun 5, 2026

Copy link
Copy Markdown

Two issues fixed:

  1. Convert non-browser-native formats to WebP for full-res viewing. HEIC, DNG, ARW, and TIFF files were served raw to the browser, but only Safari supports HEIC natively. Now these formats are converted to full-resolution WebP on first access and cached in TranscodedFolder.

  2. Check file size when validating cached thumbnails. Previously the code used fsp.access()/fs.existsSync() which only checks existence. Failed conversions that produced 0-byte files were treated as valid thumbnails, permanently breaking those photos. Now all cache checks verify stat.size > 0.

Two issues fixed:

1. Convert non-browser-native formats to WebP for full-res viewing.
   HEIC, DNG, ARW, and TIFF files were served raw to the browser, but
   only Safari supports HEIC natively. Now these formats are converted
   to full-resolution WebP on first access and cached in TranscodedFolder.

2. Check file size when validating cached thumbnails.
   Previously the code used fsp.access()/fs.existsSync() which only
   checks existence. Failed conversions that produced 0-byte files were
   treated as valid thumbnails, permanently breaking those photos.
   Now all cache checks verify stat.size > 0.
*/
private static async convertedFileExists(filePath: string): Promise<boolean> {
try {
const stat = await fsp.stat(filePath);
@vqminh vqminh closed this Jun 5, 2026
@vqminh vqminh deleted the fix/heic-display branch June 5, 2026 20:19
@bpatrik

bpatrik commented Jun 6, 2026

Copy link
Copy Markdown
Owner

I think we do this already. or at least partially. There might be some issue when zooming in

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.

3 participants