Skip to content

Commit

Permalink
+gallerie photo
Browse files Browse the repository at this point in the history
  • Loading branch information
gllmAR committed May 5, 2024
1 parent 36ff390 commit 69ff749
Show file tree
Hide file tree
Showing 62 changed files with 424 additions and 7 deletions.
17 changes: 15 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Presentation du programme de techniques d'intégration multimédia à Montmorenc
* Axe installations interactives
* La ruche (Tutorat)


<div data-include="_medias/portes-ouvertes-2024/esprit/index.html"></div>


# Nos étudiantes et étudiants

<iframe width="90%" height="500" src="https://www.youtube.com/embed/otEUz0gCL7g?rel=0" title="Entrevues étudiantes - Techniques d&#39;intégration multimédia (octobre 2020)" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
Expand Down Expand Up @@ -39,6 +43,7 @@ Presentation du programme de techniques d'intégration multimédia à Montmorenc
* Web
* Publicité

<div data-include="_medias/portes-ouvertes-2024/pour_qui/index.html"></div>


# On fait quoi en TIM ?
Expand All @@ -62,16 +67,24 @@ Presentation du programme de techniques d'intégration multimédia à Montmorenc

## Laboratoires informatique performants

![](./_medias/laboratoires.png)
![](./_medias/laboratoires.jpg)

* 3 Laboratoires de 26 postes performants


## Équipement à la fine pointe

* Réalité mixte
* Réalité virtuelle
* Audio
* Vidéo
* Éclairage
* Électronique

<div data-include="_medias/portes-ouvertes-2024/equipement/index.html"></div>


# Épreuve synthèse de programme
# Épreuve synthèse de programme

* Expérience multimédia interactive
* [Crescentia](https://tim-montmorency.com/2024/)
Expand Down
97 changes: 97 additions & 0 deletions docs/_medias/gen-thumb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import argparse
import os
import subprocess

def create_thumbnail(image_path, thumb_path):
"""Generates a thumbnail for an image using FFmpeg."""
cmd = [
'ffmpeg', '-i', image_path,
'-vf', 'scale=w=min(iw\\,375):h=min(ih\\,375):force_original_aspect_ratio=decrease',
'-qscale:v', '2', # Quality scale for JPEG and WebP
thumb_path
]
subprocess.run(cmd, check=True)

def create_html(directory, images):
"""Creates an index.html file in the specified directory based on the provided images."""
if not images:
return # Do not create HTML if no images are processed

html_path = os.path.join(directory, 'index.html')
html_content = []
html_header = '''
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Photo Album</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery.js/dist/css/lightgallery.min.css" />
</head>
<body>
<div id="lightgallery">
'''
html_footer = '''
</div>
<script src="https://cdn.jsdelivr.net/npm/lightgallery.js/dist/js/lightgallery.min.js"></script>
<script>
lightGallery(document.getElementById('lightgallery'), {
selector: 'a'
});
</script>
</body>
</html>
'''

for img, thumb in images:
html_content.append(f'''
<a href="{os.path.relpath(img, start=directory)}">
<img src="{os.path.relpath(thumb, start=directory)}" alt="Thumbnail of {os.path.basename(img)}" style="max-width:100%;height:auto;">
</a>
''')

html_full = html_header + "\n".join(html_content) + html_footer
with open(html_path, 'w') as file:
file.write(html_full)

def process_directory(directory, recursive, dryrun):
"""Processes a single directory to create thumbnails and an HTML file."""
images = []
image_extensions = ['.jpg', '.jpeg', '.png', '.webp'] # Supported image extensions
for filename in os.listdir(directory):
extension = os.path.splitext(filename)[1].lower()
if extension in image_extensions and not filename.startswith("thumb"):
full_image_path = os.path.join(directory, filename)
thumb_filename = f"thumb-375-{filename}"
thumb_path = os.path.join(directory, thumb_filename)

if not dryrun:
if not os.path.exists(thumb_path):
create_thumbnail(full_image_path, thumb_path)
images.append((full_image_path, thumb_path))

if not dryrun:
create_html(directory, images)
else:
for img, thumb in images:
print(f'Will process image: {img}')
print(f'Will create thumbnail: {thumb}')

def walk_directory(directory, recursive, dryrun):
"""Walks through the directory and processes each directory found."""
if recursive:
for root, dirs, files in os.walk(directory):
process_directory(root, recursive, dryrun)
else:
process_directory(directory, recursive, dryrun)

def main():
parser = argparse.ArgumentParser(description='Generate a simple image gallery using FFmpeg, optionally recursively.')
parser.add_argument('directory', type=str, help='Directory containing images to process.')
parser.add_argument('-r', '--recursive', action='store_true', help='Process images recursively in subdirectories.')
parser.add_argument('--dryrun', action='store_true', help='Output the processing steps without creating files.')

args = parser.parse_args()
walk_directory(args.directory, args.recursive, args.dryrun)

if __name__ == "__main__":
main()
Binary file added docs/_medias/laboratoires.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/_medias/portes-ouvertes-2024/equipement/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Photo Album</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery.js/dist/css/lightgallery.min.css" />
</head>
<body>
<div id="lightgallery">

<a href="album-11.jpg">
<img src="thumb-375-album-11.jpg" alt="Thumbnail of album-11.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-13.jpg">
<img src="thumb-375-album-13.jpg" alt="Thumbnail of album-13.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-12.jpg">
<img src="thumb-375-album-12.jpg" alt="Thumbnail of album-12.jpg" style="max-width:100%;height:auto;">
</a>

</div>
<script src="https://cdn.jsdelivr.net/npm/lightgallery.js/dist/js/lightgallery.min.js"></script>
<script>
lightGallery(document.getElementById('lightgallery'), {
selector: 'a'
});
</script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/_medias/portes-ouvertes-2024/esprit/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Photo Album</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery.js/dist/css/lightgallery.min.css" />
</head>
<body>
<div id="lightgallery">

<a href="1_album-2.jpg">
<img src="thumb-375-1_album-2.jpg" alt="Thumbnail of 1_album-2.jpg" style="max-width:100%;height:auto;">
</a>


<a href="2_album-5.jpg">
<img src="thumb-375-2_album-5.jpg" alt="Thumbnail of 2_album-5.jpg" style="max-width:100%;height:auto;">
</a>


<a href="3_album-4.jpg">
<img src="thumb-375-3_album-4.jpg" alt="Thumbnail of 3_album-4.jpg" style="max-width:100%;height:auto;">
</a>

</div>
<script src="https://cdn.jsdelivr.net/npm/lightgallery.js/dist/js/lightgallery.min.js"></script>
<script>
lightGallery(document.getElementById('lightgallery'), {
selector: 'a'
});
</script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/_medias/portes-ouvertes-2024/pour_qui/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Photo Album</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery.js/dist/css/lightgallery.min.css" />
</head>
<body>
<div id="lightgallery">

<a href="1_album-3.jpg">
<img src="thumb-375-1_album-3.jpg" alt="Thumbnail of 1_album-3.jpg" style="max-width:100%;height:auto;">
</a>


<a href="2_album-15.jpg">
<img src="thumb-375-2_album-15.jpg" alt="Thumbnail of 2_album-15.jpg" style="max-width:100%;height:auto;">
</a>


<a href="3_album-6.jpg">
<img src="thumb-375-3_album-6.jpg" alt="Thumbnail of 3_album-6.jpg" style="max-width:100%;height:auto;">
</a>

</div>
<script src="https://cdn.jsdelivr.net/npm/lightgallery.js/dist/js/lightgallery.min.js"></script>
<script>
lightGallery(document.getElementById('lightgallery'), {
selector: 'a'
});
</script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 99 additions & 0 deletions docs/_medias/portes-ouvertes-2024/source/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Photo Album</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery.js/dist/css/lightgallery.min.css" />
</head>
<body>
<div id="lightgallery">

<a href="album-9.jpg">
<img src="thumb-375-album-9.jpg" alt="Thumbnail of album-9.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-8.jpg">
<img src="thumb-375-album-8.jpg" alt="Thumbnail of album-8.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-16.jpg">
<img src="thumb-375-album-16.jpg" alt="Thumbnail of album-16.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-17.jpg">
<img src="thumb-375-album-17.jpg" alt="Thumbnail of album-17.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-15.jpg">
<img src="thumb-375-album-15.jpg" alt="Thumbnail of album-15.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-14.jpg">
<img src="thumb-375-album-14.jpg" alt="Thumbnail of album-14.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-11.jpg">
<img src="thumb-375-album-11.jpg" alt="Thumbnail of album-11.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-13.jpg">
<img src="thumb-375-album-13.jpg" alt="Thumbnail of album-13.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-12.jpg">
<img src="thumb-375-album-12.jpg" alt="Thumbnail of album-12.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-5.jpg">
<img src="thumb-375-album-5.jpg" alt="Thumbnail of album-5.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-4.jpg">
<img src="thumb-375-album-4.jpg" alt="Thumbnail of album-4.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-6.jpg">
<img src="thumb-375-album-6.jpg" alt="Thumbnail of album-6.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-7.jpg">
<img src="thumb-375-album-7.jpg" alt="Thumbnail of album-7.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-3.jpg">
<img src="thumb-375-album-3.jpg" alt="Thumbnail of album-3.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-2.jpg">
<img src="thumb-375-album-2.jpg" alt="Thumbnail of album-2.jpg" style="max-width:100%;height:auto;">
</a>


<a href="album-1.jpg">
<img src="thumb-375-album-1.jpg" alt="Thumbnail of album-1.jpg" style="max-width:100%;height:auto;">
</a>

</div>
<script src="https://cdn.jsdelivr.net/npm/lightgallery.js/dist/js/lightgallery.min.js"></script>
<script>
lightGallery(document.getElementById('lightgallery'), {
selector: 'a'
});
</script>
</body>
</html>
24 changes: 24 additions & 0 deletions docs/_medias/portes-ouvertes-2024/source/vertical/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Photo Album</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery.js/dist/css/lightgallery.min.css" />
</head>
<body>
<div id="lightgallery">

<a href="album-10.jpg">
<img src="thumb-375-album-10.jpg" alt="Thumbnail of album-10.jpg" style="max-width:100%;height:auto;">
</a>

</div>
<script src="https://cdn.jsdelivr.net/npm/lightgallery.js/dist/js/lightgallery.min.js"></script>
<script>
lightGallery(document.getElementById('lightgallery'), {
selector: 'a'
});
</script>
</body>
</html>
Loading

0 comments on commit 69ff749

Please sign in to comment.