<commit_before>require "RMagick"
module RMagickProcessor
  extend self
  def image_to_tiff
    tmp_file = Tempfile.new(["",".tif"])
    cat = @instance || Magick::Image.read(@source.to_s).first
    cat.crop!(@x, @y, @w, @h) unless [@x, @y, @w, @h].compact == []
    cat.write(tmp_file.path.to_s){self.compress = "none"}
    return tmp_file
  end

  def read_with_processor(path)
    Magick::Image.read(path.to_s).first
  end

  def is_a_instance?(object)
    object.class == Magick::Image
  end
end
<commit_msg>Try to set quality attribute to 100 to avoid compression in convert call<commit_after>require "RMagick"
module RMagickProcessor
  extend self
  def image_to_tiff
    tmp_file = Tempfile.new(["",".tif"])
    cat = @instance || Magick::Image.read(@source.to_s).first
    cat.crop!(@x, @y, @w, @h) unless [@x, @y, @w, @h].compact == []
    cat.write(tmp_file.path.to_s){self.quality = 100}
    return tmp_file
  end

  def read_with_processor(path)
    Magick::Image.read(path.to_s).first
  end

  def is_a_instance?(object)
    object.class == Magick::Image
  end
end

{'fraction_non_alphanumeric': 0.15041782729805014, 'fraction_numerical': 0.005571030640668524, 'mean_word_length': 3.922374429223744, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '207917', 'n_tokens_mistral': 416, 'n_tokens_neox': 401, 'n_words': 86}