Open bdebon opened 2 years ago
Hello there, I did a little research and I didn't really found anything interesting excepting this:
https://github.com/calibreapp/image-actions
The only thing that can make me hesitate is that the latest version is now 3 years old.
But it could be a first "good" solution to the image size problem.
If you're ok to try it let me know, I'll give it a try and make a pull request.
Hi;
As a temporary solution, I suggest that @bdebon could add the maximum file size in KB as well as the ideal file size in pixels in the Readme.
Pull requests that do not respect the ideal file size will be rejected.
Thanks Benjamin for this fun repo :)
Thanks guys for these suggestions.
@glazk0, I think I'm gonna try the action, it does not cost nothing for me since everything is already set up. If it fails, I will fallback on @BuffaloDebile recommendation but I will be very sad too.
I added that actions: https://github.com/petems/image-resizer-gh-action
That check the image in our folder, and for the one that are bigger than 800 width or 800 height, that resizes at max 800 width or 800 height with the good ratio. And it optimize the image too which decrease a lot the final image size. Everything would have been easier with a vps a Next/Image but it also allows us to discover new github actions which is funny!
I would like the CI to just check the images size and throw an error if an image is too big. Then it would ask the user to locally run a certain command to optimize the images and the commit would come from the user and not from the CI. Let's avoid committing with the CI. It's not clean.
As we mentioned in this PR, for the moment there are absolutely no safeguard for the images' size. Some people can add huge images in their PR that then will be served like this to the final user which is both bad for performances, ecology, and webserver cost. Usually we could rely on Next/Image to take care of the formatting of the image. The server would receive the information about or device and would answer with a well formated and optimised images. Here we don't use the Server Side Rendering. We just export the next project and then upload all the generated files on a mutualised webserver. We can't use the power of next/image. Can we solve that by a github action that would format and compress the images sent by the contributors? Any other solution in mind?