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

dmi_strip_metadata leads to removing alpha channel from the icon #135

Closed
DTraitor opened this issue May 27, 2023 · 1 comment · Fixed by #136
Closed

dmi_strip_metadata leads to removing alpha channel from the icon #135

DTraitor opened this issue May 27, 2023 · 1 comment · Fixed by #136

Comments

@DTraitor
Copy link
Contributor

dmi_strip_metadata leads to removing alpha channel from the icon
Here is the code I used:

/world
	fps = 25
	icon_size = 32
	view = 6

/mob/Login()
 	var/icon/test = icon('twitcher.dmi', "preview")
	fcopy(test, "temp.png")
	client << browse_rsc(icon("temp.png"), "first.png")
	call("rust_g", "dmi_strip_metadata")("temp.png")
	сlient << browse_rsc(icon("temp.png"), "second.png")

twitcher.dmi: https://cdn.discordapp.com/attachments/693217263934898190/1111983453760651324/twitcher.dmi

Code result:
first.png:
first
second.png:
second

@AnturK
Copy link
Member

AnturK commented May 27, 2023

Yeah, not copying tRNS chunk from the original.

    if let Some(trns_chunk) = reader_info.trns.to_owned(){
        encoder.set_trns(trns_chunk);
    }

Simple fix, under palette copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants