mindkomm / timmy

Advanced image handling for Timber.
MIT License
171 stars 13 forks source link

Inline Styles #7

Closed philJohnson closed 7 years ago

philJohnson commented 7 years ago

Is it possible to remove the inline style that gets added for width?

gchtr commented 7 years ago

Yes it is, with the oversize parameter.

I saw that the documentation wasn’t up date for oversize and tried to make it more clear what options you have.

philJohnson commented 7 years ago

I've looked at the documentation and it's not working. Ideally I want to be able to have

'oversize' => array(
    'allow' => false,
    'style_attr' => false,
),

It doesn't appear to work though.

looking at 'lib/Timmy.php' line 360 should probably read

if ( ! $oversize['allow'] && $oversize['style_attr']) {

otherwise $restrict will be set based on height or width and include inline styles

gchtr commented 7 years ago

Ok, I see. Thanks for pointing that out! Could you check with the latest master version to see if it is working?