Skip to content
This repository was archived by the owner on Aug 10, 2022. It is now read-only.
This repository was archived by the owner on Aug 10, 2022. It is now read-only.

PR webhook for image compression #6186

Open
@jeffposnick

Description

@jeffposnick

I was chatting about this with @petele in the context of checking in a few images as part of #6183, and I wanted to transfer that discussion to a formal issue for a) additional feedback and b) making sure I wouldn't be reinventing the wheel.

I was thinking of creating a new webhook that was triggered as part of PR requests, and which will scan the list of updated files for any images. When it finds an image, it will use a [recommended tool] like imagemin to compress the image with a reasonable default quality, and compare the compressed size to the size of the image in the PR. If the delta is greater than some percentage- or bytes-based threshold, it will fail the PR check. We can then link to the compressed version of the image in a auto-generated PR comment, which folks could download and include in a follow-up commit.

That seems to offer a reasonable balance between automating some of the tasks, without trying to do too much magic without any overrides.

CC: @addyosmani and @PaulKinlan for any thoughts.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions