문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top