Sitecore 'getMediaStream' 不工作

Sitecore 'getMediaStream' is not working

现在我正在使用 Dianoga (https://github.com/kamsar/Dianoga) 进行图像压缩。 此工具适用于 png 和 jpg/jpeg 文件,PNG 文件工作正常。但是,如果我上传 JPG 文件,上传工具框会像屏幕截图一样冻结。



这是执行线。

var jpegtran = Process.Start(ToolPath, " -optimize -copy none -progressive -outfile \"{0}\" \"{0}\"".FormatWith(tempFilePath));



如果我像这样更改代码,

var jpegtran = Process.Start(ToolPath, " -optimize -copy none -progressive -outfile \"{1}\" \"{0}\"".FormatWith(tempFilePath));

JPG 文件已更新,但未进行压缩处理。日志说,

"ERROR Could not run the 'getMediaStream' pipeline for '/sitecore/media library/Images/satellite-westtibet'. Original media data will be used"



这是我在 /App_Config/Include/.

中的 web.config 文件
<?xml version="1.0" encoding="UTF-8"?>
    <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
        <sitecore>
            <processors>
                <attachFile argsType="Sitecore.Pipelines.Attach.AttachArgs">
                    <processor mode="on" type="Validations.Attach.ImageAttachMaxSize, Custom.Validations" patch:before="processor [@type='Sitecore.Pipelines.Attach.CheckSize,Sitecore.Kernel']">
                        <restrictedExtensions hint="list">
                            <extension>.jpg</extension>
                            <extension>.jepg</extension>
                            <extension>.png</extension>
                            <extension>.bmp</extension>
                        </restrictedExtensions>
                    </processor>
                </attachFile>
                <uiUpload>
                    <processor mode="on" type="Validations.Upload.ImageUploadMaxSize, Custom.Validations" patch:before="processor [@type='Sitecore.Pipelines.Upload.CheckSize, Sitecore.Kernel']">
                        <restrictedExtensions hint="list">
                            <extension>.jpg</extension>
                            <extension>.jepg</extension>
                            <extension>.png</extension>
                            <extension>.bmp</extension>
                    </restrictedExtensions>
                </processor>
            </uiUpload>
        </processors>

        <pipelines>
            <getMediaStream>
                <processor type="Validations.Compression.ImageCompression, Custom.Validations" />
            </getMediaStream>
        </pipelines>
        <settings>
            <setting name="Media.MaxImageSizeInDatabase" value="600KB" />    
            <setting name="Media.Resizing.Quality" value="72" />
        </settings>
    </sitecore>
</configuration>



宽度和高度为空值时出错

问题终于解决了。问题是我必须“解锁” jpegtran.exe 文件。就是这样。