Closed mohdaftab closed 1 year ago
I believe you have to also use ->imageResizeMode()
in order for the image resize methods to work. Have a look at the Filament docs for FileUpload.
Thank you so much.
I have same problem with Filament V3.2 and Curator V3.6. I have also added imageResizeMode but nothing change. My form component like below. Is there anything wrong ?
CuratorPicker::make('cover_id')
->label("Cover")
->pathGenerator(DatePathGenerator::class)
->size('sm')
->imageResizeMode('cover')
->imageResizeTargetWidth('1920')
->imageResizeTargetHeight('1080')
->relationship('cover', 'id')
Hello,
I am trying to make Filament Curator resize the images when uploading using imageResizeTargetWidth() as suggested in the documentation. Please see the codes below for AppServiceProvider.php and SliderBlock.php I am using Filament v2.0 and Curator v2.8
`class AppServiceProvider extends ServiceProvider { /**
@return void */ public function register() { Curator::preserveFilenames(true) ->imageResizeTargetWidth(500) ->disk("public"); }
/**
@return void */ public function boot() {
} }`
`<?php
namespace App\Filament\Fabricator\PageBlocks;
use Awcodes\Curator\Components\Forms\CuratorPicker; use Filament\Forms\Components\Builder\Block; use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; use Z3d0X\FilamentFabricator\PageBlocks\PageBlock;
class SliderBlock extends PageBlock { public static function getBlockSchema(): Block { return Block::make('slider') ->schema([ Repeater::make("slider") ->schema([ TextInput::make('title')->required(), Textarea::make('description')->nullable(), TextInput::make('link_text')->requiredWith('link'), TextInput::make('link')->url()->requiredWith('link_text'), CuratorPicker::make('photo') ->imageResizeTargetWidth(500) ->required(), ]) ->grid(2) ->defaultItems(1) ->collapsible() ->required(), ]); }
} `
The image is uploaded as with the same resolution as original and it doesn't resize. Also I would like to convert all png and jpg photos to webp format on upload.
Please let me know how to fix this?
Thank you