Showing newest posts for query fleace. Show older posts
Showing newest posts for query fleace. Show older posts

Monday, January 4, 2010

Wallpapering Windows 7

In the distant past I created my own Wallpaper changing programs for Windows. WimpWall would switch to a random image within a given folder on your computer, and Fleace would fetch an image on a given topic from Flickr. After my recent permanent move from Windows XP to Windows 7 I set about seeing if Win7's built-in functionality would render my software redundant. I am happy to report that the answer is a qualified yes, with the results being good enough for me to skip installing my software.

Getting Windows 7 to randomly switch between images in a given folder is quite straightforward. Perhaps the easiest method is to select (control-click) multiple images in Windows Explorer, then right-click the selection and choose "Set as desktop background". If the don't like the chosen picture then right-click the desktop and choose "Next desktop background". You can customise the settings to choose how the image should be fitted to the desktop, and how often it should be changed. Right-click the desktop, choose Personalize, then Desktop Background.

An alternative method of choosing images from a folder is from the Desktop Background settings window. However, note that neither of these options let you choose images from multiple folders. This can only be done if you select the Picture Location to be your Pictures Library. Although it's easy to add folders to the library it would be preferable if Win7 would automatically recurse selected folders, especially as the interface for this has already been designed for the Library. Anyway, that's WimpWall taken care of. Fleace is a little harder.

You can get an overview of Win7's theme capabilities from the Engineering Windows 7 blog. This will lead you onwards to a technical description of Creating and Installing Theme Files from MSDN. This is explained better, with screenshots, by makeuseof.com, where they walk through setting up a theme file to automatically download Bing wallpapers. They also give the address of a few sample Flickr feeds, but to get Flickr working well you should also read Phil Hawley's blog to understand some of the drawbacks. Finally, there's a sample feed from Agence France-Presse at Netweb.

Phew! Have you read all that?

The crucial point is that although Win7 can grab desktop backgrounds from RSS feeds they have not exposed this through the graphical interface. Instead, you have to delve into theme text files to manually add the feed address, or use a theme file created by someone else where this has been done. Although the technical links above indicate that the RSS feeds must use enclosures for the pictures to work as desktop backgrounds, the Flickr feeds I tested without enclosures also worked. However, Nasa's Astronomy Picture of the Day feed does not work.

Speaking of Flickr, how well can you emulate Fleace using just Win7? The answer relates to how close Flickr feeds come to matching their API. Fleace retrieves pictures from Flickr using their photo search API. It asks for particular tags, and for the photos to be returned with the most interesting ones first. You can request a feed for a particular tag or group, but you can't specify the order for the pictures to be returned, so you get them in chronological order. You also can't say what size images you'd like, so you may be given a very low resolution image that is unsuitable for a large desktop background. This problem will not occur if you select your group wisely, such as a wallpaper specific group.

Here's a Flickr feed where I'm trying to grab photos tagged "puppy", "beach" or "lake district": http://api.flickr.com/services/feeds/photos_public.gne?format=rss_200&tags=puppy,beach,lake%20district&tagmode=any

Overall, I found the dynamic wallpaper options in Windows 7 to be sufficient for my needs. With a few minor interface tweaks to Windows 7, and some enhancements by RSS feed providers such as Flickr, perfection will be attained.

P.S. In Firefox you can look at the content of a feed by preprending the URL with view-source, such as view-source:http://api.flickr.com/services/feeds/photos_public.gne?format=rss_200&tags=lake%20district&tagmode=any



Tuesday, June 9, 2009

Fleace bugfix released

Recently Fleace users have been stymied in their attempts to fetch new wallpapers by an error message:

"Could not connect to Flickr: HTTP/1.1 302 Found".

Web developers will immediately recognise that as a redirection response. The library used by Fleace is hard-coded to fetch photo data from http://flickr.com/ , and at some point in the last month Flickr set that address to redirect to http://www.flickr.com/. For most programs this would not be a problem. Browsers do redirections all the time without user intervention. However, Fleace's library had automatic redirections turned off. This has been fixed in Fleace v0.3, which is now available for download. Also, at some point since the Flickr API was first released their base URLs changed to http://api.flickr.com/, so I also switched to that.

Although this was a simple fix it took a while to complete because I did not have a Delphi development environment installed. Fleace was built in Delphi 2005, but for this fix I used the free Turbo Delphi (aka Delphi 2006) in a VirtualBox. I didn't want to put it on my main OS because it has a large collection of software prerequisites, such as the ancient .Net Framework 1.1 (current version is 3.5), that are otherwise unwanted. That worked well, and may lead to further Fleace upgrades in the future.



Monday, October 9, 2006

Fleace v0.2 released

I've updated Fleace with a couple of small improvements.

When I tested the original release on my brother's computer I found that it always popped up an error saying that it couldn't connect to Flickr. That happened because Fleace was running before his network had a chance to get going. I've added an extra 30 seconds of silent retries before the program will question whether you want to try again manually.

In addition, I had a request for some way of only downloading high-resolution wallpapers. Although I couldn't add that to this version, I did add an optional note beneath the thumbnail image in the preview window stating the dimensions of the full size image. This can be turned on in the options dialog.

Thursday, September 14, 2006

Delphi 2005 vs. Visual C# Express 2005

A few weeks ago I decided to try out the Flickr API by developing a wallpaper application that would automatically retrieve images from Flickr. As well as experiencing the Flickr API, I would also experiment by developing the same basic software simultanously in two languages and IDEs, namely Microsoft Visual C# Express 2005 and Delphi 2005 Personal.



I usually don't reinvent the wheel, and in this case components have been developed which ease the programming interaction with Flickr. These are FlickrNet for .Net (ie. C#) and dFlickr for Delphi. It was at this point that my Delphi project stalled, as I had great difficulty installing dFlickr. As I tinkered aimlessly trying to get Delphi to talk to Flickr, I steamed ahead on the C# project. The combination of straightforward installation of FlickrNet, sufficient documentation, and very helpful code completion enabled me to communicate with Flickr in negligible time, and get the guts of the program done without trouble.



There are other Flickr wallpaper applications written in C#, but I wanted to provide a better user experience. Flickrwallpaper is a nice command-line example, which is useful to programmers because it includes all the source code, but would put off most casual users by its difficulty of use due to its lack of graphical user interface.



After about a week, my C# wallpaper application was just about done, and I moved back to trying to get dFlickr to work. Doing this, and learning how to use it, took an additional two days. Then I did a quick straight conversion of the C# code to Delphi, which took three more days.



I did a previous comparison of Delphi 6 versus Visual C# Express 2005 (Beta 1), and much of that is still valid with these products. Whilst Delphi hasn't progressed much, the problems with the C# Express beta have been eliminated.



Visual C# Express is good because:


  • The visual designer provides great positioning aids. You can use the mouse to align items with ease, whereas with Delphi I have to resort to doing pixel positioning calculations in my head.

  • It is very productive. I was never stuck wondering how to do something. This is due to a combination of great help, great code completion, and plenty of online tutorials and forums about C# and .Net.



Visual C# Express is bad because:


  • It has no inputbox function. I had to write an entire form and associated code to do what I expected to be provided in a single line of code.

  • The programmer and end user need to have the .Net framework installed.

  • Any extra components need to have their .dll files distributed too, so you can't just provide a single file download without zipping everything up.

  • Help (not Intellisense, though) is very slow to load, slower than loading the whole rest of the IDE.



Delphi 2005 is good because:


  • The end result is an all-in-one executable, making life easy for your users.



Delphi 2005 is bad because:


  • Errors, such as accessing an object before it's created, often cause an 'Access violation' message, but do not provide much help debugging.

  • Code completion doesn't work if there are many errors in the document.

  • Code completion isn't very descriptive, and you can't click elements within it, such as on type names to get more information

  • Help is hard to navigate

  • Not much is built in (eg. no XML processing, no internet access), so you must rely on components written by third parties

  • The IDE is much clunkier (and even worse than Delphi 6)
  • Because this is Pascal, you have to declare everything (functions and variables) in advance.

  • It can be hard to install components.

  • Again a Pascal note, begin and end are more verbose than curly brackets.



In the neither bad nor good category, it was interesting that with Visual C# the IDE is fast to start, but slow to load the actual project. In comparison, the Delphi is IDE slow to start, but the project fast to load. I prefer the former, which seems faster though probably isn't much different.



Delphi 2005 can actually produce two types of code. The first is based on Win32, which is what all former Delphi versions could create. Second is the new-fangled .Net Framework, or what Visual C# Express is using. I have been testing the former only, as the other seems to offer the worst of both worlds, the poor IDE of Delphi combined with the poor distributability of .Net.



In summary, the programming experience in Visual C# Express is vastly superior to that of Delphi. However, for most end users, the code that Delphi produces is much better. Firstly, it does not require a large software package, the .Net Framework, to be installed. Secondly, all the components are combined into one executable file, rather than being separate dll files. Certainly these problems can be mitigated by the use of nifty installers, but they're not ever going to be as clean.



The end result of all this work is the Delphi production of Fleace. I'll probably still use the C# code to try out experiments, but my users deserve the easy-to-install Delphi version.



PS. Just a note that if you have both these IDEs installed, you may have problems with the Delphi help refusing to appear. The fixes for this are on the Borland and gnegg sites.



Saturday, September 9, 2006

Fleace released

I've just set my latest software production free into the world. It's called Fleace, which stands for the Flickr-Enabled Automatic Changer for Everyone.

It's a small, easy-to-use wallpaper changer for Windows which retrieves pictures in areas of interest that you select from Flickr. As you browse through Flickr you may notice that many photographs have descriptive tags attached. For example, a picture of a cute puppy may be tagged 'cute' and 'puppy'. Just enter these tags into Fleace and it will select the most interesting pictures that match your selection.

I've based the design of Fleace on my successful offline wallpaper changer, WimpWall, which is still a popular download from this site. The two crucial elements that I maintained were
  • no installation, not even a file to unzip. This means no ini files, and no effect on your registry. And,
  • it does not stay resident. Once it has changed the wallpaper, it exits completely.


Although there are a number of Flickr wallpaper changers around already, many are based on the .Net framework, and thus require an onerously large download onto the user's computer. In contrast, Fleace runs happily on any version of Windows from Windows 95 to Windows XP.

I've also worked hard on making it easy to use, and part of this is removing unneccessary options from the program. I hope you try it and enjoy it.