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

"Contribution check" action: add a warning if an image size is too large #786

Open
12 tasks
tbouffard opened this issue Sep 18, 2024 · 0 comments
Open
12 tasks

Comments

@tbouffard
Copy link
Member

tbouffard commented Sep 18, 2024

NOTE: this is a new attempt after #434 has been closed.

#434 (comment) mentions that it was decided to use an action to compress images. But this is not enough

  • first, it is only enable on the bonita-doc repository, to extend to other content repositories, implement Apply the "images compression" workflow to doc content repositories without duplication #498
  • second, the compress images action is great in optimizing the compression of a given image, but if the dimensions of the image is too large, the compression doesn't help, we miss an opportunity to reduce the dimensions of the image to drastically reduce the size of the file
  • third, the "bonita getting started" pages contains very large gif to show animated contents to the readers. The contents should be a video and served with the appropriate format and provider (YouTube, ....). The GIF format is inaccurate for such purpose. See The bonita-doc branches store too large gif files #788

So, I suggest we restrict the usage of large file by adding a new step in the "Contribution check" action. We could also forbid the usage of GIF content, even JPG if we want to favor PNG or Webm files.
The maximum allowed size is to defined.

Prior applying this check, we should review images in all content repositories and fix large images:

Tasks

  • implement a new step in the action.
  • add the check in the "contribution checks" workflow. First ignore the gif images and decide the max size that will be allowed. 300kB seems enough. To be discussed
  • add a check to detect images that have too large dimensions (values to be discussed). This could be done with the identify cli provided by imagemagick (https://unix.stackexchange.com/a/279911)
  • document the commands used to detect file names of too large images,
  • resize images in content repositories
    • bcd? this repository is no longer updated and there are probably a few images to be resized. We could therefore ignore it.
    • bonita
    • bpi
    • central
    • cloud
    • labs
    • test-toolkit

Available tools for image resizing

Plenty exists, so we will probably use a mix of script/tool/extensions depending on the situation and the amount of files to resize.

In the Antora context, a comment in the Zulip chat suggests to use https://github.com/GoogleChromeLabs/squoosh

@tbouffard tbouffard changed the title Add a warning if an image is big in "Contribution check" action "Contribution check" action: add a warning if an image size is too large Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant