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.

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

报告相同问题?

悬赏问题

  • ¥18 模拟电路问题解答有偿
  • ¥15 Matlab在app上输入带有矩阵形式的初始条件发生错误
  • ¥15 CST仿真别人的模型结果仿真结果S参数完全不对
  • ¥15 误删注册表文件致win10无法开启
  • ¥15 请问在阿里云服务器中怎么利用数据库制作网站
  • ¥60 ESP32怎么烧录自启动程序
  • ¥50 html2canvas超出滚动条不显示
  • ¥15 java业务性能问题求解(sql,业务设计相关)
  • ¥15 52810 尾椎c三个a 写蓝牙地址
  • ¥15 elmos524.33 eeprom的读写问题