diff --git a/ComicRack.Engine/IO/Provider/StorageProvider.cs b/ComicRack.Engine/IO/Provider/StorageProvider.cs index c87d806..9ee30a9 100644 --- a/ComicRack.Engine/IO/Provider/StorageProvider.cs +++ b/ComicRack.Engine/IO/Provider/StorageProvider.cs @@ -204,30 +204,33 @@ public static PageResult[] GetImages(IImageProvider provider, ComicPageInfo cpi, StoragePageType storagePageType = (setting.PageType != StoragePageType.Original) ? setting.PageType : GetStoragePageTypeFromExtension(ext); if (!string.IsNullOrEmpty(ext) && setting.PageResize == StoragePageResize.Original && (setting.PageType == StoragePageType.Original || setting.PageType == GetStoragePageTypeFromExtension(ext)) && cpi.Rotation == ImageRotation.None && setting.DoublePages == DoublePageHandling.Keep && setting.ImageProcessing.IsEmpty) { - array = provider.GetByteImage(cpi.ImageIndex); - if (setting.PageType == StoragePageType.Jpeg) - { - using (MemoryStream s = new MemoryStream(array)) - { - if (!JpegFile.GetImageSize(s, out var size)) - { - array = null; - } - else - { - cpi.ImageWidth = size.Width; - cpi.ImageHeight = size.Height; - } - } + if (forExport) + { + ExportImageContainer data = provider.GetByteImageForExport(cpi.ImageIndex); + array = (data.NeedsToConvert) ? ConvertImage(storagePageType, data.Bitmap, setting) : data.Data; } - - if (forExport) + else { - ExportImageContainer data = provider.GetByteImageForExport(cpi.ImageIndex); - array = (data.NeedsToConvert) ? ConvertImage(storagePageType, data.Bitmap, setting) : data.Data; - } + array = provider.GetByteImage(cpi.ImageIndex); + } + + if (setting.PageType == StoragePageType.Jpeg) + { + using (MemoryStream s = new MemoryStream(array)) + { + if (!JpegFile.GetImageSize(s, out var size)) + { + array = null; + } + else + { + cpi.ImageWidth = size.Width; + cpi.ImageHeight = size.Height; + } + } + } - if (array != null && array.Length != 0) + if (array != null && array.Length != 0) { return new PageResult[1] {