Comments (5)
A few things going on here, it looks like:
First http://d2xfsikitl0nz3.cloudfront.net/
being appended to an already fully pathed URL (https://github.com/opengovernment/opengovernment-app/blob/master/app/helpers/application_helper.rb#L110).
example: http://d2xfsikitl0nz3.cloudfront.net/http%3A%2F%2Fballotpedia.org%2Fwiki%2Fimages%2FVitoLopez.jpg/20/20
Second, once you fix the URL for Vito Lopez, the image path is still not quite right.
- source: http://ballotpedia.org/wiki/index.php/Images/VitoLopez.jpg/20/20
- should be? http://ballotpedia.org/wiki/images/c/c3/VitoLopez.jpg
from askthem.
Here's an example format for using cloudfront successfully for an avatar (from /vt/people):
http://d2xfsikitl0nz3.cloudfront.net/http%3A%2F%2Fvermont-elections.org%2F2009-2010BioBook%2Fjpegs%2Fancel.jpg/60/60
Cloudfront is a CDN and caches the image file at the URL passed to it via the encoded URL in the path at the dimensions following the encoded URL with directories for the dimensions, i.e. the /60/60/.
So what you mentioned, to my mind, should be working when requested from Cloudfront.
The question is why is this pattern not working like the /60/60/ dimensions?
from askthem.
Ah yes I see that now. The image is being cached.
So then in the case of: http://oglocal.herokuapp.com/ny/questions, the source image is not found
For Vito Lopez http://d2xfsikitl0nz3.cloudfront.net/http%3A%2F%2Fballotpedia.org%2Fwiki%2Fimages%2FVitoLopez.jpg/20/20 it returns:
Expected content type image/jpeg, image/png, image/gif, image/jpg, got text/html
And the source image yields this page: http://ballotpedia.org/wiki/index.php/Images/VitoLopez.jpg/20/20
My guess is we have an outdated image URL
from askthem.
Expected content type image/jpeg, image/png, image/gif, image/jpg, got text/html
Yeah, I have seen that for s3 hosted images that didn't have their content-type set correctly in the past. CDN won't simply rely on extension.
And the source image yields this page: http://ballotpedia.org/wiki/index.php/Images/VitoLopez.jpg/20/20
So in the case of a missing image, ballotpedia.org does indeed return text/html, both for the above (which isn't what CDN would request) and for http://ballotpedia.org/wiki/index.php/Images/VitoLopez.jpg (which CDN would request).
However, we don't rely on a single source for images. In the case of state legislators, each one may have a different URL for the image, including from a different provider domain. I'm not sure that simply having a bad URL for this one particular legislator is the only problem.
When we have a good URL for a person, on this page, does the avatar appear as we expect?
So yes, it looks like the the case of Vito Lopez, our URL does appear to be outdated. What you can do is update his photo_url attribute to via the console and reload the page to check if that fixes the problem or if it persists.
from askthem.
I've verified that this IS NOT a problem for officials that don't have their images from ballotpedia.org.
I've opened another issue to deal specifically with the ballotpedia.org based avatars at #28.
from askthem.
Related Issues (20)
- Add images for VA Senators HOT 1
- new users for action network HOT 1
- Staff member can designate user account as representing a partner organization HOT 1
- When asking user is partner organization, a question's TOS are updated to notify of sharing of signatures with partner organization
- Staff members can download CSV of question signers basic information HOT 1
- homepage copy fix
- issue w/ old session? HOT 6
- Internet slowdown day modal HOT 2
- Homepage blurbs not being set as default HOT 4
- increase height of HonestAds widget zip-code box - for FF visitors
- on /map, some city names show Q's, but none listed in /questions HOT 1
- A user's email address can be turned off for notifications HOT 1
- Process AWS SNS bounce notifications by disabling user's email
- images briefly broken on production HOT 6
- name alignment with profile photos got a little wonky HOT 3
- widget design enhancements - seeking volunteer time on useful new tools
- site-wide enhancements to info display & new features
- old verified Twitter avatars not displaying as expected? HOT 2
- PPF devops tasks January 2016 - for time estimates
- reboot site-wide Recent Questions view HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from askthem.