Skip to content

Add support for HEIC/HEIF, GIF, and MOV formats with FFmpeg integration#171

Merged
SmilyOrg merged 7 commits intomainfrom
heif
Jan 26, 2026
Merged

Add support for HEIC/HEIF, GIF, and MOV formats with FFmpeg integration#171
SmilyOrg merged 7 commits intomainfrom
heif

Conversation

@SmilyOrg
Copy link
Owner

@SmilyOrg SmilyOrg commented Jan 26, 2026

Introduce support for HEIC, HEIF, GIF, and MOV formats, enhancing media compatibility. FFmpeg integration allows for decoding these formats, which are commonly used on iOS devices. The default configuration now includes these extensions for automatic indexing and display in Photofield.

Contributes to #52

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds default indexing + HTTP serving support for common iOS-related formats (HEIC/HEIF and Live Photo MOV) plus GIF, relying on FFmpeg for decoding when available. Contributes to #52 (iOS Live Photo support).

Changes:

  • Register additional MIME types for .heic, .heif, .gif, and .mov.
  • Extend default config to index/recognize HEIC/HEIF/GIF images and MOV videos.
  • Update runtime/dependency docs and Docker image dependencies; add an unreleased changelog entry.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
main.go Adds MIME mappings for HEIC/HEIF/GIF/MOV.
docs/dependencies.md Documents FFmpeg as the dependency enabling these formats (with version guidance).
defaults.yaml Adds .heic, .heif, .gif, .mov to default indexed extensions and image/video extension lists.
Dockerfile Updates Alpine base and documents/install runtime deps including FFmpeg.
.changes/unreleased/heic-support.md Adds unreleased changelog entry announcing the new format support.

Comment on lines +2295 to +2298
mime.AddExtensionType(".heic", "image/heic")
mime.AddExtensionType(".heif", "image/heif")
mime.AddExtensionType(".gif", "image/gif")
mime.AddExtensionType(".mov", "video/quicktime")
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

These new MIME registrations are inside if apiPrefix != "/" (the UI+API mode). In apiPrefix == "/" (API-only) mode they won’t run, so http.ServeFile for originals (e.g., /files/{id}) may still respond with application/octet-stream for HEIC/HEIF/GIF/MOV. Consider moving the relevant mime.AddExtensionType calls outside this conditional (or duplicating them for API-only) so content-types are correct in both modes.

Copilot uses AI. Check for mistakes.
Dockerfile Outdated

# Install runtime dependencies
# - exiftool: metadata extraction
# - ffmpeg: video thumbnails, HEIC/HEIF/MOV/GIF support (8.0.1+ includes HEVC decoder)
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The FFmpeg version guidance here ("8.0.1+ includes HEVC decoder") doesn’t match the docs (which recommend v7.0+) and may be inaccurate since HEVC support depends on how FFmpeg is built (codecs enabled), not just the version. Consider rewording to describe the required codec support (HEVC/H.265 + libheif) and keeping version recommendations consistent across docs and Dockerfile comments.

Suggested change
# - ffmpeg: video thumbnails, HEIC/HEIF/MOV/GIF support (8.0.1+ includes HEVC decoder)
# - ffmpeg: video thumbnails, HEIC/HEIF/MOV/GIF support (requires build with HEVC/H.265 decoder + libheif; FFmpeg 7.0+ recommended, see docs)

Copilot uses AI. Check for mistakes.

- [ExifTool]: Extracts metadata from many more formats than the embedded [goexif].
- [FFmpeg]: Generates video thumbnails and previews and adds support for more image formats (even basic RAW).
- [FFmpeg]: Generates video thumbnails and previews and adds support for more image formats including HEIC/HEIF (iOS photos), MOV (QuickTime videos), and basic RAW formats. **(v7.0+ recommended)**
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

This adds a specific FFmpeg version recommendation, but the Dockerfile comment references a different version. Consider keeping version guidance consistent across the repo (or avoiding a specific version and instead documenting the required codec support for HEIC/HEIF/MOV).

Suggested change
- [FFmpeg]: Generates video thumbnails and previews and adds support for more image formats including HEIC/HEIF (iOS photos), MOV (QuickTime videos), and basic RAW formats. **(v7.0+ recommended)**
- [FFmpeg]: Generates video thumbnails and previews and adds support for more image formats including HEIC/HEIF (iOS photos), MOV (QuickTime videos), and basic RAW formats.

Copilot uses AI. Check for mistakes.
time: 2026-01-25T21:00:00Z
---

HEIC (High Efficiency Image Container), HEIF (High Efficiency Image Format), GIF, and MOV (QuickTime) files are now fully supported. These formats, commonly used by iOS devices and other platforms, are decoded using FFmpeg when available. The extensions `.heic`, `.heif`, `.gif`, and `.mov` are now included in the default configuration, so Photofield will automatically index and display these files alongside your other media.
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The first sentence says these formats are "fully supported", but the next sentence makes support conditional on FFmpeg being available. Consider rephrasing to avoid implying unconditional support (e.g., "supported when FFmpeg is installed/available").

Suggested change
HEIC (High Efficiency Image Container), HEIF (High Efficiency Image Format), GIF, and MOV (QuickTime) files are now fully supported. These formats, commonly used by iOS devices and other platforms, are decoded using FFmpeg when available. The extensions `.heic`, `.heif`, `.gif`, and `.mov` are now included in the default configuration, so Photofield will automatically index and display these files alongside your other media.
HEIC (High Efficiency Image Container), HEIF (High Efficiency Image Format), GIF, and MOV (QuickTime) files are now supported when FFmpeg is available. These formats, commonly used by iOS devices and other platforms, are decoded using FFmpeg. The extensions `.heic`, `.heif`, `.gif`, and `.mov` are now included in the default configuration, so Photofield will automatically index and display these files alongside your other media when FFmpeg is installed.

Copilot uses AI. Check for mistakes.
@SmilyOrg
Copy link
Owner Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Jan 26, 2026

@SmilyOrg I've opened a new pull request, #172, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 5 commits January 26, 2026 18:13
Co-authored-by: SmilyOrg <1451391+SmilyOrg@users.noreply.github.com>
Co-authored-by: SmilyOrg <1451391+SmilyOrg@users.noreply.github.com>
Co-authored-by: SmilyOrg <1451391+SmilyOrg@users.noreply.github.com>
Co-authored-by: SmilyOrg <1451391+SmilyOrg@users.noreply.github.com>
@SmilyOrg SmilyOrg merged commit 0eda165 into main Jan 26, 2026
4 checks passed
@SmilyOrg SmilyOrg deleted the heif branch January 26, 2026 18:49
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.

2 participants