Open michal-josef-spacek opened 6 days ago
I prepared fix for 1), but I don't see where is issue for 2)
Still issue 2)
Testing file: Circle_Original.dwg.gz Testing environment: Windows (tested on mingw version)
Structure (via dwgread):
xdata[98]: "RTVSPost2010Prop51ColorRGB" [TV 102]
xdata[99] type: 90 [RS]
xdata[99]: -16777216 [RL 90]
xdata[100] type: 102 [RS]
is in DXF:
102
RTVSPost2010Prop51ColorRGB
90
-16777216
and JSON:
[
102,
"RTVSPost2010Prop51ColorRGB"
],
[
90,
4278190080
],
This means, that conversion from DWG to JSON is wrong.
btw: Conversion to DXF via LibreDWG dwg2dxf.exe is fine.
102
RTVSPost2010Prop51ColorRGB
90
-16777216
Conversion from DWG to JSON is bad in Windows and Linux too (-16777216 → 4278190080).
When I change:
diff --git a/src/out_json.c b/src/out_json.c
index f2e63e24c..4a066d6b7 100644
--- a/src/out_json.c
+++ b/src/out_json.c
@@ -170,6 +170,7 @@ static char *_path_field (const char *path);
#define VALUE_RC(value, dxf) VALUE (value, RC, dxf)
#define VALUE_RS(value, dxf) VALUE (value, RS, dxf)
#define VALUE_RL(value, dxf) VALUE (value, RL, dxf)
+#define VALUE_RLd(value, dxf) VALUE (value, RLd, dxf)
#define VALUE_RLx(value, dxf) VALUE ((BITCODE_RL)value, RL, dxf)
#define VALUE_RLL(value, dxf) VALUE (value, RLL, dxf)
#ifdef IS_RELEASE
@@ -1184,7 +1185,7 @@ json_xdata (Bit_Chain *restrict dat, const Dwg_Object_XRECORD *restrict obj)
rbuf->type);
break;
case DWG_VT_INT32:
- VALUE_RL (rbuf->value.i32, 0);
+ VALUE_RLd (rbuf->value.i32, 0);
LOG_TRACE ("xdata[%u]: %d [RL %d]\n", i, (int)rbuf->value.i32,
rbuf->type);
break;
Conversion on Linux is -16777216 →-16777216, but on Windows still -16777216 → 4278190080.
I found two issues with conversion:
1)
2)
which is XRECORD xdata item
dwgread of them:
and