Fix the issue with libtiff 4 noted by arekz in issue #525.
Fix minor cast warnings.
Fix an out-of-bounds exception thrown by msvc in debug mode.

By default msvc performs vector range checks in debug mode, causing calls like ```vector[vector.size()]``` to fail.
Limit the number of channels to read when setting a specific number of channels.

By default getting a pixel gets all the channels in the source. When the target number of channels was smaller than the channel in the source there was a buffer overflow in the pixel buffer. This error was silent on gcc/Linux but caused a corrupted heap error in msvc.
Do not try to read pixels for 0-sized images when printing the SHA-1 info.
Call resize instead of reserve when allocating the ouput buffer in dpxoutput.

```vector::reserve``` does not modify the size, this was causing out-of-bounds errors in msvc when trying to use even ```m_buf[0]```.