Skip to content

Conversation

@armandfardeau
Copy link
Collaborator

🎩 What? Why?

Banner image were low quality because of improper resolution configuration: 1000px x 200px. Causing an unpleasant user experience on high resolution devices (retina screen).

New resolution setting is : 1200px x 600px.

This pull request add a new feature too : ✨ images compression ! ✨
Set on 60 % on banner image to increase performance.
Jpg can be compressed from 50% to 70% without any visual significant difference.

🤔 How to use it:
add process quality: 60 to your uploader
Example:

module Decidim
  # This class deals with uploading banner images to ParticipatoryProcesses.
  class BannerImageUploader < ImageUploader
    process resize_to_limit: [1200, 600]
    process quality: 60
  end
end

💯 How to update already existing images?
Open your rails console
rails c
paste the following :
Decidim::ParticipatoryProcess.find_each { |process| process.banner_image.recreate_versions! if process.banner_image? }

⚠️ Always backup before ! ⚠️

📌 Related Issues

📷 Screenshots (optional)

Before :
image

After :
image

After, with compression enabled :
image

👻 GIF

@juliesimon
Copy link

Seems like an awesome update for me @armandfardeau !!
I say yes :)

From a technical point of view, I'd rather have @moustachu's opinion before merging the PR

@armandfardeau
Copy link
Collaborator Author

What's really awesome is the ability to compress jpeg. That's mean better resolution at the same weight.

As a reward i suggest a stickers "#portdelaturballe" 😆

@armandfardeau armandfardeau merged commit 7d2cdf9 into 0.12-stable Aug 1, 2018
@ghost ghost removed the needs-review label Aug 1, 2018
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.

3 participants