| Ticket UUID: | d66e6fabad560de0fa27549e75d21b4dd1462f3a | |||
| Title: | Complex alpha photo images: red and blue are swapped on Windows | |||
| Type: | Bug | Version: | trunk | |
| Submitter: | fvogel | Created on: | 2019-06-05 16:07:50 | |
| Subsystem: | 41. Photo Images | Assigned To: | nobody | |
| Priority: | 5 Medium | Severity: | Critical | |
| Status: | Open | Last Modified: | 2023-12-17 22:54:55 | |
| Resolution: | None | Closed By: | nobody | |
| Closed on: | ||||
| Description: |
SVG images: red and blue are swapped on Windows
package require Tk
set data {<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<path fill="none" stroke="#000000" d="M0 0 h16 v16 h-16 z"/>
<path fill="none" stroke="#000000" d="M8 4 v 8 M4 8 h 8"/>
<circle fill="yellow" stroke="red" cx="10" cy="80" r="10" />
<ellipse fill="none" stroke="blue" stroke-width="3" cx="60" cy="60" rx="10" ry="20" />
<line x1="10" y1="90" x2="50" y2="99"/>
<rect fill="none" stroke="green" x="20" y="20" width="60" height="50" rx="3" ry="3"/>
<polyline fill="red" stroke="purple" points="80,10 90,20 85,40"/>
<polygon fill ="yellow" points="80,80 70,85 90,90"/>
</svg>}
set im [image create photo -data $data]
pack [button .b -image $im]
The correct rendering is: - upper right triangle must be red - oval must be blue - circle must be yellow with a red outline - lower right triangle must be yellow What is observed instead is a swapping of the colors between red and blue. The other colors are fine though. So red and blue colors are swapped in any SVG image. A start of an analysis: - BROKEN from day 1 in trunk with [40ae80f86f] (merge of tip-507 branch into trunk) - WORKS with [eee5e9fb34] (last commit in tip-507 implementation branch) - WORKS with trunk + backouted [efab40f95b] (scotty's fix for [21525158b0]) So it's clear what the problem is: Scott fixed [21525158b0] correctly, but then we merged a new image reader into trunk without propagating the required changes in the color masks in the tip-507 branch. I have checked that this problem happens on Windows but that on Linux rendering is as expected. | |||
| User Comments: |
chrstphrchvz added on 2023-12-17 22:54:55:
I am taking the liberty of adjusting the title of this ticket. I observe that this example renders correctly with trunk, but with [afc25089] the label widget background within the photo is blue rather than red. I may post an explanation for this later. image create photo em -file library/demos/images/earthmenu.png label .l -image em -background red pack .l
fvogel added on 2023-12-17 20:33:12: Interestingly, the correct rendering is obtained in current trunk too. fvogel added on 2023-12-17 20:23:19: Since I'm prompted, here is what I can say:
Oh, and thanks, Jan, for your guesses. You made a very helpful statement toward keeping me motivated. jan.nijtmans added on 2023-11-29 16:14:30: The "bug-d66e6fabad" branch is now rebase to Tk 9.0 (otherwise I guess François will refuse to work on it, which is no big deal). François, can you have a look at it? jan.nijtmans added on 2023-11-29 16:01:33: Many thanks, @chrstphrchvz! The "bug-d66e6fabad" branch is updated now, following your suggestions. chrstphrchvz added on 2023-11-29 06:23:38: The signature of TkDecomposeMaskToShiftAndBits() in tkInt.h is outdated. As of [3cc7647dadcb] DecomposeMaskToShiftAndBits() now expects unsigned int instead of unsigned long for mask. chrstphrchvz added on 2023-11-28 19:26:58: Since original branch was created prior to the backout done in [86970d98969f], I think the rebased branch now needs [efab40f95b93] to be reapplied. jan.nijtmans added on 2023-11-28 18:26:25: The "bug-d66e6fabad" branch is now updated to align with the core-8-branch. Testing time chrstphrchvz added on 2023-11-27 18:05:11: I suggest retitling this ticket, since the issue affects any images with complex alpha, and has nothing to do with SVG specifically. fvogel added on 2019-07-13 13:04:30: From a start of an analysis by Scott Pitcher and private email exchanges with him, it looks like the problem is images with transparency that are not correctly handled. Since it all worked before [efab40f95b] (scotty's fix for [21525158b0]) I have reverted his fix in trunk, so that this problem with transparent images goes out of our way in the main branch. In parallel I have opened branch bug-d66e6fabad to properly deal with the present issue, which is now present only in that bugfix branch. | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki