<commit_before>package photogallery

import org.grails.plugins.imagetools.ImageTool

class Photo {
  byte[] thumbnail
  String caption
  byte[] image
  Integer width
  Integer height
  static mapping = {
  }
  static constraints = {
    thumbnail(nullable: true)
    caption(nullable: true)
    image(validator: {
      return it?.size() > 0
    })
    width(nullable: false)
    height(nullable: false)
  }

  public static void loadThumbnail(Photo photo) {
    if (photo) {
      def imageTool = new ImageTool()
      imageTool.load(photo.image)
      imageTool.thumbnail(100)   
      photo.thumbnail = imageTool.getBytes("JPEG")
    }
  }
}
<commit_msg>added description<commit_after>package photogallery

import org.grails.plugins.imagetools.ImageTool

class Photo {
    byte[] thumbnail
    String caption
    byte[] image
    Integer width
    Integer height
    String description
    static mapping = {
    }
    static constraints = {
        thumbnail(nullable: true)
        description(nullable: true)
        caption(nullable: true)
        image(validator: {
            return it?.size() > 0
        })
        width(nullable: false)
        height(nullable: false)
    }

    public static void loadThumbnail(Photo photo) {
        if (photo) {
            def imageTool = new ImageTool()
            imageTool.load(photo.image)
            imageTool.thumbnail(100)
            photo.thumbnail = imageTool.getBytes("JPEG")
        }
    }
}

{'fraction_non_alphanumeric': 0.09259259259259259, 'fraction_numerical': 0.0054869684499314125, 'mean_word_length': 2.4168618266978923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1073649', 'n_tokens_mistral': 433, 'n_tokens_neox': 433, 'n_words': 99}