This code is part of one of the methods. I'm pretty sure it is really bad programming. The third if statement is supposed to be called if all 4 variables were set. Is another method needed? How would you write this piece?
int width = img.Width;
int height = img.Height;
int thumbWidth = 0 , thumbHeight = 0;
int preWidth = 0, preHeight = 0;
//if Landscape
if (width > height && width >= 471)
{
thumbWidth = 120;
thumbHeight = ((120 * height) / width);
preWidth = 471;
preHeight = ((471 * height) / width);
}
//if portrait
else if (height > width && height >= 353)
{
thumbHeight = 120;
thumbWidth = ((120 * width) / height);
preHeight = 353;
preWidth = ((353 * width) / height);
}
//If values were set
if (thumbWidth != 0 && thumbHeight != 0 && preWidth != 0 && preHeight != 0)
{
}
else
{
//do other stuff
}