Skip to content

Commit

Permalink
feat: readme for newer raspiOS, image download size as parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
shyd committed Dec 22, 2024
1 parent 55a2610 commit 4b3b788
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
16 changes: 11 additions & 5 deletions REST/PhotoFrame/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ This app is built using [Express.js](https://expressjs.com/) and [Material Desig

## Docker Compose

Use the compose file:

```
wget https://raw.githubusercontent.com/shyd/google-photos/develop/REST/PhotoFrame/docker-compose.yml
```

Create an environtment file `photo-frame.env` with the following options:

```
Expand All @@ -23,7 +29,7 @@ docker-compose up -d
```

## Frame Alignment Settings
To change image alignment of a specific photo, put in into the Google Photos description as json with CSS settings like `{"photoFrame":{"vertical":"bottom"}}`, `{"photoFrame":{"horizontal":"left"}}` or activate blurred backdrop for portrait or panorama photos with `{"photoFrame":{"size":"contain"}}`.
To change image alignment of a specific photo, put in into the Google Photos description as json with CSS settings like `{"photoFrame":{"vertical":"bottom"}}`, `{"photoFrame":{"horizontal":"left"}}` or activate blurred backdrop for portrait or panorama photos with `{"photoFrame":{"size":"contain"}}`. Blurred backdrop is active by default for square or portait pictures now.
Possible fields are:

```
Expand All @@ -46,8 +52,8 @@ Change the port mapping in docker from 8080:8080 to 8081:8080 to separate the po

In short:
```
wget https://raw.githubusercontent.com/shyd/google-photos/master/REST/PhotoFrame/nginx/pf-startup.html -O /usr/share/nginx/html/pf-startup.html
wget https://raw.githubusercontent.com/shyd/google-photos/master/REST/PhotoFrame/nginx/proxy.conf -O /etc/nginx/conf.d/proxy.conf
sudo wget https://raw.githubusercontent.com/shyd/google-photos/develop/REST/PhotoFrame/nginx/pf-startup.html -O /usr/share/nginx/html/pf-startup.html
sudo wget https://raw.githubusercontent.com/shyd/google-photos/develop/REST/PhotoFrame/nginx/proxy.conf -O /etc/nginx/conf.d/proxy.conf
```

## Raspberry Pi Setup
Expand All @@ -71,15 +77,15 @@ Let a user auto-login and change `/etc/xdg/lxsession/LXDE-pi/autostart` to this:
@xset s off
@xset -dpms
@xset s noblank
@chromium-browser --start-fullscreen --enable-auto-reload --noerrdialogs --check-for-update-interval=31536000 --app=http://127.0.0.1:8080/slideshow
@chromium-browser --start-fullscreen --enable-auto-reload --noerrdialogs --check-for-update-interval=31536000 --hide-crash-restore-bubble --app=http://127.0.0.1:8080/slideshow
@unclutter -idle 1
```

Now everything should run by default.

### LED Setup

In order to turn off the LEDs of the RPi, add the following lines to `/boot/config.txt`:
In order to turn off the LEDs of the RPi, add the following lines to `/boot/firmware/config.txt`:
```
# Disable Activity LED
dtparam=act_led_trigger=none
Expand Down
2 changes: 1 addition & 1 deletion REST/PhotoFrame/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ async function libraryApiGetMedia(authToken, refreshToken, baseUrl, itemId, user
logger.info(
`Getting Media: ${JSON.stringify(baseUrl)}`);

await fetch(baseUrl + '=d')
await fetch(baseUrl + config.imageSizeQuery)
.then(async function (res) {
const arrayBuffer = await res.arrayBuffer();
const buffer = Buffer.from(arrayBuffer);
Expand Down
6 changes: 6 additions & 0 deletions REST/PhotoFrame/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ if (process.env.CACHE_PATH !== undefined) {
config.cachePath = process.env.CACHE_PATH;
}

// Query postfix to set the image size, default is '=d' for original quality
config.imageSizeQuery = '=d';
if (process.env.IMAGE_SIZE_QUERY !== undefined) {
config.imageSizeQuery = process.env.IMAGE_SIZE_QUERY;
}

// Suffix of blurred image filenames
config.blurredSuffix = '_blurred';

Expand Down
2 changes: 1 addition & 1 deletion REST/PhotoFrame/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
photo-frame:
image: shyd/photoframe:latest
ports:
- "8080:8080"
- "8081:8080"
env_file:
- photo-frame.env
restart: unless-stopped
Expand Down

0 comments on commit 4b3b788

Please sign in to comment.