Comments (4)
@ashutoshkrris Yes exactly, that is the correct output.
from imgix-python.
Hi @sherwinski
Is my below understanding correct?
Example 1:
from imgix import UrlBuilder
client = UrlBuilder("demo.imgix.net")
client.create_srcset("image.jpg", {"w": 100}, {"device_pixel_ratios": [1, 2]})
Output:
https://demo.imgix.net/image.jpg?dpr=1&q=75&w=100 1x
https://demo.imgix.net/image.jpg?dpr=2&q=50&w=100 2x
Example 2:
from imgix import UrlBuilder
client = UrlBuilder("demo.imgix.net")
client.create_srcset("image.jpg", {"w": 100}, {"device_pixel_ratios": [1, 4]})
Output:
https://demo.imgix.net/image.jpg?dpr=1&q=75&w=100 1x
https://demo.imgix.net/image.jpg?dpr=4&q=23&w=100 4x
Example 3:
from imgix import UrlBuilder
client = UrlBuilder("demo.imgix.net")
client.create_srcset("image.jpg", {"w": 100}, {"device_pixel_ratios": [1, 2, 3]})
Output:
https://demo.imgix.net/image.jpg?dpr=1&q=75&w=100 1x
https://demo.imgix.net/image.jpg?dpr=2&q=50&w=100 2x
https://demo.imgix.net/image.jpg?dpr=3&q=35&w=100 3x
If the above examples are fine, I am interested to work on this issue.
from imgix-python.
Hey @ashutoshkrris,
You've got it right with the examples you've provided. The only one I would add is a way for users to modify variable qualities with their specified ratios:
Example:
from imgix import UrlBuilder
client = UrlBuilder("demo.imgix.net")
client.create_srcset(
"image.jpg",
{ "w": 100 },
{
"device_pixel_ratios": [ 1, 2, 3 ],
"variable_qualities": { 1: 45, 2: 30, 3: 20 }
}
)
Output:
https://demo.imgix.net/image.jpg?dpr=1&q=45&w=100 1x
https://demo.imgix.net/image.jpg?dpr=2&q=30&w=100 2x,
https://demo.imgix.net/image.jpg?dpr=3&q=20&w=100 3x,
I'll go ahead and assign this issue to you. Please let me know if you have any other questions.
from imgix-python.
Thanks for the clarity @sherwinski
Just one more case, what should be the output in this case?
from imgix import UrlBuilder
client = UrlBuilder("demo.imgix.net")
client.create_srcset(
"image.jpg",
{ "w": 100 },
{
"device_pixel_ratios": [ 1, 3 ],
"variable_qualities": { 1: 45, 2: 30, 3: 20 }
}
)
Should this be the output?
https://testing.imgix.net/image.jpg?ixlib=js-3.7.0&w=100&dpr=1&q=45 1x,
https://testing.imgix.net/image.jpg?ixlib=js-3.7.0&w=100&dpr=3&q=20 3x
from imgix-python.
Related Issues (14)
- Submit to PyPI HOT 1
- feat: customize variable qualities HOT 2
- Add License
- Pull README into setup.py's long_description HOT 1
- Think through potential rename
- Needs tests w/ TravisCI integration HOT 1
- Trouble signing with `%20` character in url for HOT 11
- 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.