Skip to content

Fix DXF import layer transparency - #67999

Merged
nyalldawson merged 1 commit into
qgis:masterfrom
marcin1j:feature/dxf-import-layer-transparency-fix
Oct 29, 2026
Merged

nyalldawson merged 1 commit into
qgis:masterfrom
marcin1j:feature/dxf-import-layer-transparency-fix

Conversation

@marcin1j

Copy link
Copy Markdown
Contributor

Description

This fixes random layer-level transparency and, as a result, random alpha channel value when importing DXF without 440 layer attribute.

In-tree libdxfrw supports layer-level transparency but fails to initialize the corresponding field with default value. When no
transparency code is encountered in DXF file, the importer uses unspecified value through the whole process, translating into
effectively random layer and entity alpha channel value.

This problem can be observed on gcc Linux build importing DXF created by LibreCad:

Color Transparency
Upstream 204,204,0,159 1006749280
Fixed upstream 204,204,0,255 0

Note that 1006749280 is clearly invalid value for transparency attribute, which should be within 0-255 range.

  • I certify that no AI tool(s) (Copilot, Claude, or something similar), LLMs, or agent based workflows were used or supported my development of this PR. See our policy about AI tool use.

No LLM, AI or agent assisted code contributions are allowed in the QGIS repository. If we subsequently discover that you have used an AI, LLM, or any agent-based workflow for your contribution, you will be subject to code reversion and contributor rights sanctioning. See QEP 408 for details.

This fixes random layer-level transparency and, as a result, random
alpha channel value when importing DXF without 440 layer attribute.

In-tree libdxfrw supports layer-level transparency but fails to
initialize the corresponding field with default value. When no
transparency code is encountered in DXF file, the importer uses
unspecified value through the whole process, translating into
effectively random layer and entity alpha channel value.
@github-actions github-actions Bot added this to the 4.4.0 milestone Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This app is not notarized, run sudo xattr -d com.apple.quarantine /Applications/QGIS*.app to avoid the warning
(Built from commit 4ecc26b)

@nyalldawson
nyalldawson merged commit 1a9d102 into qgis:master Oct 29, 2026
35 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants