Skip to content
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

Added new method for intervention WebP support #108

Merged
merged 17 commits into from
Aug 28, 2023

Conversation

Ruitjes
Copy link
Contributor

@Ruitjes Ruitjes commented Aug 18, 2023

Hi @ctessier

Hope you can find the time to check my PR and hopefully approve it.

I hope I've implemented it the right way, if not please let me know so I can change it accordingly. Tested it locally worked as intended.

Its currently only limited to use webp and not for all the other possibly encodings see.

Fixes #106.

@Ruitjes Ruitjes changed the title Added intervention WebP support Added new method for intervention WebP support Aug 18, 2023
@ctessier
Copy link
Owner

Hi @Ruitjes

Thank you for your contribution!

If the need is to be able to convert the output image to WebP, it could totally be another format as well.
Therefore, I would rather make a more generic method (convert for instance) to save the image in a given format.

What do you think?
We could do something like below, where the output format would also be used as the file extension is specified.

AdvancedImage::make('Photo')->convert('webp'); 

public function convert($format) 
{
    $this->outputFormat = $format;

    return $this;
}

if ($this->outputFormat) {
    $this->image->encode($this->outputFormat);
}

See https://image.intervention.io/v2/api/encode for the available formats.

@Ruitjes
Copy link
Contributor Author

Ruitjes commented Aug 18, 2023

Thanks for your quick response @ctessier!

I totally agree with your comment, thus I have made the needed changes to support all the encoding formats by Intervention. Please have a look again :).

@Ruitjes
Copy link
Contributor Author

Ruitjes commented Aug 24, 2023

@ctessier Don't want to come across as impatient, but I was wondering if you could review my pull request sometime :)

@sonarcloud
Copy link

sonarcloud bot commented Aug 28, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ctessier
Copy link
Owner

Hi @Ruitjes

I am merging after a few adjustments.
I am on holidays so I am doing my best to do some final testing and publish a new release.

Thank you so much for your contribution!

@ctessier ctessier merged commit c76885e into ctessier:2.x Aug 28, 2023
2 checks passed
@ctessier ctessier mentioned this pull request Dec 12, 2022
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Webp
2 participants