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

[8.x] Add GIF, WEBP, WBMP, BMP support to FileFactory::image() #37743

Merged
merged 1 commit into from
Jun 21, 2021
Merged

[8.x] Add GIF, WEBP, WBMP, BMP support to FileFactory::image() #37743

merged 1 commit into from
Jun 21, 2021

Conversation

AmirRezaM75
Copy link
Contributor

@AmirRezaM75 AmirRezaM75 commented Jun 19, 2021

#37742
Currently, when generating dummy images for testing, FileFactory::image() always creates a PNG or JPEG file.
PNG is default for other extensions (like gif):

return new File($name, $this->generateImage(
      $width, $height, Str::endsWith(Str::lower($name), ['.jpg', '.jpeg']) ? 'jpeg' : 'png'
));

This PR checks the file extension and creates proper image.
XBM is not supported since imagexbm() needs location as second parameter.

@GrahamCampbell GrahamCampbell changed the title Add GIF, WEBP, WBMP, BMP support to FileFactory::image() [8.x] Add GIF, WEBP, WBMP, BMP support to FileFactory::image() Jun 19, 2021
@AmirRezaM75
Copy link
Contributor Author

AmirRezaM75 commented Jun 19, 2021

@GrahamCampbell Sry for newbi question
Is StyleCI/CLI going to fix these coding styles automatically or should I push changes manually?

@GrahamCampbell
Copy link
Member

The fixes will be auto-applied when the PR is merged.

@taylorotwell taylorotwell merged commit ae25b78 into laravel:8.x Jun 21, 2021
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.

None yet

3 participants