doutong7216 2014-03-19 01:20
浏览 34
已采纳

Silverstripe上传和隔行扫描图像

I am trying to navigate the Silverstripe Class definition for GDBackend and am having trouble setting the interlace value.

I am currently setting the quality in _config.php with:

config::inst()->update('GDBackend', 'default_quality', 60);

So i then tried to set the interlacing with the following:

config::inst()->update('GDBackend', 'image_interlace', 1);

Is this the correct method to setting these values? It is hard to know with all of the deprecation going on in this class.

When the image is uploaded the filesize is reduced - so the quality appears to be set correctly but the interlacing setting has no effect.

Also, the logs are free of any errors.

------------------- UPDATE:

After consulting the Silverstripe IRC channel I have moved the config settings into the yml with the following.

GDBackend: default_quality: 60 image_interlace: 1

Images are still not interlaced after upload.

I am using this tool to test for interlacing.

------------------- CONCLUSION:

It turns out that these settings are not a part of the upload processing and only apply to images generated by the CMS. For example images prefixed with something like SetWidth400-image-name.jpg will be interlaced and optimized as instructed by the yml config.

I will be looking into extending the upload module to give the user option to interlace images at the point of upload.

Thanks to colymba for his help clearing this up for me.

  • 写回答

1条回答 默认 最新

  • dream12001 2014-03-19 07:34
    关注

    Like you mentioned interlacing is set via YML config. To be enabled it should be anything else than 0, like mentioned in the PHP config If non-zero, the image will be interlaced, else the interlace bit is turned off.

    Note that when you upload an image this one is not processed automatically on upload. Image quality and interlacing only applies to generated images.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧