<commit_before>module Locomotive
  module Concerns
    module Asset
      module Vignette

        def vignette_url
          if self.image?
            if self.width < 85 && self.height < 85
              self.source.url
            else
              Locomotive::Dragonfly.resize_url(self.source, '85x85#')
            end
          elsif self.pdf?
            Locomotive::Dragonfly.thumbnail_pdf(self.source, '85x85#')
          end
        end

        def alternative_vignette_url
          format = if self.image?
            if self.width > self.height
              '190x120>'
            else
              '190x120>'
            end
          elsif self.pdf?
            '190x120#'
          end

          Locomotive::Dragonfly.thumbnail_pdf(self.source, format) if format
        end

      end
    end
  end
end<commit_msg>do not resize a vignette (content_asset) if the image has no width nor height<commit_after>module Locomotive
  module Concerns
    module Asset
      module Vignette

        def vignette_url
          if self.image?
            if self.width < 85 && self.height < 85
              self.source.url
            else
              Locomotive::Dragonfly.resize_url(self.source, '85x85#')
            end
          elsif self.pdf?
            Locomotive::Dragonfly.thumbnail_pdf(self.source, '85x85#')
          end
        end

        def alternative_vignette_url
          format = if self.image? && self.width && self.height
            '190x120>'
          elsif self.pdf?
            '190x120#'
          end

          Locomotive::Dragonfly.thumbnail_pdf(self.source, format) if format
        end

      end
    end
  end
end
{'fraction_non_alphanumeric': 0.07207207207207207, 'fraction_numerical': 0.032432432432432434, 'mean_word_length': 1.4902840059790732, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3826052', 'n_tokens_mistral': 530, 'n_tokens_neox': 478, 'n_words': 114}