Monthly Archives: May 2009

Buying a second-hand Digital SLR Camera

Having recently purchased a camera from TradeMe (New Zealand equivalent of ebay), I now realise that I made several mistakes. The camera was a Canon 5D with a 24-105 F4L lens and was physically flawless. It appeared to have been very well looked after, and the test shots looked fine, so I have to admit I wasn’t as cautious as I should have been. But the day afterwards I noticed what looked like very fine cracks in all my photos. Some quick internet research revealed that what I was seeing was fungal growth on the CMOS sensor! How did I not notice this?

The problem was that I went to have a look at the camera after the sun had gone down, thus all the photos were taken in dim indoor lighting which needs wide a aperture for proper exposure. At wider apertures much of the light hitting the sensor comes in at a wider angle, and as the sensor has a filter in front of it some light can get behind foreign matter on the surface of the filter before hitting the sensor. Narrow apertures show up dirt far more readily as the light is coming in from a narrower range of angles.

Looking at the sensor itself I could see the fungus and some other specks of dust. So I took a test shot of the sky at f/22, +1 EV (although any brightly lit background would do)… and this is what I saw (this is the full frame so you’ll have to view it enlarged to see what I’m talking about):

Filthy!

Filthy!

Needless to say, these marks have a very visible impact on any pictures with an aperture narrower than about f/7, and looking back I can even make out the fungus in the original test shots I took at f/4.

Fungal growth on the sensor could potentially be expensive, as a by-product of fungus is an acidic compound which could eat away at the coating on the filter. Worst case is that it needs a new filter, which should not be expensive in itself but would expensive in terms of labour as it requires dismantling the camera. So I’m hoping a simple clean will put it right!

So, the lesson I learned is to take some test shots in BRIGHT LIGHT, at both narrow and wide apertures. Narrow apertures reveal dirt on the sensor, and wider ones are more likely to show up any lens issues such as fringing or bad focus.

A summary of advice:

  1. Go to view the camera during the day, not at night.
  2. Take your own memory card along so you can examine the shots in more detail when you get home. I did this, but the wide apertures meant that the fungus was barely discernible, and it was on the edge of the image where the picture was out of focus anyway, so I wasn’t looking in the right places.
  3. Take test shots of the sky or another brightly lit background at the narrowest aperture possible (normally f/22) and +1EV (exposure value). If you simply can’t arrange a time during the day, flash shots of a clean white or lightly coloured wall should suffice. Or you could use a long shutter speed, since dirt on the sensor isn’t going to move you don’t have to worry about camera shake or motion blur… just make sure you get the right exposure.
  4. If purchasing a lens with the body, take some shots at the widest aperture possible, as these are far more likely to show up lens flaws such as fringing or bad focus.
  5. Examine the sensor by putting the camera into “sensor cleaning” mode. This flips up the mirror so you can see the sensor. To do this on a 40D you would go to setup menu 2 (yellow icon with two dots) > Sensor Cleaning > Clean Manually. On the 5D just scroll down to it, it’s in the orange setup section close to the bottom.

There are no doubt many other flaws to look out for in cameras which I haven’t touched on here. So be sure to look at other sites with more complete information, but nonetheless I hope this has been useful for someone!

Update 1-6-08

Probably what most people reading this are going to want to know is; did the sensor clean fix the problem? Unfortunately it didn’t, and Canon quoted me $2500+gst in parts alone for repairs (which is a new sensor assembly). Since this is considerably higher than the value of the camera, it’s basically not economic to repair unless you know someone capable of replacing the filter or dismantling the camera and cleaning it properly.

Trying Windows 7, and backing up Vista first

I grabbed a copy of the Windows 7 release candidate off a colleague at work today. Yeah I’m a Linux guy but it’s good to keep tabs on what the dark side is doing, so I thought I’d upgrade Vista SP1 on my laptop to Win 7. My laptop is a dual boot setup with Ubuntu 9.04 as well as Windows, and of course I want to keep a backup of the Vista partition so I can revert to it when the RC expires in March 2010 (I would probably pay to upgrade to Win7 if the cost was sub $50, but this is not likely).

Listing the partitions to begin with:

sudo fdisk -l

My hard disk is partitioned with Windows on a primary partition an Linux on an extended one. Sda1 is my Vista partition, sda5 is Linux root and sda7 is my storage space.

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2af0e241

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        9710    77994551    7  HPFS/NTFS
/dev/sda2            9711       60801   410388457+   5  Extended
/dev/sda5            9711       22764   104856223+  83  Linux
/dev/sda6           60410       60801     3148708+  82  Linux swap / Solaris
/dev/sda7           22765       60409   302383431   83  Linux

I want to make a backup of sda1, which is an 80gb NTFS partition, to a file on sda7. A straight dd copy would result in an 80gb file which is a bit much, so there are a couple of tricks that can be used to get the file size down.

The first is zeroing out the empty space parts of the drive. Deleting files on a hard drive doesn’t blank the space it previously occupied, it simply marks it as unused space so that it can be used for something else. Since dd is a low level copy, it copies everything, including blocks that have deleted data which we don’t want. So to make sure this data is erased we mount the filesystem and create a file full of zeros on it (easiest way to do this is to simply click on it by going to places if you use Gnome, otherwise you can use the mount command if you wish e.g. “mount -t ntfs-3g /dev/sda1 /mnt/windows”):

dd if=/dev/zero of=/media/disk/zeroFile.tmp bs=4M

The bs=4M parameter isn’t essential, but it makes the process significantly faster.

Once dd process stops, the partition should be full and you can delete zeroFile.tmp. You now know that the free space has no data in it.

Taking a straight dd image now would still result in an 80gb file however, as dd will simply copy all the zeroes verbatim. Fortunately blank space will compress down to nothing, so we can pipe the output from dd through gzip. The parameters I’ve used are “c” (which writes output to std out), and “9” for best compression.

In effect we will have 3 programs running:

  • dd bs=4M if=/dev/sda1
  • gzip -c9
  • dd bs=4M of=/media/disk/Vista.img.gz

When you exclude the “if=” or “of=” parameters, dd reads or writes from stdin/stdout, depending on which is omitted. So the first dd is reading the partition and outputting to stdout, and the second one is reading from stdin and writing it to the file. Gzip sits in the middle compressing the stream.

The full command is thus:

dd bs=4M if=/dev/sda1 | gzip -c9 | dd bs=4M of=/media/disk/Vista.img.gz

To restore the partition you would use:

dd if=/media/disk/Vista.img.gz | gzip -dc | dd of=/dev/sda1

(bearing in mind of course that this overwrites sda1 with whatever is in the image file)

I don’t know how Windows 7 handles foreign bootloaders yet, but before installing Windows it would also be wise to backup your mbr, which is the first 512 bytes on your hard drive:

dd if=/dev/sda of=bootSectorBackup.img bs=512 count=1

And to restore it:

dd if=bootSectorBackup.img of=/dev/sda bs=512 count=1

Note that in this case the block size (bs) and count parameters are very important, as they define how much of the disk is overwritten. Also if Windows does overwrite the bootloader, you’ll need a Linux boot CD to restore your MBR.

Right, now I just need to go and install Win 7.

Addendum:

If you want to check the status of the dd copy (see this post), it’s more useful to send the sigusr1 command to the “read” instance of dd (the one with the if= parameter), as that way you can see how much of the disk has been read. If you sent it to the output instance, you’d get the amount of data which has been written to disk, and this is after it has been compressed so unless you know what size the resulting file is going to be it’s not much use!