Skip to content

Commit

Permalink
changing supported image formats
Browse files Browse the repository at this point in the history
  • Loading branch information
bpatrik committed Jan 12, 2019
1 parent 9ea2f16 commit ea8b780
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ sqlite.db
dist/
release/
out-tsc/
ffmpeg/
locale.source.xlf
package-lock.json
test.*
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ apt-get install build-essential libkrb5-dev gcc g++

## 3. Feature list

* supported formats:
* images: **jpg, jpeg, jpe, webp, png, gif, svg**
* videos: **mp4, ogg, ogv, webm**
* **Rendering directories as it is**
* Listing subdirectories recursively
* Listing photos in a nice grid layout
Expand Down
5 changes: 1 addition & 4 deletions backend/model/threading/DiskMangerWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ export class DiskMangerWorker {

private static readonly SupportedEXT = {
photo: [
'.bmp',
'.gif',
'.jpeg', '.jpg', '.jpe',
'.png',
'.tiff', '.tif',
'.webp',
'.ico',
'.tga'
'.svg'
],
video: [
'.mp4',
Expand Down
6 changes: 3 additions & 3 deletions backend/routes/GalleryRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class GalleryRouter {


private static addGetImage(app: Express) {
app.get(['/api/gallery/content/:mediaPath(*\.(jpg|bmp|png|gif|jpeg))'],
app.get(['/api/gallery/content/:mediaPath(*\.(jpg|jpeg|jpe|webp|png|gif|svg))'],
AuthenticationMWs.authenticate,
// TODO: authorize path
GalleryMWs.loadFile,
Expand Down Expand Up @@ -73,7 +73,7 @@ export class GalleryRouter {
}

private static addGetImageThumbnail(app: Express) {
app.get('/api/gallery/content/:mediaPath(*\.(jpg|bmp|png|gif|jpeg))/thumbnail/:size?',
app.get('/api/gallery/content/:mediaPath(*\.(jpg|jpeg|jpe|webp|png|gif|svg))/thumbnail/:size?',
AuthenticationMWs.authenticate,
// TODO: authorize path
GalleryMWs.loadFile,
Expand All @@ -93,7 +93,7 @@ export class GalleryRouter {
}

private static addGetImageIcon(app: Express) {
app.get('/api/gallery/content/:mediaPath(*\.(jpg|bmp|png|gif|jpeg))/icon',
app.get('/api/gallery/content/:mediaPath(*\.(jpg|jpeg|jpe|webp|png|gif|svg))/icon',
AuthenticationMWs.authenticate,
// TODO: authorize path
GalleryMWs.loadFile,
Expand Down
30 changes: 27 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-131201011-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}

function gtag() {
dataLayer.push(arguments);
}

gtag('js', new Date());

gtag('config', 'UA-131201011-1');
</script>
<!-- Place this tag in your head or just before your close body tag. -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
</head>

<body class="text-center">
Expand All @@ -30,8 +36,10 @@
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column ">
<header class="masthead">
<div class="inner">
<h3 class="masthead-brand"><img src="assets/icon_inv.png" width="30" height="30" class="d-inline-block align-top"
alt=""> PiGallery 2</h3>
<h3 class="masthead-brand">
<img src="assets/icon_inv.png" width="30" height="30" class="d-inline-block align-top"
alt=""> PiGallery 2
</h3>
<nav class="nav nav-masthead justify-content-center">
<a class="nav-link active" href="index.html">Features</a>
<a class="nav-link" href="https://github.com/bpatrik/pigallery2">Install</a>
Expand All @@ -46,7 +54,17 @@ <h3>
PiGallery 2 is a self-hosted directory-first photo gallery website.
</h3>
<a href="https://pigallery2.herokuapp.com/">Try our live demo! <span class="small">(First load may take up 30s, while the server boots up)</span></a>

</div>

</div>
<div class="github-button-wrapper">
<!-- Place this tag where you want the button to render. -->
<a class="github-button" href="https://github.com/bpatrik/pigallery2" data-size="large" data-icon="octicon-star"
data-show-count="true" aria-label="Star bpatrik/pigallery2 on GitHub">Star</a>
<!-- Place this tag where you want the button to render. -->
<a class="github-button" href="https://github.com/bpatrik/pigallery2/fork" data-size="large" data-icon="octicon-repo-forked"
data-show-count="true" aria-label="Fork bpatrik/pigallery2 on GitHub">Fork</a>
</div>
<img class="banner-photo" src="assets/main_page.jpg" style="width: 100%">
<div class="row">
Expand Down Expand Up @@ -142,6 +160,12 @@ <h3>Random link</h3>
<h3 class="section-header">All features:</h3>
<hr/>
<ul class="text-left">
<li>supported formats:
<ul>
<li>images: <strong>jpg, jpeg, jpe, webp, png, gif, svg</strong></li>
<li>videos: <strong>mp4, ogg, ogv, webm</strong></li>
</ul>
</li>
<li><strong>Rendering directories as it is</strong>
<ul>
<li>Listing subdirectories recursively</li>
Expand Down
6 changes: 4 additions & 2 deletions docs/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ hr{
background: white;
margin-top: 0;
}

.github-button-wrapper{
margin-top: 10px;
float: right;
}
.banner-photo{
margin-top: 30px;
margin-bottom: 30px;
}

0 comments on commit ea8b780

Please sign in to comment.