<commit_before>module Plugins
  module Fusionable
    def self.included base
      base.key :fusion_row_id, Integer
    end
    
    def fusionable &block
      yield key
    end
    
    def to_fusion
      { 'description'     => description, 
        'geometry'        => point.to_kml,
        'name'            => key,
        'preview'         => Key.new(key).medium,
        'preview_height'  => preview_height,
        'preview_width'   => preview_width,
        'title'           => title }.filter &:to_s
    end
    
    protected
      def preview_height
        if orientation.landscape?
          dimensions.calculate(Processors::Previewer.width.pixels.wide).height
        else
          Processors::Previewer.height.pixels.high          
        end
      end
      
      def preview_width
        if orientation.landscape?
          Processors::Previewer.width
        else
          dimensions.calculate(Processors::Previewer.height.pixels.high).height
        end
      end
  end
end
<commit_msg>Fix preview thumbnail dimensions<commit_after>module Plugins
  module Fusionable
    def self.included base
      base.key :fusion_row_id, Integer
    end
    
    def fusionable &block
      yield key
    end
    
    def to_fusion
      { 'description'     => description, 
        'geometry'        => point.to_kml,
        'name'            => key,
        'preview'         => Key.new(key).medium,
        'preview_height'  => preview_height,
        'preview_width'   => preview_width,
        'title'           => title }.filter &:to_s
    end
    
    protected
      def preview_height
        if dimensions.ratio < 1.2
          dimensions.calculate(Processors::Previewer.width.pixels.wide).height
        else
          Processors::Previewer.height.pixels.high          
        end
      end
      
      def preview_width
        if dimensions.ratio < 1.2
          Processors::Previewer.width
        else
          dimensions.calculate(Processors::Previewer.height.pixels.high).height
        end
      end
  end
end

{'fraction_non_alphanumeric': 0.08117359413202933, 'fraction_numerical': 0.0019559902200488996, 'mean_word_length': 1.7063492063492063, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2627971', 'n_tokens_mistral': 583, 'n_tokens_neox': 574, 'n_words': 119}