-
Notifications
You must be signed in to change notification settings - Fork 184
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
EXIF support #499
Draft
skybldev
wants to merge
18
commits into
rr-:master
Choose a base branch
from
skybldev:upstream-exif-pr
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
EXIF support #499
Conversation
This file contains 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
- [server] created basic utility for resolving date taken @ `func/metadata.py` - [server] utilize `func/metadata.py` in `func/posts.py` - [server] created Alembic migration that adds `date_taken` column to `post` - [server] updated `model/post.py:Post` to have new column
- [client] added `date-fns` as dependency (it's much cleaner to format dates this way) - [client] added basic sidebar stuff in `html/post_readonly_sidebar.tpl` - [client] updated `js/models/post.js` to reflect changes - [client] added `formatUserFriendlyTime()` in `js/util/misc.js` - [client] added `makeUserFriendlyTime()` in `js/util/views.js` in conjunction with it - [misc] ran post-commit; previous commits did not
- [server] added date taken detection for videos in `func/metadata.py` using subprocess and ffmpeg
- [client] only show date taken section on "image" or "video" post type, since only they can possess date taken metadata (`client/html/post_readonly_sidebar.tpl`)
- [server] attempt to use DateTimeOriginal in `func/metadata.py` to resolve date taken (compatibility issue originally found in photo taken on LG Optimus L90)
- [overview] implemented filtering and sorting by date taken, optionally with null. - [server] added `SORT_DESC_NULL_LAST` search token in `search/tokens.py`, `search/base_search_config.py` - [server] implemented `SORT_DESC_NULL_LAST` functionality in `search/executor.py` - [server] added date taken search aliases in `search/configs/post_search_config.py` - [server] added `NullCriterion` in `search/criteria.py`; it's literally null - [server] implemented filtering by null for date criterion in `search/configs/util.py` - [server] aliased `NullCriterion` to "null", "none", "unknown", or "?" in `search/parser.py` - [server][minor] added "posted" and "edited" aliases to creation_date and last_edit_date
- [server] wrapped exif image reading in a try..except, since it can fail for some images. Also added a logger message to make it easier to debug in the future, to fix compatibility issues and make debugging easier
- [overview] add camera attribute to posts. parsing is done in `func/metadata.py` and takes any of the available tags corresponding to "make" and "model" properties and concatenates them into a string - [server] improved `func/metadata.py`: - added camera resolve functions for photos and videos - moved ffmpeg subprocess and exif image opening to separate function - optionally reuse existing collection of extracted tags in any of the functions - iterative approach to checking for tags' existence as opposed to imperative - (somewhat) better error handling - [server] created alembic migration in `adb2acef2492_add_camera.py` - not only adds columns, but also scans files and updates their camera string - [server] added camera attribute functionality and improved error handling in `func/posts.py` - [server] add camera attribute to `model/post.py`
- [client] also revised date-taken section
- [overview] this commit fixes an issue where some images would be rendered stretched in a browser due to a swapped width and height because of intentional EXIF orientation mechanics. - [server] `func/metadata.py`: added function to resolve the image's dimensions after taking the EXIF orientation into consideration. normally, this would only be done on the client side; however, since the server takes those values into consideration for its own operations, it could also be considered a "client". for example, thumbnail generation also depends on the post's dimensions. - [server] `func/posts.py`: refactored `update_post_content`. `func/images.py` will no longer be used to determine the dimensions of a file since `func/metadata.py` is now responsible for that. - [server] refactored `func/metadata.py` - [TODO] create migration to correct post dimensions - [TODO] merge `func/metadata.py` with `func/images.py` and refactor - [TODO] fix thumbnail generation
[server] `func/images.py`: - `Image` is now `Image` and `Video`, with their own post-type-specific operations; some of them from `func/metadata.py`. as a result, post type checking will need to be done outside of the classes - apply orientation to [fixed] thumbnail generation and image conversion - moved `_execute` to a global function; it now purely uses streams instead of tempfiles - `func/images.py::Video::to_mp4()` removed code that downscales resolution to an even number since ffmpeg does it automatically - use fstrings instead of .format and % in certain places - DEPRECATING FLASH FILES; there really is no place for them in a photo-oriented booru such as this. will slowly phase it out overtime. added an error message for it - changed EXIF orientation reference URL [server] `func/posts.py`: - `update_post_content()`: updated to use `func/images.py`'s new features
- [server/migration] merge add_camera -> add_date_taken - [server/migration] rename add_date_taken -> add_date_taken_and_camera - [server/migration] add_date_taken_and_camera: iterate through posts in db instead of files - [server] changed Post.camera from sa.Text -> sa.UnicodeText - [server] improved stability of `func/images.py` - [todo] will add migration that fixes image dimensions and regenerates thumbnails later
- [repo] updated `README.md` and `doc/INSTALL.md` - [build] configure `server` and `client` to build locally - [dist] updated `doc/example.env` to unique build info
also included immich link
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR aims to cherry-pick and merge EXIF-related features into the project. Addresses #470 and #311.
Proposed Features
(mostly copypasted from my fork's README)
Notices