Skip to content

Commit

Permalink
Added elements
Browse files Browse the repository at this point in the history
  • Loading branch information
wallytutor committed Dec 8, 2024
1 parent 59a6f19 commit b25897d
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 44 deletions.
2 changes: 1 addition & 1 deletion content/2024-09-07.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Title: Cycloferrata Chironne
Title: Cycloferrata Chironne
Date: 2024-09-07 06:00
Modified: 2024-09-07 06:00
Tags: Gravel, Via Ferrata
Expand Down
16 changes: 16 additions & 0 deletions content/2024-12-14.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Title: Dentelles de Montmirail
Date: 2024-12-14 06:00
Modified: 2024-12-14 06:00
Tags: Escalade, Alpinisme
Category: Daily Adventures
Slug: crete-du-turc-dentelles
Author: Walter Dal'Maz Silva
Summary: Course d'arete
Lang: fr
Translation: false
Status: published


#### Dentelles de Montmirail

Objectif [Traversée E-W de la Crête du Turc](https://www.camptocamp.org/routes/691827/fr/dentelles-de-montmirail-chaine-de-gigondas-traversee-e-w-de-la-crete-du-turc)
18 changes: 9 additions & 9 deletions content/media/2024-05-20-VTT-Monts-du-Lyonnais/track.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
tiles:
url: https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png
attr: OpenTopoMap

altitude_range:
- 150
- 900

grid_interval: 0.025
tiles:
url: https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png
attr: OpenTopoMap

altitude_range:
- 150
- 900

grid_interval: 0.025
8 changes: 8 additions & 0 deletions content/pages/Links.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ Status: hidden
### Trail

- [Finishers](https://www.finishers.com/courses)

- [Premier Marathon](https://premier-marathon.com/)

### Neige et glace

- [Data Avalanche](https://www.data-avalanche.org/)

- [Ice Climbing Cogne](https://www.iceclimbingcogne.com/)
68 changes: 34 additions & 34 deletions imgresize.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# -*- coding: utf-8 -*-
"""
A simple helper script for reducing images for publishing.
References
----------
- https://stackoverflow.com/questions/10607468
- https://stackoverflow.com/questions/76616042
"""
from pathlib import Path
from PIL import Image


def workflow(dname, fname, scale=6):
""" Workflow for reducing image sizes. """
wd = Path(f"content/media/{dname}")
fpath = wd / fname
npath = wd / f"{fpath.stem}-by-{scale}.jpg"

if npath.exists():
print(f"Already generated {npath}")
return

img = Image.open(fpath)
size = (img.size[0]//scale, img.size[1]//scale)

tmp = img.resize(size, Image.LANCZOS)
tmp.save(npath, optimize=True, quality=95)


if __name__ == "__main__":
dname = "2024-05-20-VTT-Monts-du-Lyonnais"
workflow(dname, "IMG_20240520_100458_721.jpg", scale=6)
workflow(dname, "IMG_20240520_110519_776.jpg", scale=6)
# -*- coding: utf-8 -*-
"""
A simple helper script for reducing images for publishing.
References
----------
- https://stackoverflow.com/questions/10607468
- https://stackoverflow.com/questions/76616042
"""
from pathlib import Path
from PIL import Image


def workflow(dname, fname, scale=6):
""" Workflow for reducing image sizes. """
wd = Path(f"content/media/{dname}")
fpath = wd / fname
npath = wd / f"{fpath.stem}-by-{scale}.jpg"

if npath.exists():
print(f"Already generated {npath}")
return

img = Image.open(fpath)
size = (img.size[0]//scale, img.size[1]//scale)

tmp = img.resize(size, Image.LANCZOS)
tmp.save(npath, optimize=True, quality=95)


if __name__ == "__main__":
dname = "2024-05-20-VTT-Monts-du-Lyonnais"
workflow(dname, "IMG_20240520_100458_721.jpg", scale=6)
workflow(dname, "IMG_20240520_110519_776.jpg", scale=6)

0 comments on commit b25897d

Please sign in to comment.