Commit graph

25 commits

Author SHA1 Message Date
Nachtalb e010fe47cc
Respect metadata removal switch 2021-04-13 20:45:16 +02:00
Nachtalb 89390b3fc5
Ensure proper error handling when processing of file fails 2021-04-13 20:41:30 +02:00
Nachtalb c2c66031c0
Auto rotate images based on exif orientation
This makes sure that the orientation of the images work in all viewrs.
2021-04-13 18:24:33 +02:00
Nachtalb 3a6ac4e5ec
Support animated webp images
We need to remove the metadata without breaking the animation.
For that we use sharp which incooperates libvips (binaries for most common distros included).

This also decreases client side upload complexity as we remove the metadata on the serverside.

Sharp: https://sharp.pixelplumbing.com/
libvips: https://libvips.github.io/libvips/
2021-04-13 18:24:32 +02:00
Nachtalb 3a42b5385e
Support inline flac audio 2021-04-11 15:43:42 +02:00
Nachtalb 14d76f8023
Add proper filename to the content-disposition header
By default we take the slug given in the request, if this is not set we try to give a filename from known types.
If we still have no filename we fallback to the previous method of setting no filename.

If the filename is non ascii we will only create the encoded "filename*" and not the ascii only "filename". This is to prevent other applications to save a file like "?????.png" if the filename contains non ascii chars.

For the browsers nothing will really change comapred to the behaviour before this change as good fallbacks if no content-disposition filename is set. But that is not the case for all application, thus it makes sense to include the proper way to set the filename.
2021-04-11 15:41:21 +02:00
Pavel Djundik c89dcca449 Detect image/avif as an image 2020-08-23 12:51:52 +03:00
Pavel Djundik b1115475bf Fix upload tokens expiring while uploading
Fixes #3982
2020-07-15 12:29:02 +03:00
Pavel Djundik 487a438f02 Replace all uses of fs-extra with native methods 2020-03-22 20:42:16 +02:00
Pavel Djundik 63fd0def6c Improve wav audio file support 2020-02-26 10:07:40 +02:00
Pavel Djundik e0d5f4c2ff Change uuidv4 require 2020-02-24 15:35:15 +02:00
Pavel Djundik 87c9abe9da Change minimumBytes in file-type 2020-02-06 12:41:43 +02:00
Pavel Djundik 41e3762e57 Update file-type api usage 2020-01-08 16:11:30 +02:00
Pavel Djundik 6c57339668 Allow configure base url for uploads
Fixes #3484
2019-10-31 13:21:22 +02:00
Pavel Djundik 16d070c19e Update error messages for uploads 2019-08-25 20:14:34 +03:00
Pavel Djundik f84e4199e9 Re-implement file uploads with old-school forms
Co-Authored-By: Richard Lewis <richrd@users.noreply.github.com>
2019-03-18 10:28:18 +02:00
Pavel Djundik 3d82378cbd Fix incorrect 404 error for files with unknown file type 2019-01-31 10:12:50 +02:00
Jérémie Astori 3e623e8b77
Merge pull request #2939 from thelounge/renovate/file-type-10.x
Update dependency file-type to v10.7.0
2019-01-27 18:23:20 -05:00
Pavel Djundik 221b7145f1
Fix incorrect use of fs.stat 2019-01-19 12:00:09 +02:00
Pavel Djundik ab083f9eb6 Fix wav mime type in uploader 2018-12-19 17:20:47 +02:00
Pavel Djundik dd61e6e09a Use fileType.minimumBytes 2018-11-13 13:30:02 +02:00
Pavel Djundik 1d8a0e639f Encode uploaded file slugs 2018-10-14 00:23:41 +03:00
Pavel Djundik bec241e7fa Move correct file after upload, put file extension in slug 2018-09-05 10:08:46 +03:00
Pavel Djundik 8fa8526698 Only emit upload url to the client that uploaded the file
Fixes #2747
2018-09-04 12:08:30 +03:00
Pavel Djundik ce212e001c Add file uploading support
Co-Authored-By: Max Leiter <hello@maxleiter.com>
Co-Authored-By: Jérémie Astori <astorije@users.noreply.github.com>
2018-09-03 10:30:05 +03:00