Skip to content

Resize and optimize image sizes #218

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

Merged
merged 7 commits into from
Jun 6, 2019
Merged

Conversation

jwcooper
Copy link
Member

@jwcooper jwcooper commented Jun 4, 2019

WIP Yet...

Script to resize originally uploaded files to two different sizes, optimize sizes and load them properly for viewport size.

Current /downloads size: 29.23MB
New /downloads size: 1.47MB

To start, we'll either need people to upload 3 images for new boards (original, 300 px width, 700 px width), or run the script after adding a new board. Updated readme for the instructions on adding 3 images.

@tannewt
Copy link
Member

tannewt commented Jun 4, 2019

Is it possible to fall back to the scaled original if it is only available?

@jwcooper
Copy link
Member Author

jwcooper commented Jun 4, 2019

We can do it with javascript, but I haven't found a way with only html/css that works reliably. I'll add the javascript fallback before we're ready to review.

@tannewt
Copy link
Member

tannewt commented Jun 4, 2019

Could we use Jekyll to do it?

@jwcooper
Copy link
Member Author

jwcooper commented Jun 4, 2019

Great idea, will try that quick. Looks like you can test if a file exists with jekyll and liquid.

@jwcooper
Copy link
Member Author

jwcooper commented Jun 5, 2019

We'll now fallback to the original image if the large or small sizes do not exist (using jekyll).

@jwcooper jwcooper requested a review from tannewt June 5, 2019 19:24
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thank you!

@tannewt tannewt merged commit 2487c36 into adafruit:master Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants