Skip to content

decode: read OLE2FRAME corner points from the 0x80-byte header - #1534

Closed
mlightcad wants to merge 1 commit into
LibreDWG:masterfrom
mlightcad:fix/ole2-corners
Closed

mlightcad wants to merge 1 commit into
LibreDWG:masterfrom
mlightcad:fix/ole2-corners

Conversation

@mlightcad

Copy link
Copy Markdown
Contributor

Summary

Fixes #1528.

dwg_decode_ole2 hardcoded pt1/pt2 to TS1.dwg sample coordinates.

Change

Parse the four WCS corners from the 0x80-byte OLE2FRAME header (skip 2-byte prefix; DXF 10/11 = first and third corners). Zero them if data_size < 98.

Test plan

  • dwgread -v3 on a drawing with OLE2FRAME and compare DXF 10/11 against AutoCAD/ODA
  • Confirm TS1-style sample still yields the previously hardcoded corners

pt1/pt2 were hardcoded to TS1.dwg sample coordinates. The OLE2FRAME
payload starts with a 0x80-byte header: after a 2-byte prefix, four WCS
corners as little-endian 3D doubles. DXF groups 10/11 are the first and
third corners.

* src/decode.c (dwg_decode_ole2): Parse pt1/pt2 from data when
  data_size >= 98; otherwise zero them.
@rurban

rurban commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

We should store the 3rd point also, even if ignorable. But this needs a CLA

@rurban rurban self-assigned this Nov 15, 2026
@rurban rurban added the cla_needed Waiting for the Copyright assignment label Nov 15, 2026
@rurban

rurban commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

I'll rewrite it by my own. the 128-byte header are some numbers and the 4 corners.
The MS-CFB ole2 stream can be easily decoded.
For DXF the header must be included in the 310/90 data, for the rest I'll split it.

@rurban rurban closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla_needed Waiting for the Copyright assignment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

decode: OLE2FRAME pt1/pt2 are hardcoded TS1.dwg sample coordinates

2 participants