Skip to content

feat(go): add embedded images (PNG/JPEG/GIF/BMP) - #2

Merged
Mukbeast4 merged 1 commit into
mainfrom
feature/embedded-images
Apr 24, 2026
Merged

feat(go): add embedded images (PNG/JPEG/GIF/BMP)#2
Mukbeast4 merged 1 commit into
mainfrom
feature/embedded-images

Conversation

@Mukbeast4

Copy link
Copy Markdown
Owner

Summary

  • Adds AddImage, AddImageFromBytes, GetImages, RemoveImages for embedding images anchored to cells
  • Supports PNG, JPEG, GIF, BMP with magic-byte format detection
  • Identical binaries are deduplicated via SHA1 in Pictures/<sha1>.<ext>
  • Dynamic manifest generation for Pictures/* entries
  • Full round-trip (save → open → read back) preserves cell ref, dimensions, offsets, binary data

Why

The library lacked image support, a common feature in spreadsheet libraries. Images are written as <draw:frame><draw:image xlink:href="Pictures/..."/></draw:frame> per the OpenDocument spec.

Test plan

  • go test ./... (all 200+ tests pass)
  • go vet ./...
  • gofmt -s -l . (empty)
  • 7 new tests: round-trip, file/bytes input, format detection, shared binary dedup, removal with ref counting, invalid format rejection
  • Manual: open generated .ods in LibreOffice Calc to verify image renders at correct cell/size

@Mukbeast4
Mukbeast4 merged commit 41ba15a into main Apr 24, 2026
2 checks passed
@Mukbeast4
Mukbeast4 deleted the feature/embedded-images branch April 24, 2026 10:04
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.

1 participant