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

Question: Can Croppa convert all images to JPEGs? #212

Open
bdteo opened this issue Mar 23, 2023 · 3 comments
Open

Question: Can Croppa convert all images to JPEGs? #212

bdteo opened this issue Mar 23, 2023 · 3 comments

Comments

@bdteo
Copy link

bdteo commented Mar 23, 2023

I have files uploaded in different formats but I want all of their thumbnails to be in JPEG format to save bandwidth and improve user experience.

Is there an easy way to do this with Croppa?

The original files can be downloaded by the users.

I just want them to have JPEG thumnails.

@bdteo
Copy link
Author

bdteo commented Mar 23, 2023

Okay. It seems it can do it. I've explored the codebase.
Putting 'format' => 'jpg' in the config/croppa.php file does the trick.
It also seems that the same can happen through the query string of the URL (specifying &format=jpg).

It does not assign a 'jpg' suffix to the thumnail paths, though.
I will dig some more through the code to see if it is possible without extending some classes.

Anyway, any help is appreciated!!

@sdebacker
Copy link
Collaborator

I'm open for a pull request !

@bdteo
Copy link
Author

bdteo commented Mar 26, 2023

@sdebacker Here is my pull request. I hope you will like it. :) :)

#213

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

No branches or pull requests

2 participants