thumbnails

This commit is contained in:
Martin Quarda 2024-05-08 07:04:41 +02:00
parent 5856be9b29
commit c4e95417a8
2 changed files with 2 additions and 1 deletions

View File

@ -70,6 +70,7 @@ def photos(request):
img = PIL.Image.open(file) img = PIL.Image.open(file)
rtn.append({ rtn.append({
'original': '/' + file, 'original': '/' + file,
'thumbnail': '/' + file.replace('photos/', 'photos/thumbnail/'),
'original_width': img.width, 'original_width': img.width,
'original_height': img.height, 'original_height': img.height,
}) })

View File

@ -72,7 +72,7 @@ class Main extends Component {
for (const photo of this.state.photos){ for (const photo of this.state.photos){
photos.push({ photos.push({
source: photo.original, source: photo.original,
src: photo.original, src: photo.thumbnail,
width: photo.original_width, width: photo.original_width,
height: photo.original_height, height: photo.original_height,
}) })