Skip to content

AVIF metadata workaround: syncing EXIF → embedded XMP #1710

@Mates-K1

Description

@Mates-K1

Note: This may not be the ideal long-term place for a detailed workaround like this.
If it makes sense, this information (or a simplified version of it) could possibly be included in the user_guide.pdf, as it addresses AVIF metadata behavior that users may encounter in practice.

Hi,

while working with AVIF files in netPhotoGraphics (using the xmpMetadata plugin), I ran into a limitation where most EXIF metadata embedded in AVIF images are not read by the gallery, whereas embedded XMP data are.

As a workaround, I created a small Windows batch script that copies selected EXIF fields into embedded XMP inside the same AVIF file (no sidecar .xmp files).

This makes camera info, exposure data, timestamps, GPS, etc. visible in netPhotoGraphics even for AVIF images.


🧩 What this solves

  • AVIF files do contain full EXIF metadata
  • the xmpMetadata plugin does read embedded XMP
  • copying selected EXIF fields into XMP makes metadata visible in the gallery
  • no database changes, no sidecar files

🖥️ Environment

  • OS: Windows 11
  • Gallery: netPhotoGraphics + xmpMetadata plugin
  • Image format: AVIF
  • Workflow: JPG → AVIF → EXIF → XMP sync

🔄 JPG → AVIF conversion

Tool used

XnConvert
https://www.xnconvert.com

  • Version: 1.106.0
  • Platform: Windows x64
  • Build date: Oct 12 2025
  • Libformat version: 7.228

Conversion settings are shown in the screenshot below.

Image

⚠️ Note
Converting JPG → AVIF using Zoner Studio caused issues in my setup:
AVIF images converted by Zoner Studio fail to display in the Bootstrap theme in netPhotoGraphics (image error / broken image).

The same images converted using XnConvert work correctly and display without issues.


📥 Dependency: ExifTool

ExifTool by Phil Harvey is required.

  • Official site: https://exiftool.org/
  • Download the Windows 64-bit executable
  • Rename exiftool(-k).exe to exiftool.exe
  • Adjust the path in the script if needed

🛠️ How to use

  1. Save the script below as a .bat file (e.g. sync-exif-to-xmp.bat)
  2. Place the .bat file in the same directory as your .avif files
  3. Update the EXIFTOOL path if ExifTool is installed elsewhere
  4. Run the script (double-click or from Command Prompt)

All .avif files in that directory will be processed.


📜 Batch script (Windows)

@echo off
chcp 65001 >nul
echo EXIF -> XMP synchronization for AVIF files...

set EXIFTOOL=C:\ExifTool\exiftool.exe

if not exist "%EXIFTOOL%" (
    echo Error: ExifTool was not found!
    pause
    exit /b
)

for %%F in (*.avif) do (
    echo Processing: %%F

    "%EXIFTOOL%" -overwrite_original ^
     -XMP-tiff:Make^<EXIF:Make ^
     -XMP-tiff:Model^<EXIF:Model ^
     -XMP-xmp:CreatorTool^<EXIF:Software ^
     -XMP-exif:DateTimeOriginal^<EXIF:DateTimeOriginal ^
     -XMP-xmp:CreateDate^<EXIF:CreateDate ^
     -XMP-xmp:ModifyDate^<EXIF:ModifyDate ^
     -XMP-exif:ExposureTime^<EXIF:ExposureTime ^
     -XMP-exif:FNumber^<EXIF:FNumber ^
     -XMP-exif:ISO^<EXIF:ISO ^
     -XMP-exif:ExposureProgram^<EXIF:ExposureProgram ^
     -XMP-exif:ExposureMode^<EXIF:ExposureMode ^
     -XMP-exif:MeteringMode^<EXIF:MeteringMode ^
     -XMP-exif:WhiteBalance^<EXIF:WhiteBalance ^
     -XMP-exif:FocalLength^<EXIF:FocalLength ^
     -XMP-exif:DigitalZoomRatio^<EXIF:DigitalZoomRatio ^
     -XMP-exif:MaxApertureValue^<EXIF:MaxApertureValue ^
     -XMP-exif:GPSLatitude^<EXIF:GPSLatitude ^
     -XMP-exif:GPSLongitude^<EXIF:GPSLongitude ^
     -XMP-exif:GPSAltitude^<EXIF:GPSAltitude ^
     -XMP-exif:GPSAltitudeRef^<EXIF:GPSAltitudeRef ^
     -XMP-dc:creator^<EXIF:Artist ^
     -XMP-dc:description^<EXIF:ImageDescription ^
     -XMP-dc:rights^<EXIF:Copyright ^
     "%%F"
)

echo Done!
pause

📜 Result

Image

Notes

  • Only valid and standard XMP tags are written by the script
  • Original EXIF metadata remains untouched
  • Unsupported or non-standard tags are skipped gracefully

AI credits

This solution and workflow were developed and refined with significant assistance from AI (ChatGPT), particularly for:

  • EXIF to XMP tag mapping
  • ExifTool behavior and limitations
  • Windows batch scripting edge cases

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions