<commit_before><?php

namespace Poniverse\Ponyfm\Console\Commands;

use Illuminate\Console\Command;

class ResizeImages extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'rebuild:images';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Resizes all images to fit the specifications in Models/Image';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {

    }<commit_msg>Implemented Commands/resizeImages<commit_after><?php

namespace Poniverse\Ponyfm\Console\Commands;

use Illuminate\Console\Command;
use Poniverse\Ponyfm\Models\Image;
use Symfony\Component\HttpFoundation\File\File;

class ResizeImages extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'rebuild:images';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Resizes all images to fit the specifications in Models/Image';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function handle()
    {
        $images = Image::all();
        foreach ($images as $image) {
            $this->info("Regenerating images for ".$image->filename);
            $image->clearExisting();

            $originalFile = new File($image->getFile(Image::ORIGINAL));
            foreach (Image::$ImageTypes as $imageType) {
                Image::processFile($originalFile, $image->getFile($imageType['id']), $imageType);
            }
        }
    }
{'fraction_non_alphanumeric': 0.11648568608094768, 'fraction_numerical': 0.0, 'mean_word_length': 2.172143974960876, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '4250581', 'n_tokens_mistral': 571, 'n_tokens_neox': 562, 'n_words': 144}