<commit_before><?php namespace Mobileka\L3\Engine\Form\Components;

class Image extends BaseUploadComponent {
	protected $template = 'engine::form.image';
	protected $jcrop = array();

	public function jcrop($options = array())
	{
		if (is_array($options) and !$options)
		{
			$this->jcrop = true;
		}
		else
		{
			$this->jcrop = $options;
		}

		return $this;
	}

	public function value($lang = '')
	{
		if ($this->row->{$this->name})
		{
			return $this->row->getImageSrc($this->name, 'original', true);
		}

		$name = $this->name . '_uploads';

		if ($image = $this->row->{$name}()->first() and in_array(strtolower(\File::extension($image->path)), \Config::get('image.image_extensions')))
		{
			return $this->jcrop ? $image->croppedImage : $image->image;
		}<commit_msg>Fix, so that nothing breaks for everybody else.<commit_after><?php namespace Mobileka\L3\Engine\Form\Components;

class Image extends BaseUploadComponent {
	protected $template = 'engine::form.image';
	protected $jcrop = array();

	public function jcrop($options = array())
	{
		if (is_array($options) and !$options)
		{
			$this->jcrop = true;
		}
		else
		{
			$this->jcrop = $options;
		}

		return $this;
	}

	public function value($lang = '')
	{
		if ($this->row->{$this->name})
		{
			return $this->row->getImageSrc($this->name, 'original', true);
		}

		$name = $this->name . '_uploads';

		if ($image = $this->row->{$name}()->first() and in_array(strtolower(\File::extension($image->path)), array('jpg', 'jpeg', 'gif', 'png')))
		{
			return $this->jcrop ? $image->croppedImage : $image->image;
		}
{'fraction_non_alphanumeric': 0.19911504424778761, 'fraction_numerical': 0.0012642225031605564, 'mean_word_length': 4.073717948717949, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '4813512', 'n_tokens_mistral': 608, 'n_tokens_neox': 543, 'n_words': 110}