croppa icon indicating copy to clipboard operation
croppa copied to clipboard

Question: Can Croppa convert all images to JPEGs?

Open bdteo opened this issue 1 year ago • 3 comments

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 avatar Mar 23 '23 23:03 bdteo

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!!

bdteo avatar Mar 23 '23 23:03 bdteo

I'm open for a pull request !

sdebacker avatar Mar 24 '23 15:03 sdebacker

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

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

bdteo avatar Mar 26 '23 19:03 bdteo