<commit_before>class Sprite < ActiveRecord::Base
  include Commentable

  has_attached_file :image,
    :storage => :s3,
    :s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
    :path => "sprites/:id/:style.:extension",
    :styles => {
      :medium => ["64x64>", :png],
      :thumb => ["32x32#", :png]
    }

  acts_as_archive
  acts_as_taggable
  acts_as_taggable_on :dimension, :source

  belongs_to :user
  belongs_to :parent, :class_name => "Sprite"

  #TODO: Why does this require a special association?
  has_many :tags, :through => :taggings
  define_index do
    indexes title
    indexes description

    #TODO: Get this working without the special association
    indexes tags(:name), :as => :tags
  end

  attr_accessor :broadcast, :file_base64_encoded, :frame_data, :replay_data

  MAX_LENGTH = 256
  # Limit sizes to small pixel art for now
  validates_numericality_of :width, :height, :only_integer => true, :less_than_or_equal_to => MAX_LENGTH, :greater_than => 0, :message => "is too large"

  before_validation :gather_metadata, :convert_to_io, :set_dimensions
<commit_msg>Increased max image upload size<commit_after>class Sprite < ActiveRecord::Base
  include Commentable

  has_attached_file :image,
    :storage => :s3,
    :s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
    :path => "sprites/:id/:style.:extension",
    :styles => {
      :medium => ["64x64>", :png],
      :thumb => ["32x32#", :png]
    }

  acts_as_archive
  acts_as_taggable
  acts_as_taggable_on :dimension, :source

  belongs_to :user
  belongs_to :parent, :class_name => "Sprite"

  #TODO: Why does this require a special association?
  has_many :tags, :through => :taggings
  define_index do
    indexes title
    indexes description

    #TODO: Get this working without the special association
    indexes tags(:name), :as => :tags
  end

  attr_accessor :broadcast, :file_base64_encoded, :frame_data, :replay_data

  MAX_LENGTH = 640
  # Limit sizes to small pixel art for now
  validates_numericality_of :width, :height, :only_integer => true, :less_than_or_equal_to => MAX_LENGTH, :greater_than => 0, :message => "is too large"

  before_validation :gather_metadata, :convert_to_io, :set_dimensions

{'fraction_non_alphanumeric': 0.11604714415231188, 'fraction_numerical': 0.015412511332728921, 'mean_word_length': 4.292565947242206, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '3583099', 'n_tokens_mistral': 783, 'n_tokens_neox': 751, 'n_words': 192}