~mro/Photos2Atom

bca06af33e25bb2698fd6d6b8f6fa10d86f42a64 — Marcus Rohrmoser 8 years ago 1ccf576
use largest adjusted binary available. refs #1
1 files changed, 4 insertions(+), 2 deletions(-)

M Photos2Atom.rb
M Photos2Atom.rb => Photos2Atom.rb +4 -2
@@ 360,8 360,10 @@ module MRO
          #   $stderr.write "-(#{img['MediaType']})"
          #   next
          # end
          src = nil
          Dir.glob(File.join(@IPHOTO.libraryPath,'resources','modelresources','*','*',row[11],row[12])) {|fn| src = fn} unless row[11].nil?
          # $stderr.puts "img: #{row[5]}"
          src = nil          
          # use the largest adjusted image binary (if there is an adjustmend)
          src = Dir.glob(File.join(@IPHOTO.libraryPath,'resources','modelresources','*','*',row[11],row[12])).max_by {|fn| File.size(fn)} unless row[11].nil?
          src ||= File.join(@IPHOTO.libraryPath, 'Masters', row[5]) # fallback to unmodified master image
          raise src unless src.start_with?( @IPHOTO.libraryPath )
          dst_fmt = case File.extname(src)