在.NET中最快的图像大小调整图像、大小、最快、NET

2023-09-03 00:16:44 作者:把我辜负

我需要在最快的库来调整全尺寸的图像(有的高达9MB大小),以多种尺寸。

下面是之情况:

用户上传的照片 在一个FileSystemWatcher的运行在一个服务看的放置位置(SAN上) 当一个新的照片显示,该服务将创建4个版本的图像在全JPEG质量: 100像素宽 320px的宽 640px宽 1280宽 User uploads a photo a FileSystemWatcher is running in a service watching the drop location (on a SAN) When a new photo appears, the service will create 4 versions of the image at full JPEG quality: 100px wide 320px wide 640px wide 1280 wide

如果库是C / C ++或任何其他为此事,只要我可以通过.NET挖掘到它这很酷,我不会大惊小怪。

I'm not fussed if the library is C/C++ or anything else for that matter, as long as I can tap into it via .NET it's cool.

此外,这将需要扩展到可能1000 有效用户。

Also this will need to scale to possibly 1,000 active users.

让我知道你的想法:)

推荐答案

有很多文章在那里展示的基础知识。我从 Atalasoft 使用的组件,并发现他们是pretty的质量好。有细微差别来调整大小和JPEG图像的工作。

There are a lot of articles out there showing the basics of this. I've used the components from Atalasoft and found them to be of pretty good quality. There are nuances to resizing and working with JPEG images.

您似乎是真正关心的性能,但你真的不提供足够的信息来帮助我们提出很好的优化为您服务。不管你在做什么,你需要做一个全面的性能分析和了解正在运行缓慢。在某些情况下slowish,但维护的图像处理code可能是确定的,如果其他的事情进行了优化。

You seem to be really concerned with performance but you don't really give enough information to help us suggest good optimizations for you. Whatever you are doing, you need to do a full performance analysis and understand what is running slow. In some cases slowish, but maintainable image processing code may be OK if other things are optimized.

有良好的性能的一个解决方案是要排队需要转换该输入的文件。添加更多的机器在队列中处理更多的信息,或优化服务code,以获得更好的吞吐量。这真的不是那么难处理大量的用户,如果你得到的设计权。

One solution for good performance is to queue incoming files that need to be converted. Add more machines to handle more messages in the queue, or optimize the service code to get better throughput. It's really not that difficult to handle a large number of users if you get the design right.