Comments (11)
Hey there @adamn. The library is designed to accept unencoded URLs. If you pass in an unencoded URL, this should work as expected. Please let me know if you're still running into issues!
from imgix-python.
http://www.brookings.edu/~/media/research/images/l/lk%20lo/london_bigben_flags001/london_bigben_flags001_16x9.jpg
is the url I have. If I convert the %20
to a +
then the signature will work but the underlying url will not exist. If I don't convert it, the url does not get signed correctly and the Imgix server returns a 401. Is there any solution?
from imgix-python.
Yes. The issue here isn't the space character itself, but that part of the URL being passed has been encoded, while part hasn't (the /
, ~
, and other characters). To make this a bit more straightforward, I've just published version 1.1.1, which automatically unescapes passed URLs before re-escaping them. Let me know if you have any more questions!
from imgix-python.
Cheers!
from imgix-python.
Sorry, this still doesn't work for me. I still get a 'bad request' on the imgix server because of the bad signature. Also, it looks like your test asserts the url, not the signature (which is the problem since I'm getting a 401 - i.e. the signature isn't correct).
from imgix-python.
Hey @adamn, can you send through the new URL that's being generated?
from imgix-python.
It's in the initial part of the ticket. Sorry don't have it with me right now.
On Jun 30, 2016, at 12:52 PM, Paul Straw [email protected] wrote:
Hey @adamn, can you send through the new URL that's being generated?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
from imgix-python.
Hmm, you shouldn't be getting the same output with the 1.1.1
version of the library. When you're able, could you let me know what the new URL you're getting is? I can generate it on my end, but just want to make sure there's not anything else going on here.
from imgix-python.
These are the steps for 1.1.1. The final url returns a 400 now. Just to note, I used to get a 401 with 1.1.0
>>> import imgix
>>> imgix._version.__version__
'1.1.1'
>>> image_url_builder = imgix.UrlBuilder(IMGIX_URL, sign_key=IMGIX_SIGN_KEY, use_https=True)
>>> image_url = 'http://www.brookings.edu/~/media/research/images/l/lk%20lo/london_bigben_flags001/london_bigben_flags001_16x9.jpg'
>>> options = {'w': 260, 'fit': 'crop', 'crop': 'entropy'}
>>> image_url_builder.create_url(image_url, options)
'https://factr-url.imgix.net/http%3A%2F%2Fwww.brookings.edu%2F%7E%2Fmedia%2Fresearch%2Fimages%2Fl%2Flk%20lo%2Flondon_bigben_flags001%2Flondon_bigben_flags001_16x9.jpg?crop=entropy&fit=crop&ixlib=python-1.1.1&w=260&s=c09df394cd0c270f82afaa57c29bab47'
from imgix-python.
Okay, after a bit more digging on this, I've realized that the encoded space character was a red herring. The encoding of the space was actually correct before. The encoding that was actually messed up was the ~
. (Working URL: https://factr-url.imgix.net/http%3A%2F%2Fwww.brookings.edu%2F~%2Fmedia%2Fresearch%2Fimages%2Fl%2Flk%2520lo%2Flondon_bigben_flags001%2Flondon_bigben_flags001_16x9.jpg?crop=entropy&fit=crop&ixlib=python-1.1.1&w=260&s=02e201bd94fc0241051f540e6149699d
)
I'm getting this all patched up, and will have a 1.1.2 out shortly.
from imgix-python.
Alrighty @adamn, I just bumped this and verified with your example URL. Should be good to go!
from imgix-python.
Related Issues (14)
- Submit to PyPI HOT 1
- feat: customize variable qualities HOT 2
- feat: customize target Device Pixel Ratios HOT 4
- Add License
- Pull README into setup.py's long_description HOT 1
- Think through potential rename
- Needs tests w/ TravisCI integration HOT 1
- URI signature match failed when dl parameter has a space HOT 1
- Type Safety for URL options HOT 5
- Handle fully-qualified URLs in paths better
- Py2 and 3 compatibility HOT 10
- Consider storing a float percentage HOT 1
- feat: optionally disable path encoding HOT 5
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 imgix-python.