BKWLD / croppa

Image thumbnail creation through specially formatted URLs for Laravel.
MIT License
496 stars 91 forks source link

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

Open bdteo opened 1 year ago

bdteo commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

I'm open for a pull request !

bdteo commented 1 year ago

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

https://github.com/BKWLD/croppa/pull/213