Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to optimise images? #212

Closed
ericmp33 opened this issue Mar 6, 2024 · 0 comments
Closed

How to optimise images? #212

ericmp33 opened this issue Mar 6, 2024 · 0 comments

Comments

@ericmp33
Copy link

ericmp33 commented Mar 6, 2024

Shouldn't the image be lighter after optimising it?

$filePath = public_path('img/testImg.png');

dd(
    \Illuminate\Support\Number::fileSize(
        bytes: filesize($filePath),
        precision: 3,
    ),

    \Spatie\Image\Image::load($filePath)
        ->optimize()
        ->save()
    ,

    \Illuminate\Support\Number::fileSize(
        bytes: filesize($filePath),
        precision: 3,
    ),
);
Screenshot 2024-03-06 at 14 27 12
@spatie spatie locked and limited conversation to collaborators Mar 6, 2024
@freekmurze freekmurze converted this issue into discussion #213 Mar 6, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant