convert webshots files to jpegs in linux

I like to change my desktop background every once in a while, for variety. A friend of mine has tons of desktop images, and he told me he got almost all of them from a site called I went there and found hundreds of great-looking desktop wallpapers (or backgrounds) to choose from. The only problem is they use a proprietary file format that cannot be read by a normal graphics tool. They have software to convert or display the images for Windows, but nothing is available for Linux users to access the JPEGs. On Google I found code for a converter, but after compiling and trying it out, it didn’t work entirely.

So I fixed it.

There are two main formats of their file format; one with the JPEG just sitting there with lots of other junk around it, and two, an encrypted version. I don’t know how the original author of the code knew about the encryption or how to decrypt it, but that part was already working so I left it alone. The only part I changed was the plain format that contains a JPEG file. I also reformatted the entire code for readability.

I haven’t done extensive testing, but it has converted all the files I’ve downloaded so far. I don’t believe there are any legal issues to be concerned about by making the code available because the files can be downloaded from the site for free and since there isn’t any software on Linux to view them, it just lets Linux users do the same thing that Windows users can do.

According to the Webshots FAQ, they are planning to write a Linux version, but until that happens, this utility permits Linux users to use their images for desktops, and some of their desktop images are spectacular.

Here’s the updated source code and here’s the original code. Let me know if you have any questions or problems.


 (Post a comment) | Comments RSS feed
  1. Thanks for updating wbz2jpg! I’ve used the original version before, and I had trouble converting some files. Your updated version works much better, but I found that it still fails with a few files. First, if the file ends in 0xFF, the original program will keep writing until the file system fills up, and the updated program will hang. Second, even if the encryption algorithm isn’t found, the program still tries to decrypt the file. Third, files using the WWBB0000 algorithm weren’t handled correctly. I’ve fixed the first problem by adding a check to see if the 0xFF is at the end of the file, the second problem by assuming the file is a standard JPEG (the same as if the stage is greater than 3), and the third by checking if verwb is greater than zero instead of 1. I’ve posted a new version with these changes to my website at You’re free to use these changes if you’d like. Thanks again for the work you’ve done.

    Comment by Richard Griswold on June 11, 2005 @ 2:29 pm
  2. Richard: Thanks for finding and fixing those bugs. I appreciate it. I’ve been using it to convert my images but hadn’t run across any that didn’t work.

    Comment by dan on June 11, 2005 @ 9:51 pm
  3. Nice program, works perfectly. Thanks for providing this to the community.

    Comment by Benjamin on June 17, 2005 @ 9:01 pm
  4. Benjamin: I’m glad to hear it worked for you.

    Comment by dan on June 18, 2005 @ 7:17 am
  5. hmmm…i must be doing something wrong,then….neither of the versions of wbz2jpg worked for me. i wonder why…

    Comment by kiran on July 20, 2005 @ 1:54 am
  6. Kiran: I’m going to need a little more information if you want any help. What do you mean by not working? Did the program compile? Did it run? Did it give an error when it ran? Did it create an output file? How big was the resulting file?

    Comment by dan on July 20, 2005 @ 9:55 am
  7. Dan, Richard, thanks for your work! I had used wbz2jpg with success until probably mid2003, then things changed on webshots. Richard’s version works for me right now (Linux 2.6.11-powerpc).

    Comment by Mario Frasca on September 14, 2005 @ 8:51 pm
  8. Mario: Glad to hear it’s working for you.

    Comment by dan on September 15, 2005 @ 2:44 pm
  9. Hi … I am just wondering if there is a converter for os x … or would the Linux webshots converter work with os x ??

    I have looked everywhere and can’t find anything!

    Maggie :o)

    Comment by Maggie on September 16, 2005 @ 6:48 pm
  10. I would imagine the convert would work on OSX. Try compiling it and see what happens.

    Comment by dan on September 17, 2005 @ 2:35 pm
  11. Thanks for the fixed wbz2jpg works great

    Like a small hint you can create the script:
    # You need the wbz2jpg and wbzd in this directory (if not, take out the “.”)

    if [ “$1” = “” ]; then
    echo Usage: $0 filename.wbz
    exit 1

    ./wbz2jpg $1 `./wbzd $1`

    Comment by Alejandro on November 16, 2005 @ 1:31 pm
  12. I got the program wbz2jpg to appear on my Ubuntu Desktop. Can someone tell me how I can run this program? Perhaps a terminal command?

    Comment by zacahariah Callaway on November 7, 2008 @ 4:40 pm
  13. Yup, open up a terminal and run ./wbz2jpg and the name of the file.

    Comment by Dan on November 7, 2008 @ 4:45 pm

Comments are closed