Skip to content
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

When avatar/header are GIF, generate static versions #1428

Merged
merged 3 commits into from
Apr 10, 2017

Conversation

Gargron
Copy link
Member

@Gargron Gargron commented Apr 10, 2017

  • Account API returns "avatar"/"avatar_static", "header"/"header_static"
  • Static version is the same as original for other cases
  • Web UI de-animates avatars in toots, lists of users (play on hover)

Fix #441, fix #596, prerequisite for #1064

Account API returns "avatar"/"avatar_static", "header"/"header_static"
Static version is the same as original for other cases
Web UI de-animates avatars in toots, lists of users

Fix #441, fix #596, prerequisite for #1064
validates_attachment_content_type :avatar, content_type: IMAGE_MIME_TYPES
validates_attachment_size :avatar, less_than: 2.megabytes

# Header upload
has_attached_file :header, styles: { original: '700x335#' }, convert_options: { all: '-quality 80 -strip' }
has_attached_file :header, styles: ->(f) { header_styles(f) }, convert_options: { all: '-quality 80 -strip' }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can change this to

has_attached_file :header, styles: method(:header_styles), convert_options: { all: '-quality 80 -strip' }

if you want.

@krainboltgreene
Copy link
Member

What's up with these test failures?

@Gargron
Copy link
Member Author

Gargron commented Apr 10, 2017

Oh, apparently we have some JS tests someone wrote a long time ago that are now failing because I changed the <Avatar> component

@Gargron Gargron merged commit 12f72e1 into master Apr 10, 2017
@Gargron Gargron deleted the feature-static-avatars branch April 10, 2017 22:39
},

getDefaultProps () {
return {
animated: true
animate: false
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unfamiliar with React - is there an easy way for a user script to change this kind of thing?

Someone (not me) may want animated avatars even in non-hover. Would be nice to fetch that kind of thing from localStorage (or even the database, I guess.)

@Fastidious
Copy link

If this PR broke notifications (#1491), how in the world did the checks passed? Just curious.

@Gargron
Copy link
Member Author

Gargron commented Apr 11, 2017

@Fastidious We don't have automated tests for the React.js front-end - only for the API and server in general. So front-end testing is done manually, and things can slip by.

Nyoho referenced this pull request in Nyoho/mathtodon Apr 25, 2017
* When avatar/header are GIF, generate static versions.
Account API returns "avatar"/"avatar_static", "header"/"header_static"
Static version is the same as original for other cases
Web UI de-animates avatars in toots, lists of users

Fix #441, fix #596, prerequisite for #1064

* Fix JS test

* Add rake task to generate static avatars/headers from GIF ones, add test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Toggle gif avatar autoplay auto-playing gifs, gif avatars, and hover-to-play
4 participants