I'm currently examining ImageProcessorCore and I ran into an issue that makes me feel like I'm missing something: On his website the dev shows some benchmarks with a performance that is completely different to the times I measure in my sample program. I have a 2.3 MB (3853x2569) jpg image from which I only want to get the width and height (for now), so I created this little .NET core console test application:
using ImageProcessorCore;
using System;
using System.IO;
namespace ImageProcessorCoreTest
{
public class Program
{
public static void Main(string[] args)
{
using (FileStream input = File.OpenRead(@"c:\test\a.jpg"))
{
DateTime start = DateTime.Now;
Image image = new Image(input);
int w = image.Width;
int h = image.Height;
double duration = (DateTime.Now.Subtract(start)).TotalMilliseconds;
Console.WriteLine("Image size is " + w.ToString() + "x" + h.ToString() + " Pixels (" + duration.ToString() + "ms)");
Console.ReadLine();
}
}
}
}
This operation takes more than 11 seconds (factor 100 compared the benchmarks mentioned above) for just reading in the image and getting the size. What am I doing wrong?
I'm using version 1.0.0 on Windows 10 Pro 64.
(BTW: My dev machine is an i7-5820K with 16G RAM and a Samsung Pro 950 NVMe drive, so the hardware most probably can't be a bottleneck, I think.)
Update 1: Recompiling ImageProcessorCore and creating a release nuget package that I then use in my (release) sample program unfortunately only brings the duration down to a little over 10 seconds.
Update 2: I just resized the test image (externally) to 2000x1334 pixels. This significantly brought down the time to 849 milliseconds, which is still strange considering the given 56 ms for reading, resizing and writing out again in the dev's benchmark.
Update 3: I now use a test image that I can share with you for testing. The new image is 11416x6380 pixels (11.5 MB) and it takes >17 seconds with above code. You can download it here: http://orig01.deviantart.net/92d3/f/2010/110/7/2/pla_sf_3_by_recon071.jpg
Update 4: When I use the package from the MyGet repository, the time for the latest test image (see Update 3) goes down to 2.4 seconds.