Пример #1
0
        /// <summary>
        /// Gets the image size internal.
        /// </summary>
        /// <param name="path">The path.</param>
        /// <returns>ImageSize.</returns>
        private ImageSize GetImageSizeInternal(string path)
        {
            ImageSize size;

            try
            {
                size = ImageHeader.GetDimensions(path, _logger, _fileSystem);
            }
            catch
            {
                _logger.Info("Failed to read image header for {0}. Doing it the slow way.", path);

                CheckDisposed();

                using (var wand = new MagickWand())
                {
                    wand.PingImage(path);
                    var img = wand.CurrentImage;

                    size = new ImageSize
                    {
                        Width  = img.Width,
                        Height = img.Height
                    };
                }
            }

            StartSaveImageSizeTimer();

            return(size);
        }
Пример #2
0
        public ImageSize GetImageSize(string path)
        {
            CheckDisposed();

            using (var wand = new MagickWand())
            {
                wand.PingImage(path);
                var img = wand.CurrentImage;

                return(new ImageSize
                {
                    Width = img.Width,
                    Height = img.Height
                });
            }
        }
Пример #3
0
        public ImageSize GetImageSize(string path)
        {
            CheckDisposed();

            using (var wand = new MagickWand())
            {
                wand.PingImage(path);
                var img = wand.CurrentImage;

                return new ImageSize
                {
                    Width = img.Width,
                    Height = img.Height
                };
            }
        }