Skip to content

Commit

Permalink
chore: compress board images (#133)
Browse files Browse the repository at this point in the history
* chore: optimize images with squoosh

* docs: add README for using squoosh

* chore: update image imports

* chore: rotate janie
  • Loading branch information
KevinWu098 authored Aug 18, 2024
1 parent 46ee490 commit b99b2d9
Show file tree
Hide file tree
Showing 31 changed files with 45 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/assets/data/currentBoard.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{
"name": "Janie Seong",
"position": "Co-President",
"photo": "Janie_Seong.jpeg"
"photo": "Janie_Seong.jpg"
},
{
"name": "Jamie Kuang",
Expand All @@ -34,7 +34,7 @@
{
"name": "Emma Choi",
"position": "Marketing Coordinator",
"photo": "Emma_Choi.jpeg",
"photo": "Emma_Choi.jpg",
"links": [
{
"type": "instagram",
Expand All @@ -60,7 +60,7 @@
{
"name": "John Daniel Norombaba",
"position": "Industry Outreach Coordinator",
"photo": "John_Daniel.jpeg",
"photo": "John_Daniel.jpg",
"links": [
{
"type": "instagram",
Expand Down Expand Up @@ -142,12 +142,12 @@
{
"name": "Winston Lee",
"position": "Project Teams Coordinator",
"photo": "Winston_Lee.jpeg"
"photo": "Winston_Lee.jpg"
},
{
"name": "Megan Rhee",
"position": "Project Teams Coordinator",
"photo": "Megan_Rhee.png",
"photo": "Megan_Rhee.jpg",
"links": [
{
"type": "instagram",
Expand All @@ -164,7 +164,7 @@
{
"name": "Daniela Herrera",
"position": "Creative Director",
"photo": "Daniela_Herrera.jpeg",
"photo": "Daniela_Herrera.jpg",
"links": [
{
"type": "linkedin",
Expand Down Expand Up @@ -234,7 +234,7 @@
{
"name": "Kevin Wu",
"position": "Webmaster",
"photo": "Kevin_Wu.png",
"photo": "Kevin_Wu.jpg",
"links": [
{
"type": "linkedin",
Expand Down
38 changes: 38 additions & 0 deletions src/assets/images/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Optimizing Images with Squoosh

Squoosh is a fantastic [open-source](https://github.com/GoogleChromeLabs/squoosh) image compression tool by Google usable both as a [web app ](https://squoosh.app/) and as a [CLI tool](https://www.npmjs.com/package/@squoosh/cli). Although the CLI is no longer maintained, it still is useful for bulk compressing images (such as every year's new board members).

## Using the Squoosh CLI

> [!IMPORTANT]
> The Squoosh CLI does not support Node versions 18 and above. **Node 16 is recommended (`nvm use 16`).**
For our directory structure (as of Aug. 2024):

```
DUCI-website
└─ src
└─ assets
└─ images
├─ board
│ ├─ current
│ └─ alumni
└─ merch
├─ ...
```

If you wanted to optimize all images within `current/`, you'd run (at the root):

```
npx @squoosh/cli --mozjpeg '{quality:75}' \
-d src/assets/images/output \
src/assets/images/board/alumni
```

Breaking it down:

1. `npx @squoosh/cli` — calls the Squoosh CLI
2. `--mozjpeg` — a flag converting images to `mozjpeg`
3. `'{quality:75}'` — options
4. `-d src/assets/images/output` — creates a directory with the outputted images at the specified location
5. `src/assets/images/board/alumni` — what file(s) to compress
Binary file modified src/assets/images/board/current/Aven_Chew.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/current/Brandon_Kahn.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/current/Caroline_David.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/current/Christina_Tran.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/current/Elisa_Fuji.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/current/Elise_Alinsug.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/board/current/Emma_Choi.jpeg
Binary file not shown.
Binary file added src/assets/images/board/current/Emma_Choi.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/current/Grace_Jong.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/current/Jamie_Kuang.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/board/current/Janie_Seong.jpeg
Binary file not shown.
Binary file added src/assets/images/board/current/Janie_Seong.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/current/Jasmine_Wu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/current/Jessica_Jahja.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/board/current/John_Daniel.jpeg
Binary file not shown.
Binary file added src/assets/images/board/current/John_Daniel.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/current/Kaitlyn_Tran.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/board/current/Kevin_Wu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/board/current/Kevin_Wu.png
Binary file not shown.
Binary file modified src/assets/images/board/current/Krey_Daniel.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/current/Malina_Miura.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/board/current/Megan_Rhee.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/board/current/Megan_Rhee.png
Binary file not shown.
Binary file modified src/assets/images/board/current/Thanusree_Ammisetti.jpg
Binary file modified src/assets/images/board/current/Vimala_Machiraju.JPG
Binary file removed src/assets/images/board/current/Winston_Lee.jpeg
Diff not rendered.
Binary file added src/assets/images/board/current/Winston_Lee.jpg

0 comments on commit b99b2d9

Please sign in to comment.