Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug on GIF files #1341

Closed
truchi opened this issue Mar 8, 2017 · 2 comments
Closed

Bug on GIF files #1341

truchi opened this issue Mar 8, 2017 · 2 comments

Comments

@truchi
Copy link

truchi commented Mar 8, 2017

Hello,

I found a strange behaviour when using GIF files with default media config.
I have:

  • Grav@1.1.17
  • default media config: GIF's type is 'animated'
  • a page (foo.lang.md) with a headers' key containing a GIF filename (bar.gif)
  • an alternative for this file (i.e. bar.gif & bar@2x.gif in the page folder) (I guess this is important to reproduce bug)
  • a twig template calling page.media to retrieve GIF's URL

I get:

Twig_Error_Runtime
An exception has been thrown during the rendering of a template ("Division by zero").

On the line calling page.media.

The line throwing 'Division by 0' is actually system/src/Grav/Common/Page/Media.php:144
The object used here does not have width and height because MediumFactory gives me a StaticImageMedium (system/src/Grav/Common/Page/Medium/MediumFactory.php:87). Everything is fine with 'image'.

Doc is cool but should dig deeper for this kind of stuff.
Hope this helps!

@rhukster
Copy link
Member

rhukster commented Mar 9, 2017

I'm pretty sure we are relegating all gifs to be animated as we can't tell animated from non animated. And then you are trying to do retina which is not support for animated types. Does it work if you remove the @2x version?

@rhukster
Copy link
Member

I can confirm it's specifically the @2x and the fact that this image is not actually resizable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants