neilime / zf2-assets-bundle

AssetsBundle is a module for Zend Framework 2 allowing asset managment (bundling & caching)
https://neilime.github.io/zf2-assets-bundle/
MIT License
33 stars 20 forks source link

Disable media 'optimazation' #46

Closed chielsen closed 7 years ago

chielsen commented 8 years ago

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?

neilime commented 8 years ago

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.

neilime commented 7 years ago

Does it work for you ?

chielsen commented 7 years ago
'filters' => [
            'jpg' => new \Zend\Stdlib\ArrayUtils\MergeRemoveKey(),
 'jpeg' => new \Zend\Stdlib\ArrayUtils\MergeRemoveKey(),
        ],

This works for me.

neilime commented 7 years ago

Thank you, I've added this trick to FAQ : https://github.com/neilime/zf2-assets-bundle/wiki/FAQ#how-to-disable-media-optimization