-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fixes to profile images for fog/Google Cloud Storage #9958
Conversation
app/models/user.rb
Outdated
has_attached_file :photo, styles: { thumb: '200x200#', medium: '500x500#', large: '800x800#' }, | ||
url: '/system/profile/photos/:id/:style/:basename.:extension' | ||
has_attached_file :photo, styles: { thumb: '200x200#', medium: '500x500#', large: '800x800#' } | ||
#, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect indentation detected (column 1 instead of 8).
app/models/user.rb
Outdated
url: '/system/profile/photos/:id/:style/:basename.:extension' | ||
has_attached_file :photo, styles: { thumb: '200x200#', medium: '500x500#', large: '800x800#' } | ||
#, | ||
# url: '/system/profile/photos/:id/:style/:basename.:extension' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect indentation detected (column 8 instead of 2).
app/models/user.rb
Outdated
has_attached_file :photo, styles: { thumb: '200x200#', medium: '500x500#', large: '800x800#' }, | ||
url: '/system/profile/photos/:id/:style/:basename.:extension' | ||
has_attached_file :photo, styles: { thumb: '200x200#', medium: '500x500#', large: '800x800#' } | ||
#, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after #
.
app/models/user.rb
Outdated
#:path => ":rails_root/public/system/images/photos/:id/:style/:basename.:extension" | ||
#. ":rails_root/public/system/public/system/:class/:attachment/:id_partition/:style/:filename" # from config/initializers/paperclip.rb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after #
.
app/models/user.rb
Outdated
has_attached_file :photo, styles: { thumb: '200x200#', medium: '500x500#', large: '800x800#' }, | ||
url: '/system/profile/photos/:id/:style/:basename.:extension' | ||
has_attached_file :photo, styles: { thumb: '200x200#', medium: '500x500#', large: '800x800#' } | ||
#, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tab detected.
Pushed this to unstable to test... |
344c16b
to
7c35136
Compare
has_attached_file :photo, styles: { thumb: '200x200#', medium: '500x500#', large: '800x800#' }, | ||
url: '/system/profile/photos/:id/:style/:basename.:extension' | ||
has_attached_file :photo, | ||
styles: { thumb: '200x200#', medium: '500x500#', large: '800x800#' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use one level of indentation for parameters following the first line of a multi-line method call.
Codecov Report
@@ Coverage Diff @@
## main #9958 +/- ##
==========================================
+ Coverage 82.13% 82.18% +0.04%
==========================================
Files 98 98
Lines 5968 5967 -1
==========================================
+ Hits 4902 4904 +2
+ Misses 1066 1063 -3
|
OK, so now we are forming the path to the image correctly -- |
OK, trying |
OK - new images seem to be OK. But the problem is that old images followed a different scheme and are stored in locations like this: |
Tested this in GitPod and it should work. Testing on unstable now. |
Code Climate has analyzed commit 4388759 and detected 1 issue on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
OK! I believe this is working and ready to deploy!! |
system test error should disappear:
|
I'm finding missing images in a different directory. So I think we might have a routing issue. E.g.
|
Ah so in these URLs, it's |
has_attached_file :photo, | ||
styles: { thumb: '200x200#', medium: '500x500#', large: '800x800#' }, | ||
url: '/public/system/profile/photos/:id/:style/:basename.:extension', | ||
path: ':rails_root/public/system/public/system/profile/photos/:id/:style/:filename' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, the other way around. So the images you're finding are at users
but we are pointing to profile
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had been working from this old image: https://storage.googleapis.com/publiclab-production/public/system/profile/photos/554/thumb/Bristol-539-7.jpg which currently works.
Confirmed it worked! so, images are now pointed at https://unstable.publiclab.org/public/system/profile/photos/152/thumb/DSCN6508.JPG so i remove "unstable." and it works https://publiclab.org/public/system/profile/photos/152/thumb/DSCN6508.JPG i'll try uploading a new image just to final check great, i believe it worked! it uploaded to https://publiclab.org/public/system/profile/photos/1/medium/aseprite_templates.png ok, let's merge and deploy |
* Update user.rb * adjusted url param for profile images * adjusted custom route for profile images
* Update user.rb * adjusted url param for profile images * adjusted custom route for profile images
Follow-up to #9807 to try fixing profile images
See: https://publiclab.org/profile/liz to test, or https://stable.publiclab.org/profile/liz
fixes #9957