Пример #1
0
        private static double GetAspectRatio(ImageDataDto i)
        {
            int width  = 0;
            int height = 0;

            if (!string.IsNullOrWhiteSpace(i.Width))
            {
                _ = int.TryParse(i.Width, out width);
            }

            if (!string.IsNullOrWhiteSpace(i.Height))
            {
                _ = int.TryParse(i.Height, out height);
            }

            if (height == 0 || width == 0)
            {
                return(0);
            }

            double result = width;

            result /= height;
            return(result);
        }
Пример #2
0
        private static int GetSizeOrder(ImageDataDto image)
        {
            if (int.TryParse(image.Height, out int value))
            {
                return(value);
            }

            return(0);
        }