Silverlight Mass Photo Uploader 占用大量 RAM
我正在构建一个 Silverlight 应用程序,用户可以在其中从计算机中选择照片,编辑关联的标题/描述/标签等,然后通过 WCF 上传到 Web 服务器。实际上,一切都很完美,只是有一个小问题。我想在上传之前在列表中显示照片的缩略图,为了实现这一点,我知道的唯一方法是加载文件然后处理它。如果用户选择大约 20 个文件,sllauncher.exe
会占用大量 RAM,大约为 1 GB(对于 Photoshop/3ds max 或运行了半年的 Firefox 来说,这可能比正常情况要多)小时,但这对于网络照片上传应用程序来说太多了),当我尝试上传图像时,该应用程序甚至尝试加载更多图像并完全崩溃。我希望能够一次上传更多照片,例如一百张或更多,但是如何在仍然具有缩略图功能的情况下实现这一目标?一件事是对上传进行排队,从而对文件的加载进行排队,但这也会导致缩略图也无法加载。有什么建议吗?
I'm building a Silverlight app where users select photos from their computer, edit an associated title/description/tags etc. and then upload to a web server via WCF. Actually everything's working perfectly just with a little problem. I want to show the thumbnails of the photos in a list before uploading, and to achieve that, the only way I know is to load the file and then process it. If the users selects about 20 files, sllauncher.exe
eats huge amount of RAM, around a gigabyte (well it could be more than normal for Photoshop/3ds max, or Firefox that has run for an half an hour, but it IS too much for a web photo uploader app), and when I try to upload the images, the app even tries to load more and crashes completely. I want to be able to upload more photos, like a hundred or more, at a time, but how can I achieve that while still having the thumbnail functionality? One thing is queuing the uploads and therefore the loading of the files, but it would cause the thumbnails also not to load. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会在将图片添加到应用程序后加载图片,获取缩略图并卸载图片 - 然后用户可以在图片上输入他的信息。完成后,原始文件将放入队列中等待上传。这样,一次最多只能处理两张图片,从而释放内存中不需要的数据。
I'd load the picture after it has been added to the application, get the thumbnail and unload the picture - then the user may enter his information on the picture. When it's completed, the original file is put in a queue for upload. That way, only two pictures at once are handled at max, thus freeing the memory from unneeded data.