Closed stuart-mclaren closed 3 months ago
It's a great idea
Would something like this make sense?
No change in default behaviour:
dms -deviceIcon foo.png
No change, but explicitly advertise 48 and 128
dms -deviceIcon foo.png -deviceIconSizes 48,128
Additionally advertise 256 (should work with well behaved clients)
dms -deviceIcon foo.png -deviceIconSizes 48,128,256
Advertise as 48, 128 but force 48 icon to be resized to 512, force 128 to be resized to 128 [sic] (for less well behaved clients)
dms -deviceIcon foo.png -deviceIconSizes 48,128 -deviceIconForceSizes 512,128
An alternative might be something like:
-deviceIconSizes 48:512,128:128
The first option might be more consistent with eg allowing setting other things (eg mime type) in the future (-deviceIconMimeTypes ...)
If either of these seem ok, let me know. (I know some Go and could take a shot at implementing it.)
https://github.com/anacrolix/dms/pull/147
Went with option 2 in the end.
Thanks for the contribution!
You're welcome.
Would you be interested in a follow on one liner to replace https://i.imgur.com/qbHilI7.png in the readme with something like this?
Could you add to it rather than replacing that old image? I would be interested indeed.
I'm using dms with 8player and it is working really well.
One really minor issue: when using the -deviceIcon option, larger icons can lose resolution.
Eg a 512x512 FreeBSD logo looks like this (note some compression artifacts):
A one line change to main.go Changing this:
to this
removes the artifacts:
I tried adding a 512 icon size in addition to the 48 and 128 sizes, but it looks like 8player always takes the first icon in the list.
It would be nice to have an option to get the 512 icon without artifacts without changing the code.
Obviously the one line change above is a hack, and 8player should probably be selecting 512 from the list when it is available.
But maybe it would be possible to add a command line option to make the use of icons more flexible - to work around quirky clients?