Skip to content

Conversation

@pegasscience-cyber
Copy link
Contributor

Summary

This patch fixes a regression where AddPictureFromBytes() fails to insert .svg images with the error:
image: unknown format

The issue occurs because the standard Go image library does not support SVG, and the previous implementation always called image.DecodeConfig for every image type.

This change adds SVG-specific handling to bypass raster decoding and derive dimensions directly from the SVG metadata.

@xuri xuri added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 31, 2025
…rated TestSetSheetBackgroundFromBytes.xlsx can not open in Office 2007
@xuri xuri added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 2, 2025
Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

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

Thanks for your PR. I reverted changes for SVG image parser, and update TIF file for fix generated TestSetSheetBackgroundFromBytes.xlsx can not open in Office 2007 based on your branch.

@codecov
Copy link

codecov bot commented Nov 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.34%. Comparing base (78a8a43) to head (b1a930e).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2232   +/-   ##
=======================================
  Coverage   99.34%   99.34%           
=======================================
  Files          32       32           
  Lines       25599    25599           
=======================================
  Hits        25432    25432           
  Misses         89       89           
  Partials       78       78           
Flag Coverage Δ
unittests 99.34% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xuri xuri merged commit 8325cf6 into qax-os:master Nov 2, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants