Gif animation file in the grid format didn"t show the animation

Gif animation file in the grid format didn"t show the animation

by Irith Herman -
Number of replies: 5

Hi I"m using 2.5

the Gif animation file that I uploaded to in the grid format didn"t show the animation.

irith

 

Average of ratings: -
In reply to Irith Herman

Re: Gif animation file in the grid format didn"t show the animation

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Irith,

EDIT: Please ignore, see below.  "What exact version of Moodle and the Grid format (the contents of the version.php file) are you using please?  What theme are you using?  What browser and version are you using?"

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Gif animation file in the grid format didn"t show the animation

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok, a quick test on Moodle 2.6.1 and my latest unreleased development version 2014011400 shows that I can replicate the problem.  However, the format uses the PHP GD library to resize the uploaded images which currently does not support reading of animated Gif's - http://www.php.net/manual/en/function.imagecreatefromgif.php.  There is a link to another library - http://www.gdenhancer.com/ - which claims to support them.  However it is for PHP 5.4 and only M2.7 is proposed to have PHP 5.4 as a minimum requirement.  Thus cannot be the solution in M2.5 or M2.6.  Additionally I don't know at this moment in time how difficult it would be to use the library or indeed might make the installation process difficult.

Therefore at this moment in time, there is nothing I can do to solve the problem.  Sorry.

Cheers,

Gareth

Average of ratings: Useful (1)
In reply to Gareth J Barnard

Re: Gif animation file in the grid format didn"t show the animation

by John S -

Now that Moodle 2.7 has been released and stabilized, how do things look for animated gif support?

I've look a bit into it, and there seems to be 2 potential workarounds:

1. Imagemagick instead of GD, supports animated gifs (at least according to wikipedia), but is a seperate php extension to be installed.

2. Offer direct uploads without processing the files through GD. Perhaps an option could be added to the "Set the image resize method" dropdown for "None" or "No scaling".

Hope you consider these possibilities.


Cheers,

John

In reply to John S

Re: Gif animation file in the grid format didn"t show the animation

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear John,

Thank you for the information.  With:

  1. I do not want to add an install dependency that is outside of the standard Moodle installation and checking.  It will only annoy people and cause lots of 'why is this not working' type questions.  Pragmatically, people do not read instructions, they just want to install the files, click on next without reading the text until it finishes and then expect it to work.
  2. Nice idea, but again, this I believe will cause confusion as it is logically intermixing two different functionalities.  So, when the image does not react to the size change then I'll get questions like 'why is the image not resizing when I change the size of the box?'.

Ok, I do now see the possibility that when uploading that gif images are left unprocessed and scaled using CSS.  The code as it stands was designed to be as optimal as possible.  However, if a compromise that the full size of the file is downloaded, then it is conceivable that it would work behind the scenes without user interaction.  This will take time to figure out and I don't have time at the moment.  But I'll keep it in the back of my mind for sometime in the future.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Gif animation file in the grid format didn"t show the animation

by John S -

Hi Gareth,

1. Understandable point, more moving parts usually lead to more trouble

2. A javascript alert notifying that the user would have to upload a resized image could be shown just after selecting the option.

A responsive css image resize method could work, and the end result should be sharper than running it through GD with another processing cycle.

Thanks for your consideration again and keep up the great work,

John