Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with SetSystemTrayIcon when using jpg format #4783

Open
2 tasks done
aynakeya opened this issue Apr 12, 2024 · 0 comments
Open
2 tasks done

Issue with SetSystemTrayIcon when using jpg format #4783

aynakeya opened this issue Apr 12, 2024 · 0 comments
Labels
unverified A bug that has been reported but not verified

Comments

@aynakeya
Copy link

aynakeya commented Apr 12, 2024

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

when setting a system tray icon using a JPG image, the color rendering is incorrect.

The same operation works as expected with PNG images.

Expected:
image

Png file

image

Jpg file.

image

How to reproduce

run example code

Screenshots

No response

Example code

package main

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/driver/desktop"
	"fyne.io/fyne/v2/widget"
)

func main() {
	a := app.New()
	w := a.NewWindow("SysTray")

	//icon, _ := fyne.LoadResourceFromPath("./assets/icon.jpg")
	icon, _ := fyne.LoadResourceFromPath("./assets/icon.png")

	if desk, ok := a.(desktop.App); ok {
		m := fyne.NewMenu("MyApp",
			fyne.NewMenuItem("Show", func() {
				w.Show()
			}))
		desk.SetSystemTrayMenu(m)
		desk.SetSystemTrayIcon(icon)
	}

	w.SetContent(widget.NewLabel("Fyne System Tray"))
	w.SetCloseIntercept(func() {
		w.Hide()
	})
	w.ShowAndRun()
}

Fyne version

2.4.4

Go compiler version

1.20

Operating system and version

Kubuntu 22.04

Additional Information

seems like green and red were swapped for jpg image

if i swap green and red in argbForImage.

image

the result looks like this.

image

@aynakeya aynakeya added the unverified A bug that has been reported but not verified label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unverified A bug that has been reported but not verified
Projects
None yet
Development

No branches or pull requests

1 participant