joshembling / image-optimizer Goto Github PK
View Code? Open in Web Editor NEW๐จ Optimize your Filament images before they reach your database.
Home Page: https://filamentphp.com/plugins/joshembling-image-optimizer
License: MIT License
๐จ Optimize your Filament images before they reach your database.
Home Page: https://filamentphp.com/plugins/joshembling-image-optimizer
License: MIT License
I followed the installation steps correctly, but when using it it shows the class not found error.
Step to install:
composer require joshembling/image-optimizer
After installing, I tried to perform the optimization, but it shows me the following error:
Class "Intervention\Image\ImageManagerStatic" not found
.
lastest
8.1.12
10.28.0
Windows
No response
After updating filament, I encountered errors indicating an Undefined variable $getUploadingMessage
. Any insights or resolutions to rectify this issue would be greatly appreciated. Thanks.
Once updating to latest filament version
1.2.0
8.2.15
10.42.0
No response
No response
Is this extension cannot be use inside livewire with filament/forms? would be very happy if this extension could be used on livewire
I cannot use the optimize() method after install package. I already do composer update but still doesn't work on livewire with filament/form
latest
8.2
11.8
Windows
No response
I am on Filament ^3.2.
I am using intervention/laravel-image in other parts of my laravel backend, which causes issues when I want to use "joshembling/image-optimizer": "^1.3",
and I run composer update
:
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires intervention/image-laravel ^1.0 -> satisfiable by intervention/image-laravel[1.0.0, 1.0.1].
- intervention/image-laravel[1.0.0, ..., 1.0.1] require intervention/image ^3 -> satisfiable by intervention/image[3.0.0, ..., 3.3.3].
- You can only install one version of a package, so only one of these can be installed: intervention/image[2.7.0, 2.7.1, 2.7.2, 3.0.0, ..., 3.3.3].
- joshembling/image-optimizer[v1.3.0, ..., v1.3.1] require intervention/image ^2.7 -> satisfiable by intervention/image[2.7.0, 2.7.1, 2.7.2].
- Root composer.json requires joshembling/image-optimizer ^1.3 -> satisfiable by joshembling/image-optimizer[v1.3.0, v1.3.1].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
I would expect that these composer update problems would not occur, which would be fixed if the used version of intervention/image was bumped to ^3?
Install intervention/image-laravel with:
composer require intervention/image-laravel
Then install image-optimzer with:
composer require joshembling/image-optimizer
Then update composer.json
to bump joshembling/image-optimizer
to ^1.3
, then run:
composer update
OR
Alternatively just try to install joshembling/image-optimizer v1.3 directly after installing intervention/image-laravel
:
composer require joshembling/image-optimizer:v1.3
1.1
8.2
10.43.0
macOS
No response
Filament Importer mapping doesn't work when this package is installed
Try importer , it will not map
1.4.0
8.1
10.10
No response
No response
error show Trait "Filament\Forms\Components\Concerns\HasUploadingMessage" not found
i am create new laravel and filament project and implement image optimizer, and this is the error if i access the page that using FileUpload Component
1.3.1
8.2.0
10
Windows
No response
FileUpload::make('image')
->label(__('fields.Image'))
->acceptedFileTypes(['image/jpeg', 'image/png'])
->visibility('public')
->optimize('webp')
->downloadable()
->previewable()
->openable(),
It's not going to S3 with the public. should do something like this:
Storage::put($this->record->image, Storage::get($this->record->image), 'public');
.
1.3
8.2
10.43
macOS
No response
Getting this error when i add ->optimize('webp') to my FileUploads. and submit a form.
"Unable to find file (livewire-tmp/jeVtd41JPHzi9vyTyczpRHsiPit38g-metadW50aXRsZWQgKDI5IG9mIDMwKS5qcGc=-.jpg)."
From Livewire documentation:
"Livewire stores temporary files in a non-public directory as previously mentioned, therefore, there's no simple way to expose a temporary, public URL to your users for image previewing. If you've configured Livewire to use S3 for temporary file storage, calling ->temporaryUrl() will generate a temporary, signed URL from S3 directly so that you don't hit your Laravel app server for this preview at all."
My bucket is accessible from the internet and works normally.
However, when I inspect the file permissions inside the livewire-tmp folder, those are not readable from internet. The bucket however is correctly configured, inside my non-temporary folders all uploads are public. Im not sure if its a Livewire issue (or feature), im pretty sure the bucket and permissions are correct. If the tmp files cannot be read, could this be the reason why its throwing the error?
Thanks!
.env file:
FILESYSTEM_DISK=s3
FILAMENT_FILESYSTEM_DISK=s3
plus your AWS credentials.
In resource form schema, simply:
Forms\Components\FileUpload::make('main_image')
->label(__('Main Image'))
->image()
->directory('images')
->required()
->maxSize(2048)
->optimize('webp') // < throws exception
->visibility('public')
->downloadable()
->previewable()
->openable()
When submitting this exception appears:
Unable to find file (livewire-tmp/jeVtd41JPHzi9vyTyczpRHsiPit38g-metadW50aXRsZWQgKDI5IG9mIDMwKS5qcGc=-.jpg).
(The file is present in livewire-tmp/ inside the bucket but cannot be read)
latest
8.3.1
10.48.4
Windows
No response
When I use the optimize option I get the error Trait "Filament\Forms\Components\Concerns\HasUploadingMessage" not found.
The trait is not in \vendor\filament\forms\src\Concerns. When I put on comment 'use Concerns\HasUploadingMessage;' it's working fine. Version error?
Make a Filament form with Forms\Components\SpatieMediaLibraryFileUpload::make('images')
->image()->imageEditor()->optimize('webp')
joshembling/image-optimizer 1.4.0 + Filament 3.1.47
8.2.15
10.48
Windows
No response
When i try to upload an svg, the GD driver throws this exeption:
Intervention\Image\Exception\NotReadableException: Unsupported image type image/svg+xml.
Is there any way to skip optimization just for this file format?
Thanks!
When i upload an *.svg file, the Intervention\Image\Exception\NotReadableException
exeption occurs.
1.4.0
8.3.0
11.0
Linux
No response
I tried to use the Filament Import Action and after hours of research i found out, that with this plugin installed every "afterStateUpadated" funtion for any FileUpload is not accessible anymore.
Can you please add some functionality so that the afterStateUpdated is not overwritten by default.
For Fileuploads like csv or anything else it makes no sense at all.
Install the Plugin, create a ImportAction and try to import.
1.3.1
8.3
10.45
macOS
No response
When I tried to install the plugins to existing filament project using composer
composer require joshembling/image-optimizer
I've got error below
PHP Fatal error: Trait "Filament\Forms\Components\Concerns\HasUploadingMessage" not found in /pathToProject/vendor/joshembling/image-optimizer/src/Components/BaseFileUpload.php on line 22
Symfony\Component\ErrorHandler\Error\FatalError
Trait "Filament\Forms\Components\Concerns\HasUploadingMessage" not found
at vendor/joshembling/image-optimizer/src/Components/BaseFileUpload.php:22
18โ use League\Flysystem\UnableToCheckFileExistence;
19โ use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
20โ use Throwable;
21โ
โ 22โ class BaseFileUpload extends Field
23โ {
24โ use Concerns\HasUploadingMessage;
25โ
26โ /**
Whoops\Exception\ErrorException
Trait "Filament\Forms\Components\Concerns\HasUploadingMessage" not found
at vendor/joshembling/image-optimizer/src/Components/BaseFileUpload.php:22
18โ use League\Flysystem\UnableToCheckFileExistence;
19โ use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
20โ use Throwable;
21โ
โ 22โ class BaseFileUpload extends Field
23โ {
24โ use Concerns\HasUploadingMessage;
25โ
26โ /**
+1 vendor frames
2 [internal]:0
Whoops\Run::handleShutdown()
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255
install the package from terminal to existing filament project
composer require joshembling/image-optimizer
1.3.0
8.2.2
10.43.0
macOS
my composer.json
"require": {
"php": "^8.1",
"awcodes/filament-table-repeater": "^2.0",
"awcodes/filament-tiptap-editor": "^3.0",
"aymanalhattami/filament-page-with-sidebar": "^2.4",
"bezhansalleh/filament-shield": "^3.1",
"codewithdennis/filament-select-tree": "^3.1",
"darryldecode/cart": "^4.2",
"dasundev/livewire-dropzone": "^1.0",
"eightynine/filament-excel-import": "^3.0",
"erlandmuchasaj/laravel-gzip": "^1.0",
"filament/filament": "^3.0-stable",
"filament/spatie-laravel-media-library-plugin": "^3.0",
"filament/spatie-laravel-settings-plugin": "^3.0",
"filament/spatie-laravel-tags-plugin": "^3.0",
"filament/spatie-laravel-translatable-plugin": "^3.0",
"flowframe/laravel-trend": "^0.1.1",
"guzzlehttp/guzzle": "^7.2",
"jenssegers/agent": "^2.6",
"joshembling/image-optimizer": "*",
"laravel/framework": "^10.10",
"laravel/horizon": "^5.21",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.8",
"laraveldaily/laravel-invoices": "^3.3",
"league/flysystem-aws-s3-v3": "^3.21",
"predis/predis": "^2.2",
"pxlrbt/filament-excel": "^2.1",
"ralphjsmit/livewire-urls": "^1.3",
"saade/filament-adjacency-list": "^3.1",
"sebastiansulinski/laravel-currency": "^3.2",
"spatie/image": "^2.2",
"squirephp/countries-en": "^3.3",
"squirephp/currencies-en": "^3.3",
"z3d0x/filament-fabricator": "^2.0",
"z3d0x/filament-logger": "^0.6.1"
},
Method 'optimize' not found in \Filament\Forms\Components\FileUpload
follow the readme.md file
latest
v8.1.19
v10.14.0
macOS
No response
Laravel 11 support?
No Laravel 11 support.
latest
8.3
11
No response
No response
i cannot use composer require joshembling/image-optimizer with error
joshembling/image-optimizer[v1.0.0, ..., v1.3.1] require illuminate/contracts ^10.0 -> found illuminate/contracts[v10.0.0, ..., v10.48.2] but these were not loaded, likely because it conflicts with another require.
and
Root composer.json requires joshembling/image-optimizer * -> satisfiable by joshembling/image-optimizer[v1.0.0, ..., v1.3.1].
i cannot use composer require joshembling/image-optimizer with error
joshembling/image-optimizer[v1.0.0, ..., v1.3.1] require illuminate/contracts ^10.0 -> found illuminate/contracts[v10.0.0, ..., v10.48.2] but these were not loaded, likely because it conflicts with another require.
and
Root composer.json requires joshembling/image-optimizer * -> satisfiable by joshembling/image-optimizer[v1.0.0, ..., v1.3.1].
1.3.1
8.3
11
Windows
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.