-
Notifications
You must be signed in to change notification settings - Fork 30
Gallery 2.1.1 #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Gallery 2.1.1 #59
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7ba6e53
Added mp3 support
RebeccaSyria 769caff
Added wav support, added default thumbnail
RebeccaSyria fefa759
Merge pull request #57 from RebeccaSyria/develop
devinmatte 26662f4
Remove hidden files from directory thumbnails (#56)
owencmiller 00d1aa7
Various lockdown fixes (#58)
RamZallan aa63f2e
Version bump
RamZallan 00b5ca5
Remove old password from localconfig
RamZallan 773b30f
Update local development instructions and gitignore
RamZallan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import os | ||
| from wand.image import Image | ||
|
|
||
| from gallery.file_modules import FileModule | ||
| from gallery.util import hash_file | ||
|
|
||
| class MP3File(FileModule): | ||
| def __init__(self, file_path, dir_path): | ||
| FileModule.__init__(self, file_path, dir_path) | ||
| self.mime_type = "audio/mpeg" | ||
|
|
||
| self.generate_thumbnail() | ||
|
|
||
| def generate_thumbnail(self): | ||
| self.thumbnail_uuid = hash_file(self.file_path) + ".jpg" | ||
|
|
||
| with Image(filename="thumbnails/reedphoto.jpg") as bg: | ||
| bg.save(filename=os.path.join(self.dir_path, self.thumbnail_uuid)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import os | ||
| from wand.image import Image | ||
|
|
||
| from gallery.file_modules import FileModule | ||
| from gallery.util import hash_file | ||
|
|
||
| class WAVFile(FileModule): | ||
| def __init__(self, file_path, dir_path): | ||
| FileModule.__init__(self, file_path, dir_path) | ||
| self.mime_type = "audio/x-wav" | ||
|
|
||
| self.generate_thumbnail() | ||
|
|
||
| def generate_thumbnail(self): | ||
| self.thumbnail_uuid = hash_file(self.file_path) + ".jpg" | ||
|
|
||
| with Image(filename="thumbnails/reedphoto.jpg") as bg: | ||
| bg.save(filename=os.path.join(self.dir_path, self.thumbnail_uuid)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import os | ||
|
|
||
| # Flask config | ||
| DEBUG=False | ||
| IP=os.environ.get('GALLERY_IP', 'localhost') | ||
| PORT=os.environ.get('GALLERY_PORT', '6969') | ||
| SERVER_NAME = os.environ.get('GALLERY_SERVER_NAME', 'localhost:6969') | ||
| SECRET_KEY = os.environ.get('GALLERY_SECRET_KEY', '') | ||
|
|
||
| # LDAP config | ||
| LDAP_BIND_DN=os.environ.get('GALLERY_LDAP_BIND_DN', '') | ||
| LDAP_BIND_PW=os.environ.get('GALLERY_LDAP_BIND_PW', '') | ||
|
|
||
| # OpenID Connect SSO config | ||
| OIDC_ISSUER = os.environ.get('GALLERY_OIDC_ISSUER', 'https://sso.csh.rit.edu/auth/realms/csh') | ||
| OIDC_CLIENT_ID = os.environ.get('GALLERY_OIDC_CLIENT_ID', 'gallery-dev') | ||
| OIDC_CLIENT_SECRET = os.environ.get('GALLERY_OIDC_CLIENT_SECRET', '') | ||
|
|
||
| SQLALCHEMY_DATABASE_URI = os.environ.get( | ||
| 'GALLERY_DATABASE_URI', | ||
| 'postgresql://DB_USERNAME:DB_PASSWORD@postgres.csh.rit.edu/gallery-dev') | ||
| SQLALCHEMY_TRACK_MODIFICATIONS = False | ||
|
|
||
| S3_URI = os.environ.get('GALLERY_S3_URI', 'https://s3.csh.rit.edu') | ||
| S3_ACCESS_ID = os.environ.get('GALLERY_S3_ACCESS_ID','') | ||
| S3_SECRET_KEY = os.environ.get('GALLERY_S3_SECRET_KEY','') | ||
| S3_BUCKET_ID = os.environ.get('GALLERY_S3_BUCKET_ID','gallery-dev') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.