panomosity 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1866a3bdb83866570192a3ca7f4c12632e28bd035b33c14ffa10b6ce68e5b0aa
4
- data.tar.gz: 29251ea2be17bb88f0923d6394d25dff0ac3336e5471ed6523e2855785a05404
3
+ metadata.gz: a182f799a0789e1a9a3ce30b1bf8936264397aa125b169331039a31436935fad
4
+ data.tar.gz: c6409d39cfd42beb780f6c40059316290ff08cf6350b94139134e4857537d53e
5
5
  SHA512:
6
- metadata.gz: c5b0b268254fb2e5bb3a2e6b1d80852215945b2b692b67f5d1188688cab0b673f869b783ab299d4f4e84b08332a9f90ad2ee64d5ac10162d15514d0b547cb7f7
7
- data.tar.gz: 192bf1ad022ff2b47dc34e060209fa6b6aa261b066606d51a4cfd9b3ab12f5fb603d695f108e00ba73947e870f3b8d4fb04969424f54ab1a310091b9433d0a69
6
+ metadata.gz: 56dd5d550d87a277a8bc2778aa9a73dbd373e543cb53718c9ac5015de25ca307283414ffe4bbb28a66e440b9682c7109cb177f7202778f645851ef0fdf46612f
7
+ data.tar.gz: cae10bb2101d9e69bccf7ca461fbe7821dce48bc3315c30d84465ddcfd1a8a224a16c242ce8392795601f31eb3d30d8ff984d5ce5a8bc8047b89b39cfa28106f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- panomosity (0.1.11)
4
+ panomosity (0.1.12)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -416,10 +416,20 @@ module Panomosity
416
416
  optimizer = Optimizer.new(panorama)
417
417
  optimizer.run
418
418
 
419
+ # sort images
420
+ logger.info 'sorting images in case they get out of order'
421
+ lexically_sorted_images = optimizer.images
422
+ numerically_sorted_images = optimizer.images.sort_by { |image| [image.column, image.row] }
423
+ image_map = {}
424
+ lexically_sorted_images.each_with_index do |image_l, i|
425
+ image_map[image_l.name] = numerically_sorted_images[i]
426
+ end
427
+
419
428
  @lines = @input_file.each_line.map do |line|
420
429
  image = optimizer.images.find { |i| i.raw == line }
421
430
  if image
422
- image.to_s
431
+ sorted_image = image_map[image.name]
432
+ sorted_image.to_s
423
433
  else
424
434
  next line
425
435
  end
@@ -1,3 +1,3 @@
1
1
  module Panomosity
2
- VERSION = '0.1.12'
2
+ VERSION = '0.1.13'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panomosity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Garcia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-16 00:00:00.000000000 Z
11
+ date: 2018-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler