克隆sitecore媒体库图像文件夹 [英] Clone sitecore Media Library image folder

查看:108
本文介绍了克隆sitecore媒体库图像文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Sitecore媒体库中拥有500多个图像,每个图像大小都超过1MB.目前,我们在网页中将这些图像显示为缩略图,但是加载需要更多时间.

I have more than 500 images in Sitecore Media Library each image size is more than 1MB. Currently we are displaying these images as thumbnails in webpage but it takes more time to load.

因此,我计划将缩略图的大小减小到小于50KB,然后单击该图像可显示原始大小的图像.那么,如何以编程方式克隆所有500张图像并压缩Sitecore中的大小?

So I planned reduce the size to less than 50KB for thumbnails and which click the image it shows the original size image. So how can I programmatically clone all the 500 images and compress the size in Sitecore?

推荐答案

Sitecore已建立用于调整图像大小的解决方案,因为图像的大小会更小.您可以使用查询字符串参数来获取较小的图像,然后sitecore将调整图像大小并缓存图像,因此它只会执行一次.详细信息:

Sitecore has builded solution for resize image due to the size of image will be smaller. You can use query string parameters to get smaller image, then sitecore will resize and cached image so it will do this only once. More information: http://www.sitecore.net/learn/blogs/technical-blogs/john-west-sitecore-blog/posts/2011/05/media-options-and-query-string-parameters-in-the-sitecore-aspnet-cms.aspx

您始终可以通过图像压缩来缩小图像尺寸.如果您将媒体文件保存在磁盘上,则任何人都可以迭代并使用此工具: https://tinyjpg.com/.

You can always reduce size of image by image compression. If you save media files on disk you can iterate by anyone and use this tool: https://tinyjpg.com/.

如果您将媒体文件保存在DB中,则只能通过xpath获取如何操作: http://www.symsoftsolutions.com/Blog/List/Get-Media-Url-From-Sitecore ,如上压缩并保存新项目.

If you saved media files in DB you can just get item by xpath how to: http://www.symsoftsolutions.com/Blog/List/Get-Media-Url-From-Sitecore, compress like above and save new item.

这篇关于克隆sitecore媒体库图像文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆