neilime/zf2-assets-bundle

Disable media 'optimazation'

Closed this issue · 4 comments

I don't want to ruin my images. By default it will run all images through the filters, but thusfar i have not found a way to disable running the default filters as i cannot unset the key and setting the filter null will just run the previously used filer (bug?).
Am i missing something or could this be added?

Hi,

In your assets_bundle config, you can disabled filters for image :

 'filters' => array(
        'png' => null,
        'jpg' => null, 'jpeg' => null,
        'gif' => null,
    ),

You can try this config.

Does it work for you ?

'filters' => [
            'jpg' => new \Zend\Stdlib\ArrayUtils\MergeRemoveKey(),
 'jpeg' => new \Zend\Stdlib\ArrayUtils\MergeRemoveKey(),
        ],

This works for me.