We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Windows server 2019 performance

Hi

I have a tiff file with > 100 frames.
I’m saving each frame to a separate tiff image file and a thumbnail (100 pixels width) in jpeg format.

When I run the example code on my laptop I get:

Save tiff: 143ms
Save thumbnail: 756ms

for each frame

When I run the same test on a windows server 2019 I get :

Save tiff: 429ms
Save thumbnail: 5649ms

Here is the code (.net 5.0.7) :

        int thumbnailWidth = 100;

        string file = @"C:\Temp\a\test.TIF";

        using (TiffImage image = (TiffImage)Aspose.Imaging.Image.Load(file))
        {
            for (int i = 0; i < image.Frames.Length; ++i)
            {
                Console.WriteLine($"page {i} of {image.Frames.Length}");

                var _watch = System.Diagnostics.Stopwatch.StartNew();

                // filters
                string file2 = @"C:\Temp\a\test_tiff_" + i + ".tif";

                // save the file
                Aspose.Imaging.ImageOptions.TiffOptions options = new Aspose.Imaging.ImageOptions.TiffOptions(image.Frames[i].FrameOptions);
                options.PageName = "";
                options.PageNumber = new ushort[2] { 0, 0 };
                options.CompressedQuality = 100;
                options.Compression = TiffCompressions.CcittFax4;

                image.Frames[i].Save(file2, options);

                _watch.Stop();
                Console.WriteLine($"Save tiff: {_watch.ElapsedMilliseconds}ms");

                _watch = System.Diagnostics.Stopwatch.StartNew();

                // the thumbnail now
                if (image.Frames[i].Width > 0 && image.Frames[i].Height > 0)
                {
                    // resize ...
                    image.Frames[i].ResizeWidthProportionally(thumbnailWidth, Aspose.Imaging.ResizeType.AdaptiveResample);

                    // ... and save
                    var options2 = new Aspose.Imaging.ImageOptions.JpegOptions();
                    options2.Quality = 100;

                    file2 = @"C:\Temp\a\test_tiff_thumb_" + i + ".jpg";

                    image.Frames[i].Save(file2, options2);
                }

                Console.WriteLine($"Save thumbnail: {_watch.ElapsedMilliseconds}ms");
            }
        }

@km2020

Can you please provide the working sample project along with source files so that we may add issue for investigation on our end. I am also assuming that you have tried using the latest version Aspose.Imaging for .NET 21.6 on your end.

Hi,

Yes, I’m using the latest version of aspose libraries.
I’ve send you the project and the tif files with PM

Thanks

@km2020

Can you please share where you have shared the information with us.

testAspose.zip (36.3 KB)

This is the code.
You can use any multi page TIFF

@km2020

I request you to please provide the one that you have used as we may try to observe the behaviour as shared by you in your environment.

10MB_Tif.zip (94.2 KB)

This is your test tif from github. I cannot share the original test file because it contains sensitive information. I can PM it if you like.

The output is the same:

windows 10:
page 0 of 5
Save tiff: 113ms
Save thumbnail: 528ms
page 1 of 5
Save tiff: 38ms
Save thumbnail: 232ms
page 2 of 5
Save tiff: 56ms
Save thumbnail: 225ms
page 3 of 5
Save tiff: 36ms
Save thumbnail: 233ms
page 4 of 5
Save tiff: 35ms
Save thumbnail: 223ms

windows server 2019:
page 0 of 5
Save tiff: 314ms
Save thumbnail: 2300ms
page 1 of 5
Save tiff: 129ms
Save thumbnail: 1867ms
page 2 of 5
Save tiff: 172ms
Save thumbnail: 1806ms
page 3 of 5
Save tiff: 113ms
Save thumbnail: 1824ms
page 4 of 5
Save tiff: 98ms
Save thumbnail: 1843ms

Thanks

@km2020

I have created a ticket in our issue tracking system with ID IMAGINGNET-4606 to further evaluate the performance in Windows Server 2019. This thread has been linked with the issue so that you may be notified once the issue will be addressed.

@km2020

The API also supports Tiff batch mode. Can you please try the implementation given over following documentation link on your end.

Hi

This method seems to work fine.
Will test it more and get back to you.

Thanks

Hi

This does not work either. Same results.

@km2020

Can you please share the details of statistics achieved using suggested approach.

windows 10:

page 0 of 5
Save tiff: 108ms
Save thumbnail: 354ms
page 1 of 5
Save tiff: 40ms
Save thumbnail: 313ms
page 2 of 5
Save tiff: 52ms
Save thumbnail: 234ms
page 3 of 5
Save tiff: 39ms
Save thumbnail: 233ms
page 4 of 5
Save tiff: 41ms
Save thumbnail: 230ms

windows server 2019:

page 0 of 5
Save tiff: 334ms
Save thumbnail: 2108ms
page 1 of 5
Save tiff: 149ms
Save thumbnail: 1783ms
page 2 of 5
Save tiff: 124ms
Save thumbnail: 1707ms
page 3 of 5
Save tiff: 103ms
Save thumbnail: 1721ms
page 4 of 5
Save tiff: 121ms
Save thumbnail: 1759ms

** using the 10MB_Tif.tif

@km2020

Thank you for sharing the information. We will share the feedback with you as soon as our team will respond back.