예제 #1
0
        public RenamingService(string fileNameFormat, string outputDirectory, bool replaceOriginals, ResizeSize size)
        {
            Debug.Assert(!String.IsNullOrWhiteSpace(fileNameFormat));
            Debug.Assert(fileNameFormat.Contains("{0}"));
            Debug.Assert(size != null);

            _fileNameFormat   = fileNameFormat;
            _outputDirectory  = outputDirectory;
            _replaceOriginals = replaceOriginals;
            _size             = size;
        }
예제 #2
0
        public ResizingService(int qualityLevel, bool shrinkOnly, bool ignoreRotations, bool keepMetadata, ResizeSize size, RenamingService renamer)
        {
            Debug.Assert(qualityLevel >= 1 && qualityLevel <= 100);
            Debug.Assert(size != null);
            Debug.Assert(renamer != null);

            _qualityLevel    = qualityLevel;
            _shrinkOnly      = shrinkOnly;
            _ignoreRotations = ignoreRotations;
            _size            = size;
            _renamer         = renamer;
            _keepMetadata    = keepMetadata;
        }
예제 #3
0
 private ResizingService CreateResizer(ResizeSize size, int qualityLevel = 75, bool shrinkOnly = false, bool ignoreRotations = true, bool keepMetadata = false)
 {
     return(new ResizingService(
                qualityLevel,
                shrinkOnly,
                ignoreRotations,
                keepMetadata,
                size,
                new RenamingService(
                    "{0} ({1})",
                    null,
                    false,
                    size)));
 }
예제 #4
0
 public void RemoveSize(ResizeSize size)
 => Settings.Sizes.Remove(size);