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 webshots.com. 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.
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 http://www.k-lug.org/~griswold/Progs/webshots.html. You’re free to use these changes if you’d like. Thanks again for the work you’ve done.
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.
Nice program, works perfectly. Thanks for providing this to the community.
Benjamin: I’m glad to hear it worked for you.
hmmm…i must be doing something wrong,then….neither of the versions of wbz2jpg worked for me. i wonder why…
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?
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).
Mario.
Mario: Glad to hear it’s working for you.
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!
Thanks,
Maggie :o)
I would imagine the convert would work on OSX. Try compiling it and see what happens.
Thanks for the fixed wbz2jpg works great
Like a small hint you can create the script:
#!/bin/sh
# You need the wbz2jpg and wbzd in this directory (if not, take out the “.”)
if [ “$1” = “” ]; then
echo Usage: $0 filename.wbz
exit 1
fi
./wbz2jpg $1 `./wbzd $1`
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?
Yup, open up a terminal and run ./wbz2jpg and the name of the file.