GNOME Bugzilla – Bug 510554
support multi-resolution background images
Last modified: 2008-08-13 03:48:46 UTC
It would be nice if GnomeBg would support multi-resolution images. Currently, we have to install separate wide, dual-head, etc versions of the default Fedora background, and they all show up as separate entries in the background capplet, leaving the user to pick the best one. Here is a patch that extends Soerens slideshow support to parse files like the following: <background> <static> <duration>10000</duration> <sizes> <file width="800" height="600">/home/mclasen/image1.png</file> <file width="1600" height="1200">/home/mclasen/image2.png</file> <file width="1920" height="1200">/home/mclasen/image3.png</file> </sizes> </static> </background> The file shows up as a single item in the appearance capplet, and the best size is picked, depending on the screen resolution (the algorithm to pick the best size can probably be improved...)
Created attachment 103185 [details] [review] multires.patch
Søren: can you review this (and commit if you're fine with this)?
One thing to point out here is that it currently won't work to combine multiple resolutions with animation. Maybe we should make that work... In general, the slideshow parser probably needs some robustness testing.
Created attachment 103205 [details] Available sizes "Great to have that functionality in Nautilus! now i'm wondering if something like this could be implemented for GDM as well..?? the GDM background for Fedora 8 is a .png image with a size of: 2560 x 1600 and having that auto adjusting to the user display size would be wonderful! or perhaps SVG support in GDM (couldn't both options in gdm's bugzilla)?" Oke right after i wrote the above i thought of the following case: What if a user downloaded a wallpaper pack which uses the smart size stuff that Matthias made? than the user would get the wallpaper that's suitable for his size. But what if the user wants (for whatever reason) a different size? i don't see any option of doing that at the moment. So i made a nice mockup of the Appearance Preferences -> Background section and edited in the "Available sizes" option and some example sizes with a radio button that indicates which one is gonna be used. The place in that section is available to put it in. Posted the same on the bugzilla page.
The whole point of this feature is to let the computer automatically pick the right size, making the need for manual selection go away. Therefore, I am against adding back complicated selection UI like you propose. The individual sizes are regular images, so if you really care that much, you can just add them to your selection of available backgrounds using the "Add" button.
Oke that's a possibility. But is it wrong that the best resolution is checked automatically and than just give the user the option to go with that or choose one of the other resolutions? That would make this patch simply perfect to me ^_^
I do think this should be supported for animated wallpapers as well. Unfortunately, there is no obvious way to add multi-resolutions to <transition> elements. It's possible that the file format is just not very suitable for extension. Maybe we should fix that while we still have the chance. Fedora, and possibly Mandriva are the only distributions that have shipped it, as far as I know. We could probably deal in Fedora; I doubt there are any third-party backgrounds.
yeah, lets do a quick review of the file format before it gets frozen in an unfortunate state.
We could do something like: <background> <static> <duration>12345</duration> <file>/only/one/size.png</file> </static> <static> <duration>12345</duration> <file> <size width="400" height="200">/very/small.png</size> <size width="400" height="400">/square/one.png</size> </file> </static> <transition type="overlay"> <duration>12345</duration> <file type="start"> <size width="400" height="200">/very.small.png</size> <size width="400" height="400">/square/one.png</size> </file> <file type="end">/only/one/size/again.png</file> </transition> </background> Alternatively, we can stay with <from> and <to>, or we can unify the elements even more, and merge <static> and <transition> into <element type="static"> and <element type="overlay">. One more change that would be beneficial, imo, is to allow the transition elements to refer implicitly to the files of the previous and next elements: <static> <duration>1000</duration> <file>image1.png</file> </static> <transition type="overlay"> <duration>1000</duration> </transition> <static> <duration>1000</duration> <file>image2.png</file> </static> reads much easier than the version that repeats all the file names several times. Adding multiple sizes will only make the repetion worse.
Created attachment 105888 [details] [review] multires2.patch
Here is an iteration that supports multires for animations and static images. The file format is backwards compatible by allowing, at any place where the current format expects a filename, to specify one or more <size width="w" height="h">filename</size> elements. It is still possible to just specify a filename, if you don't have multiple sizes.
Created attachment 105889 [details] [review] same patch again, this time against the latest sources
This has been committed at some point.