mastodon/app/models/concerns
Eugen Rochko a7171af0a3
Fix avatar and header issues by using custom geometry detector (#6515)
* Fix avatar and header issues by using custom geometry detector

Revert a part of #6508. The file passed to dynamic styles method
was not actually a file, but an instance of Paperclip::Attachment,
which broke all styles by always returning {} from the method.

One problem with GIF avatars was that Paperclip::GeometryDetector
reported wrong dimensions for them, e.g. 120x120 GIF avatar would
for some reason be detected as 120x53. By writing our own geometry
parser, we can use FastImage, which also happens to be faster than
ImageMagick, to detect image dimensions, which are also correct.

Unfortunately, this PR does not implement skipping a `convert`
entirely if the dimensions are already correct, as I found no easy
way to write that behaviour into Paperclip without rewriting the
Paperclip::Thumbnail class.

* Only invoke convert if dimension or format needs to be changed
2018-02-21 03:40:12 +01:00
..
account_avatar.rb Fix avatar and header issues by using custom geometry detector (#6515) 2018-02-21 03:40:12 +01:00
account_finder_concern.rb Fix AccountFinderConcern::AccountFinder#with_usernames (#5722) 2017-11-16 12:13:03 +01:00
account_header.rb Fix avatar and header issues by using custom geometry detector (#6515) 2018-02-21 03:40:12 +01:00
account_interactions.rb Allow hiding of reblogs from followed users (#5762) 2017-11-28 15:00:35 +01:00
attachmentable.rb Fixes unknown mime type (#2822) 2017-05-05 21:32:14 +02:00
cacheable.rb Fix #248 - Reload all accounts when fetching from cache 2016-12-03 18:21:26 +01:00
omniauthable.rb CAS + SAML authentication feature (#6425) 2018-02-04 05:42:13 +01:00
paginable.rb Improve RuboCop rules (compatibility to Code Climate) (#3636) 2017-06-08 13:24:28 +02:00
relationship_cacheable.rb Cache relationships in API (#6482) 2018-02-18 03:14:46 +01:00
remotable.rb Fix #4908 - Do not keep remote file names, generate random (#4934) 2017-09-14 16:41:59 +02:00
status_threading_concern.rb Introduce StatusThreadingConcern (#3490) 2017-06-05 16:07:44 +02:00
streamable.rb Define instance method outside #included (#3128) 2017-05-19 11:41:45 +02:00