Commit Graph

45 Commits (a855956185630742ad670f971337a3ff76fd8b32)

Author SHA1 Message Date
Akihiko Odaki (@fn_aki@pawoo.net) a37cf9548c Explicitly require MIME::Types (#4083) 8 years ago
Eugen Rochko 85d5518b6b Fix #3675 - Adjust quality settings of converted GIFs to reduce filesize (#3723) 8 years ago
Matt Jankowski ec34ec63b1 Specs for cleanup workers (#3235)
* Add spec files for feed and media cleanup workers

* Add coverage for feed and media cleanup schedulers

* Clean up feed and media cleanup workers
8 years ago
Yamagishi Kazutoshi 79ef8b3653 Fetch remote image using http.rb (#3114) 8 years ago
alpaca-tc 09ec6e504b Order by symbol value (#3077) 8 years ago
alpaca-tc ee3e0a93f4 Fixes unknown mime type (#2822) 8 years ago
yhirano 298796cc7b annotate models (#2697)
* add annotate to Gemfile

* rails g annotate:install

* configure annotate_models

* add schema info to models

* fix rubocop to add frozen_string_literal
8 years ago
Patrick Figel 8ac7fca5d0 Set correct attachment type for rejected media (#2599)
In #2110, a new attachment type "unknown" was introduced for
attachments that were rejected due to a domain being blocked using
reject_media. However, the "type" field was never set to "unknown"
because a default value of "0" (image) is set for that column,
causing the `type.blank?` expression to always equal false.

This version uses type_changed? instead, causing the type to be set
to "unknown" unless a type has been explicitly set. This introduces
a small change in behaviour causing the type to be set to unknown
before paperclip calls `before_post_process`. Presumably this
behaviour is more appropriate than the current one because the
attachment type has not been determined by that point.

Included are new tests for `ProcessFeedService` and
`UpdateRemoteProfileService` which now check that remote media is
downloaded for non-blocked domains and is rejected for others.
8 years ago
Francis Chong 193dddb433 Add media dimensions (#2448)
* Fixes #1985

- add migration AddMediaAttachmentMeta, which add meta field to media_attachments
- before saving attachment, set file meta if needed
- add meta in api

* add spec

* align the “size” format for image and video

* fix code climate

* fixes media_attachment_spec.rb
8 years ago
Eugen 17c591ffba Punycode URI normalization (#2370)
* Fix #2119 - Whenever about to send a HTTP request, normalize the URI

* Add test for IDN request in FetchLinkCardService

* Perform IDN normalization on domains before they are stored in the DB
8 years ago
Eugen 2e4afccd9d Fix #2108 - Fix gif uploads (#2171)
* Fix #2108 - Fix gif uploads
Add specs for media attachment gifv conversion

* Add ffmpeg to travis

* Make travis install ffmpeg, not libav

* Switch travis to trusty
8 years ago
Eugen bfbc2ca0d8 Attachment list for uncached attachments (#2110)
* For undownloaded attachments, set type :unknown, display them as a list in the web UI

* Fix case when attachment type is set explicitly
8 years ago
Eugen e09ab2c0bd Fix #1642, fix #1912 - Dictate content-type file extension (#2078)
* Fix #1642, fix #1912 - Previous change (#1718) did not modify how original file was saved on upload

* Fix for when file is missing
8 years ago
Matt Jankowski cc1361c149 Media controller specs (#2022)
* Add spec for media controller

* Add MediaAttachment.attached scope

* Simplify methods in media controller
8 years ago
Eugen Rochko d6cb4bbe99 Performance improvement for profiles 8 years ago
Eugen Rochko 03a857f59a Use more widely supported MP4 format for gifv's 8 years ago
Eugen Rochko 8d93f0ca56 Increase max bitrate of converted webms, slightly optimized counter queries
(Because postgres can tell that count(*) needs no extra checks, but
counting a specific column requires them)
8 years ago
Eugen Rochko 6382ef2bc6 Add vsync -cfr option when converting gif to webm 8 years ago
Eugen Rochko 79b08c5f0a Higher quality webms? Might improve conversation of some types of gifs 8 years ago
Eugen Rochko 85fce04d1b Detect videos with no sound, handle them like gifv 8 years ago
Eugen Rochko caf5b8e975 Fix #431 - convert gif to webm during upload. Web UI treats them like it did
before. In the API, attachments now can be either image, video or gifv. Gifv
is to be treated like images in terms of behaviour, but are videos by file
type.
8 years ago
Eugen Rochko 450ad43180 Do not run FetchLinkCardService on local URLs, increase file size limit to 8MB,
fix ProcessFeedService pushing status into distribution if called a second time
while the first is still running (i.e. when a PuSH comes after a Salmon slap),
fix not running escape on spoiler text before emojify
8 years ago
Eugen Rochko 7b9f8766e8 Fix #416 - Generate random unique 14-byte (19 characters) shortcodes
for local attachments, use them in URLs. Check status privacy
before redirecting to actual file.
8 years ago
Eugen Rochko aed25932b5 Add OEmbed iframe HTML, convert emojis on public pages, increase size of attachment thumbnails 8 years ago
Eugen Rochko 06dd359239 Downsize attachment previews, but improve quality from 80 to 90 8 years ago
Eugen Rochko 64d109dc0e Downsize originals in media attachments, small fixes 8 years ago
Eugen Rochko 80c44ed9c1 Do not autoplay videos, display play button instead. Use expiring links when using S3. Do not keep originals
for avatars/headers, resize avatars down to 120x120 instead of 300x300. Set cache headers on S3 stuff, also
make it private (aka only accessible via expiring links to prevent hotlinking)
8 years ago
Eugen Rochko f860d15d39 Fix order of attachments (see #269) 8 years ago
Eugen Rochko e4f56fa942 Don't create attachments if remote file cannot be fetched 8 years ago
Eugen Rochko fdc17bea58 Fix rubocop issues, introduce usage of frozen literal to improve performance 8 years ago
Eugen Rochko 57304ac375 Catch 404 errors when downloading remote media, add screenshot to landing page 8 years ago
Eugen Rochko abb8f5837e Fix public channel 8 years ago
Eugen Rochko a9e40a3d80 Adding OAuth access scopes, fixing OAuth authorization UI, adding rate limiting
to the API
8 years ago
Eugen Rochko 1d2175f73c Do not force-transcode uploaded videos to webm (leave mp4 as-is) 8 years ago
Eugen Rochko 2ddf4e09f9 Change how convert options are escaped 8 years ago
Eugen Rochko cdc49c6b4b Allow mp4 uploads, convert to WebM 8 years ago
Yann Vaillant 35de03fbe3
Strip exif data from uploaded images
Using `-strip` cli options from ImageMagick

http://www.imagemagick.org/script/command-line-options.php#strip

fix #85
8 years ago
Eugen Rochko 927333f4f8 Improve code style 8 years ago
Eugen Rochko bd5ad304ba Adding media controller, 1 webm/compose form allowed, previews generated 8 years ago
Eugen Rochko ce29624c6d Fixing image upload limits, allowing webm, merge/unmerge events trigger
timeline reload in UI, other small fixes
8 years ago
Eugen Rochko d6b3113304 Validates local username, max sizes for uploads. Fixes #32 8 years ago
Eugen Rochko 14fb0ab4a2 Improve JSON output for media attachments, generate :small preview for them 8 years ago
Eugen Rochko ed94e998bc Fix for media attachments remote URL download 8 years ago
Eugen Rochko eec0dc46a6 PostStatusService can attach media to status, ProcessFeedService likewise 8 years ago
Eugen Rochko ae1fac0062 Add API to upload media attachments 8 years ago