Commit graph

1177 commits

Author SHA1 Message Date
skybldev
a4ea05a0e4 server: fix swapped dimensions on some images
- [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
2022-01-01 17:38:23 -05:00
skybldev
2c1e25c158 client: added features for camera
- [client] also revised date-taken section
2021-12-30 09:59:08 -05:00
skybldev
40331f2ba2 server: fixed tag typo in metadata.py 2021-12-03 00:02:36 -05:00
skybldev
efe217344d server: add post camera attr and functionality
- [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`
2021-12-02 21:27:26 -05:00
skybldev
a48c792322 server: catch failure to read image exif
- [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
2021-11-29 21:23:47 -05:00
skybldev
066993ee07 server: implemented filter/sort by date taken
- [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
2021-11-29 17:04:56 -05:00
skybldev
f73dd02c7d server: attempt to use DateTimeOriginal
- [server] attempt to use DateTimeOriginal in `func/metadata.py` to
  resolve date taken (compatibility issue originally found in photo
  taken on LG Optimus L90)
2021-11-29 13:41:03 -05:00
skybldev
4fe65bebe7 client: format post_readonly_sidebar.tpl 2021-11-29 13:38:35 -05:00
skybldev
289e49953b client: only show date taken on relevant post type
- [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`)
2021-11-28 23:45:44 -05:00
skybldev
1bcf7e73ad server: added date taken detection for videos
- [server] added date taken detection for videos in `func/metadata.py`
  using subprocess and ffmpeg
2021-11-28 23:18:43 -05:00
skybldev
6be74d6cbd client: added basic date-taken functionality
- [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
2021-11-28 12:18:08 -05:00
skybldev
f9af3afdf8 server: added basic date taken functionality
- [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
2021-11-28 12:04:09 -05:00
skybldev
19b1ec1496 server/deps: add exif as dependency 2021-11-28 12:00:07 -05:00
skybldev
a5fbaae4b3 updated build files
-  is no longer valid as per https://github.com/npm/cli/wiki/Support-Policy#long-term-support-lts
- updated pre-commit config to use latest repos
2021-11-28 10:07:04 -05:00
Shyam Sunder
d699979d35 client+server: cleanup GitHub actions workflow names
Also run unit test action on push
2021-09-23 12:49:32 -04:00
Shyam Sunder
d083084407 server/tests: use transactional db for faster unit tests
* `test_modify_saves_non_empty_diffs` needs non-transactional
  db, so moved to seperate file
* Replaced incompatable usage of `db.session.rollback()`
  with parametrerized function calls
* xfail conditionals for search removed, as we can no longer
  get current driver with binds
* Also remove usage of deprecated `pytest.yield_fixture`
2021-09-23 12:24:56 -04:00
Shyam Sunder
ad9d3599bc server/net: return more useful error messages 2021-09-22 22:08:07 -04:00
Shyam Sunder
c3b81371d8 client+server/docker: fix ARM build platform issue 2021-09-19 12:03:32 -04:00
Shyam Sunder
c64983002e client+server/docker: build ARM images for Docker Hub 2021-09-19 11:39:40 -04:00
Shyam Sunder
4f57f49ebe client+server: migrate to GitHub actions 2021-09-19 11:01:47 -04:00
Shyam Sunder
f58079e12e client/upload: force enable 'upload anonymously' for anon users
Fixes #425
2021-09-13 14:24:07 -04:00
Shyam Sunder
be0c867d25 client/upload: add QoL features for bulk uploads
* Continue uploading remaining posts in an upload list even
when one fails

* Allow option to continue uploading even when similar posts are found

Closes #400
2021-09-13 13:28:34 -04:00
Shyam Sunder
f5338ca508 Fix style 2021-09-13 13:26:57 -04:00
Shyam Sunder
e4a253fd25 client+server: fixed style errors 2021-09-13 13:25:37 -04:00
Ben Klein
414106a477
client/css: dark mode contrast fixes (#388)
* client/css: fix dark mode pagination header bg

* client/css/post-main-view: dark uses box-shadow

* client/css: animate compact-tags updates

* client: tag input animations fixed

* client/css: darken darktheme success bg

* client/css: dark tag background colors

* client/css/tag-input-control: dark suggest header

* client/css: darktheme mobile site-name in nav
2021-07-05 13:24:04 +02:00
neobooru
fa4997fbb9 server: fix issue where no video files could be uploaded 2021-06-07 00:37:30 +02:00
neobooru
3cabe790a7 client/build: update builder image Node.js version to LTS
Fixes #412
The older stylus version throws some warnings in Node.js LTS. The new one doesn't.
2021-06-04 17:12:21 +02:00
neobooru
f497dca92f server: update docker image base to alpine:3.13
We do this so that we don't have to use 'edge' packages, which aren't (always) ABI compatible
2021-06-01 18:20:51 +02:00
neobooru
5ea9e27e48 Merge branch 'avif'
Merges PR #399
2021-06-01 16:57:29 +02:00
dependabot[bot]
027e83a7e7 build(deps-dev): bump underscore from 1.9.1 to 1.12.1 in /client
Bumps [underscore](https://github.com/jashkenas/underscore) from 1.9.1 to 1.12.1.
- [Release notes](https://github.com/jashkenas/underscore/releases)
- [Commits](https://github.com/jashkenas/underscore/compare/1.9.1...1.12.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-14 19:10:19 +00:00
neobooru
dc46ed7929
Merge pull request #404 from Ruin0x11/bmp-support
Support BMP format uploads
2021-05-14 14:43:37 +00:00
Ruin0x11
a6886ddb89
Improve compilation speed for development builds (#402)
* Improve incremental build times
* Live-reloading in development mode
2021-05-14 14:39:40 +00:00
Ruin0x11
a2b68925ac Support BMP format uploads 2021-05-09 01:29:36 -07:00
Ruin0x11
516b3a51a7 Option to always upload similar posts instead of confirming every time 2021-05-07 23:24:38 -07:00
Ruin0x11
f4ca435657 If one post fails to upload, don't prevent the rest from uploading 2021-05-07 23:02:59 -07:00
Ruin0x11
2949431d9a Add libheif/libavif to Dockerfile dependencies 2021-05-07 22:25:59 -07:00
Ruin0x11
1be2d95bb1 Add HEIF formats to allowed extensions text 2021-05-07 21:37:21 -07:00
Ruin0x11
7e27df835c Add AVIF/HEIF/HEIC upload support 2021-05-07 21:20:42 -07:00
Ruin0x11
169593ea36 Add AVIF/HEIC detection
ffmpeg doesn't support HEIC decoding yet...
2021-05-07 14:36:58 -07:00
Shyam Sunder
ca77149597 client: escape periods in tag names
Merges PR #390
2021-04-22 13:43:21 -04:00
nothink (Satoshi Ishii)
535aa0d8fe
Suppressed the use of SQLAlchemy 1.4 2021-04-20 22:52:29 +09:00
neobooru
4ce72fa712 client/tags: escape dots in search term and don't allow '.' and '..' as tags 2021-04-12 10:42:58 +02:00
neobooru
7c37734fec client: rename escapeColons to escapeTagName and also escape dots 2021-04-10 15:10:39 +02:00
Shyam Sunder
545b5828b5 server/func/mime: support ftypM4V file signature 2021-03-30 09:52:49 -04:00
dependabot[bot]
7b54551b8e
build(deps): bump elliptic from 6.5.3 to 6.5.4 in /client
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-08 16:49:06 +00:00
Shyam Sunder
8fa84abdc4 client/posts: provide link for danbooru image search 2021-01-08 11:03:38 -05:00
Shyam Sunder
b9451bef4a client/posts/edit: maintain post editing state for arrow key nav
Fixes #373
2021-01-08 10:21:56 -05:00
Shyam Sunder
2b9a4ab786 server/net: prevent youtube-dl errors when downloading image links 2021-01-07 08:28:22 -05:00
Shyam Sunder
c732e62844 server/net: fix error handling 2021-01-06 10:37:59 -05:00
Shyam Sunder
c7461c7f65 server/net: improve youtube-dl functionality, enforce size limits 2021-01-05 17:05:57 -05:00