Bug 90262 - Some animated GIF do not loop infinitely when inserted in presentation as image
Summary: Some animated GIF do not loop infinitely when inserted in presentation as image
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Images-Animated
  Show dependency treegraph
 
Reported: 2015-03-26 15:24 UTC by FM
Modified: 2022-07-13 15:08 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
infinite loop gif (8.66 KB, image/gif)
2015-04-07 07:44 UTC, FM
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FM 2015-03-26 15:24:47 UTC Comment hidden (obsolete)
Comment 1 Robinson Tryon (qubit) 2015-03-31 17:19:44 UTC
TESTING with 4.4.1.2 + Ubuntu 14.04

(In reply to FM from comment #0)
> Impress is able to import animated gif files (loop forever), but some of
> them only play once and then just stop.
> ...
> See here two looping gif files
> https://root.cern.ch/phpBB3/download/file.php?id=10269
> https://root.cern.ch/phpBB3/download/file.php?id=10268
> the latter not being displayed correctly in Impress (it plays just once). A
> similar bug is found if you open these links in Firefox, 

Both files loop for me in FF 36.0.4

> https://root.cern.ch/phpBB3/download/file.php?id=10269

This image loops in Impress.

> https://root.cern.ch/phpBB3/download/file.php?id=10268

This one does not loop in Impress.

So, bug CONFIRMED
Status -> NEW
Comment 2 Matthew Francis 2015-04-07 00:46:38 UTC
The infinitely looping image is set to "loop forever", the other one to "loop count 50"

So the issue is apparently that the loop count isn't properly parsed.

This is the case all the way back to LO 3.3.0, and also occurs on OSX
-> Version: Inherited from OOo
-> Platform: All


$ gifsicle -I test_gifs_gimp.gif 
* test_gifs_gimp.gif 4 images
  logical screen 696x472
  global color table [8]
  background 5
  loop forever
  + image #0 696x472
    comment Created with GIMP
    delay 0.50s
  + image #1 696x472 transparent 7
    delay 0.50s
  + image #2 696x472 transparent 7
    delay 0.50s
  + image #3 696x472 transparent 7
    delay 0.50s
$ gifsicle -I test_gifs.gif 
* test_gifs.gif 4 images
  logical screen 696x472
  global color table [8]
  background 0
  loop count 50
  + image #0 696x472
    delay 0.50s
  + image #1 696x472
    delay 0.50s
  + image #2 696x472
    delay 0.50s
  + image #3 696x472
    delay 0.50s
asbel@ramiel:~/Downloads$
Comment 3 FM 2015-04-07 07:44:25 UTC
Created attachment 114666 [details]
infinite loop gif
Comment 4 FM 2015-04-07 07:49:28 UTC
I attached another gif, which has an infinite loop instead of just 50 repetitions. The problem is the same, it loops in web browsers, but not in Impress.

https://bugs.documentfoundation.org/attachment.cgi?id=114666

$ gifsicle -I test_gifs_infinite.gif
* test_gifs_infinite.gif 5 images
  logical screen 696x472
  global color table [8]
  background 0
  loop forever
  + image #0 696x472
    delay 0.50s
  + image #1 696x472
    delay 0.50s
  + image #2 696x472
    delay 0.50s
  + image #3 696x472
    delay 0.50s
  + image #4 696x472


Maybe the zero delay in the last image is problematic in Impress also?
Comment 5 Olivier Delaune 2016-04-04 10:05:41 UTC
Any news about this? It seems that this issue is still present in the latest version
Comment 6 QA Administrators 2017-05-22 13:20:27 UTC Comment hidden (obsolete)
Comment 7 FM 2017-05-25 05:09:57 UTC Comment hidden (obsolete)
Comment 8 Alex H. 2017-12-30 12:28:13 UTC
The CERN download links no longer work, but I can confirm that for the April 2015 attachment, Impress loops only once. (This is with a self-built 6.1.0.0.alpha0+ on Windows 10.)

However, I have reason to believe that that GIF does not comply with the standard. I don't know how authoritative this is, but on http://giflib.sourceforge.net/whatsinagif/bits_and_bytes.html it says:

  "The Netscape 2.0 looping block must appear immediately
  after the global color table of the logical screen
  descriptor."

That is not the case with this GIF; the Netscape extension appears much later. In the reader (libo-core\vcl\source\filter\igif\gifread.cxx), there is this:

  if( aAnimation.Count() == 1 )
  {
    aAnimation.SetDisplaySizePixel( Size( nGlobalWidth, nGlobalHeight ) );
    aAnimation.SetLoopCount( nLoops );
  }

so what happens is that nLoops is processed only when the bitmap for the first animation frame is created. For this GIF, nLoops is the default 1 at this point, because the Netscape extension has not been seen yet.

I can confirm, on the other hand, that Firefox 57.0.3 does loop infinitely here, so perhaps LibreOffice is wrong. Again, I'm not sure about what the standard requires.
Comment 10 FM 2018-01-13 02:32:36 UTC
I contacted the ROOT developers. According to them, the bug is in LibreOffice, not in their code.

Their generated GIF files loop correctly in Chrome, Firefox, Safari, Keynote and PowerPoint... so it is working everywhere expect in LibreOffice Impress. The standard specifies that Data Blocks (an Application Extension Block is a Data Block) can appear in any order.

See
https://root-forum.cern.ch/t/gifs-created-by-root-do-not-replay-on-libreoffice-impress/19025/21
Comment 11 QA Administrators 2019-01-14 03:51:40 UTC Comment hidden (obsolete)
Comment 12 FM 2020-11-03 16:37:59 UTC
This bug is still there in Version: 6.0.7.3

https://bugs.documentfoundation.org/attachment.cgi?id=114666 inserted in Impress does not loop infinitely.
Comment 13 Timur 2022-02-07 14:14:45 UTC Comment hidden (obsolete)
Comment 14 Timur 2022-07-13 15:08:07 UTC
Repro 7.5+ for Insert-Picture. But this Gif doesn't loop in my PowerPoint 2016. 
Actually, behavior and workaround are the same: Insert-Video.
Low.