Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VNS JPEG Metadata

A pure Xojo library for reading and writing JPEG EXIF metadata. No Shell calls, no Declares, no plugins. Works on macOS, Windows, and Linux.

Features

  • Read and write EXIF metadata (159 tag types supported)
  • GPS coordinates read/write with DMS and decimal degree support
  • Non-destructive editing: image data is preserved byte-for-byte
  • Both big-endian (Motorola) and little-endian (Intel) TIFF byte orders
  • Simple API: ReadFromFile, GetTag, SetTag, WriteToFile
  • MemoryBlock I/O for database and network use cases
  • Demo app with image preview, metadata browser, inline editing, and GPS entry dialog

Quick Start

// Read EXIF
Var meta As New VNSJPEGMetadata
If meta.ReadFromFile(myJPEGFile) Then
  Var model As String = meta.GetTag("Model").StringValue
  Var dateTime As String = meta.GetTag("DateTimeOriginal").StringValue
End If

// Write EXIF
meta.SetTag("Artist", "Jane Smith")
meta.SetTag("Copyright", "2026 Jane Smith")
meta.WriteToFile(outputFile)

GPS Coordinates

// Write GPS: Paris (48° 51' 24" N, 2° 21' 7" E)
Var gps As Dictionary = ...  // get or create GPS IFD

Var lat() As Variant
lat.Add(48 : 1)
lat.Add(51 : 1)
lat.Add(24000000 : 1000000)
gps.Value(CType(VNSEXIFTags.kTagGPSLatitude, Integer)) = lat
gps.Value(CType(VNSEXIFTags.kTagGPSLatitudeRef, Integer)) = "N"

See DEVELOPER.md for complete examples including reading GPS, decimal degree conversion, RATIONAL values, and more.

Requirements

  • Xojo 2025r1 or later
  • No external dependencies

Project Structure

File Description
VNSJPEGMetadata Main public API class
VNSJPEGSegmentParser JPEG binary segment parser/assembler
VNSEXIFParser TIFF/IFD structure parser and serializer
VNSEXIFTags 159 EXIF tag ID constants and name lookups
VNSJPEGSegment Data container for a single JPEG segment
VNSMetadataListBox DesktopListBox subclass with section row styling
VNSJPEGException Custom exception class
WindowMain Demo app: image viewer + metadata editor
WindowGPSEntry GPS coordinate entry dialog

Supported Tag Categories

IFD Section Examples
Image (IFD0) Make, Model, Orientation, Artist, Copyright, DateTime, Software
Camera & Exposure (ExifIFD) ExposureTime, FNumber, ISO, FocalLength, Flash, DateTimeOriginal
GPS Location Latitude, Longitude, Altitude, TimeStamp, DateStamp, MapDatum
Interoperability InteroperabilityIndex, InteroperabilityVersion
Thumbnail (IFD1) Thumbnail image properties

Demo App

The included demo application shows how to use the library:

  • Open any JPEG file and see its image preview
  • Browse all EXIF metadata organized by section
  • Edit tag values inline in the list
  • Set GPS coordinates via a dedicated dialog (DMS or decimal input)
  • Save modified metadata to a new JPEG file

Documentation

Ported From

This library was ported from piexif (Python, MIT License). The JPEG segment parser was written from scratch for Xojo. See DEVELOPER.md for details.

License

MIT License - Copyright (c) 2026 VeryNiceSW

Releases

Packages

Contributors

Languages