]> git.openstreetmap.org Git - rails.git/commitdiff
Adjust to final animated GIF interface
authorTom Hughes <tom@compton.nu>
Mon, 13 May 2019 19:17:01 +0000 (20:17 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 13 May 2019 19:17:01 +0000 (20:17 +0100)
Gemfile
Gemfile.lock
lib/gpx.rb

diff --git a/Gemfile b/Gemfile
index 604db1500d60bc57bcb920cb2ea11ba6f47948a4..26872a0438ac2e40ccc23c1520a474a2402180b5 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -117,7 +117,7 @@ gem "canonical-rails"
 gem "logstasher"
 
 # Used to generate images for traces
-gem "gd2-ffij", :git => "https://github.com/mmd-osm/gd2-ffij.git", :branch => "animated_gif"
+gem "gd2-ffij", "= 0.4.0.dev"
 
 # Used for browser detection
 gem "browser"
index 73169aaea799dc33420d2bc732a73eb5aaf2f8dc..a7fcdf30e701f44929f3ed3603cc7c639c463a4c 100644 (file)
@@ -1,11 +1,3 @@
-GIT
-  remote: https://github.com/mmd-osm/gd2-ffij.git
-  revision: c92057a8f699a36b5f6d208db3d11eb3bae185dd
-  branch: animated_gif
-  specs:
-    gd2-ffij (0.3.1)
-      ffi (>= 1.0.0)
-
 GEM
   remote: https://rubygems.org/
   specs:
@@ -181,6 +173,8 @@ GEM
       multipart-post (>= 1.2, < 3)
     ffi (1.10.0)
     fspath (3.1.0)
+    gd2-ffij (0.4.0.dev)
+      ffi (>= 1.0.0)
     geoip (1.6.4)
     globalid (0.4.2)
       activesupport (>= 4.2.0)
@@ -468,7 +462,7 @@ DEPENDENCIES
   factory_bot_rails
   fakefs
   faraday
-  gd2-ffij!
+  gd2-ffij (= 0.4.0.dev)
   geoip
   htmlentities
   http_accept_language (~> 2.0.0)
@@ -518,4 +512,4 @@ DEPENDENCIES
   webmock
 
 BUNDLED WITH
-   1.16.6
+   1.17.2
index f3e0c0e26c0bddce6d50931fbd5627d333cecd05..1b1c17ac7876f3bad65a40ba476daa6201ee0d55 100644 (file)
@@ -100,16 +100,15 @@ module GPX
         end
       end
 
-      res = GD2::AnimatedGif.gif_anim_begin(frames[0])
-      res << GD2::AnimatedGif.gif_anim_add(frames[0], nil, delay)
-      (1...nframes).each do |n|
-        res << GD2::AnimatedGif.gif_anim_add(frames[n],
-                                             (frames[n] == frames[n - 1] ? nil : frames[n - 1]),
-                                             delay)
+      image = GD2::AnimatedGif.new
+      frames.each do |frame|
+        image.add(frame, :delay => delay)
       end
-      res << GD2::AnimatedGif.gif_anim_end
+      image.end
 
-      res
+      output = StringIO.new
+      image.export(output)
+      output.read
     end
 
     def icon(min_lat, min_lon, max_lat, max_lon)