Ejemplo n.º 1
0
            private void Output()
            {
                ProgressCallback(MiscResources.BatchStatusSaving);

                var now       = DateTime.Now;
                var allImages = scans.SelectMany(x => x).ToList();

                if (Settings.OutputType == BatchOutputType.Load)
                {
                    foreach (var image in allImages)
                    {
                        LoadImageCallback(image);
                    }
                }
                else if (Settings.OutputType == BatchOutputType.SingleFile)
                {
                    Save(now, 0, allImages);
                    foreach (var img in allImages)
                    {
                        img.Dispose();
                    }
                }
                else if (Settings.OutputType == BatchOutputType.MultipleFiles)
                {
                    int i = 0;
                    foreach (var imageList in SaveSeparatorHelper.SeparateScans(scans, Settings.SaveSeparator))
                    {
                        Save(now, i++, imageList);
                        foreach (var img in imageList)
                        {
                            img.Dispose();
                        }
                    }
                }
            }
            private async Task Output()
            {
                ProgressCallback(MiscResources.BatchStatusSaving);

                var now       = DateTime.Now;
                var allImages = scans.SelectMany(x => x).ToList();

                switch (Settings.OutputType)
                {
                case BatchOutputType.Load:
                {
                    foreach (var image in allImages)
                    {
                        LoadImageCallback(image);
                    }

                    break;
                }

                case BatchOutputType.SingleFile:
                {
                    await Save(now, 0, allImages);

                    foreach (var img in allImages)
                    {
                        img.Dispose();
                    }

                    break;
                }

                case BatchOutputType.MultipleFiles:
                {
                    var i = 0;
                    foreach (var imageList in SaveSeparatorHelper.SeparateScans(scans, Settings.SaveSeparator))
                    {
                        await Save(now, i ++, imageList);

                        foreach (var img in imageList)
                        {
                            img.Dispose();
                        }
                    }

                    break;
                }
                }
            }
Ejemplo n.º 3
0
        private void ReorderScannedImages()
        {
            var sep = options.SplitPatchT ? SaveSeparator.PatchT
                : options.SplitScans ? SaveSeparator.FilePerScan
                    : options.SplitSize > 0 || options.Split ? SaveSeparator.FilePerPage
                        : SaveSeparator.None;

            scanList = SaveSeparatorHelper.SeparateScans(scanList, sep, options.SplitSize).Where(x => x.Count > 0).ToList();

            foreach (var scan in scanList)
            {
                var imageList = new ScannedImageList(scan);
                var e         = new List <int>();

                if (options.AltDeinterleave)
                {
                    imageList.AltDeinterleave(e);
                }
                else if (options.Deinterleave)
                {
                    imageList.Deinterleave(e);
                }
                else if (options.AltInterleave)
                {
                    imageList.AltInterleave(e);
                }
                else if (options.Interleave)
                {
                    imageList.Interleave(e);
                }
                else if (options.DividedScanBooklet)
                {
                    imageList.DividedScanBooklet(e);
                }
                if (options.Reverse)
                {
                    imageList.Reverse(e);
                }
            }
        }