<commit_before><?php

class Imageupload {
    protected $CI;

    const UPLOAD_PATH = './uploads/';
    const THUMBNAIL_POSTFIX = '_thumb';
    const THUMBNAIL_SMALL_POSTFIX = '_thumb_small';

    public function __construct() {
        $this->CI =& get_instance();
        $this->CI->load->library(['upload', 'image_lib']);
    }

    public function upload_images($param, $generate_thumbs = true, $image_type = '') {
        $file_name = '';
        if (!empty($image_type)) {
            $upload_path = self::UPLOAD_PATH . $image_type . '/';
        }

        // Load upload library
        $this->CI->upload->initialize([
            'upload_path' => $upload_path,
            'allowed_types' => 'gif|jpg|png|jpeg',
            'file_ext_tolower' => TRUE,
            'max_size' => 2048, // 2MB
            'encrypt_name' => TRUE
        ]);

        // Upload Image
        if ($this->CI->upload->do_upload($param)) {<commit_msg>bug fix for image upload lib<commit_after><?php

class Imageupload {
    protected $CI;

    const UPLOAD_PATH = './uploads/';
    const THUMBNAIL_POSTFIX = '_thumb';
    const THUMBNAIL_SMALL_POSTFIX = '_thumb_small';

    public function __construct() {
        $this->CI =& get_instance();
        $this->CI->load->library(['upload', 'image_lib']);
    }

    public function upload_images($param, $generate_thumbs = true, $image_type = '') {
        $file_name = '';
        if (!empty($image_type)) {
            $upload_path = self::UPLOAD_PATH . $image_type . '/';
        } else {
            $upload_path = self::UPLOAD_PATH;
        }

        // Load upload library
        $this->CI->upload->initialize([
            'upload_path' => $upload_path,
            'allowed_types' => 'gif|jpg|png|jpeg',
            'file_ext_tolower' => TRUE,
            'max_size' => 2048, // 2MB
            'encrypt_name' => TRUE
        ]);

        // Upload Image
        if ($this->CI->upload->do_upload($param)) {
{'fraction_non_alphanumeric': 0.15657084188911705, 'fraction_numerical': 0.00513347022587269, 'mean_word_length': 2.205592105263158, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '1671968', 'n_tokens_mistral': 621, 'n_tokens_neox': 608, 'n_words': 112}