-
Notifications
You must be signed in to change notification settings - Fork 16
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
[responsive()]: Step is not taken into account #93
Comments
For the time being, I've created my own plugin based on the original one.
|
Hi fcisio, |
Thanks! It implements:
|
Thanks fcisio. |
Hi fcisio, |
Hi fcisio, |
How could this be expected behaviour? All documentation and guides say it works different. Also makes absolutely no sense regarding transformation billing. Is there any update on this? |
@KevinKreps would you expect to get a stretched image if your container is larger than the image? (Say the container is 1000px, but your responsive steps are [200,400,600] - would you expect to get a 600px image stretched to 1000?) We believe that's undesired, however I'm curious to hear your opinion on this. I'm also interested in the use case - in what situations would your responsive steps be so far from your containers? Speaking of implementation details, we can consider a flag of sorts (pseudo code: lastly, since this is indeed the expected behaviour (which we are now discussing here about changing), please share where does the documentation/guides state otherwise so we can adjust it. |
@patrick-tolosa Thanks for your superfast reply :) If my container is 1000px and my steps go to 600px only, then yes, I would expect it to stretch resulting in shitty quality. I would also expect anyone working with steps to consider this case. For example, if I use [200,400,600] I would make sure that my container sizes are all roughly in that range. If I want to have a more detailed view, I would conditionally not use the responsive plugin and manually set width and height (maybe even using original image). I could also define [200,400,600, 1000]. Then I would expect any container larger than 600 using the 1000px image. Also, I could do responsive(200). This will allow any step multiple of 200. In my opinion, any one of these solutions is miles better than the actual behaviour right now, which is basically saying responsive(1). In this setup I would never use responsive as it could drive my transformation costs like crazy, rendering the plugin useless. The idea with the flag is interesting. What would happen if it is set to false? Then fetch original?
e.g. this guide uses responsive(200) |
That's what I meant when I mentioned "by design", the assumption the plugin makes is that people won't use steps that are far from their container width.
Some use cases for clarity
The OP also raised this as an expectation:
Aside from all that, the system was designed for extensibility - if the default behaviour is not suitable for you, you can create your own plugin as @fcisio did. Not sure what you mean here:
Lastly, since you mentioned you a few times, can you please explain how this plugin could "drive your transformation costs like crazy"? - perhaps I'm missing something. Please consider this is an opinionated discussion about the default behaviour, and we're considering all our customers - that's why we offer the option to customize it in the first place. |
This would be a great solution!
With this, I mean: Everywhere I was reading about the responsive plugin, steps were mentioned. I expected it to work as stated in the guides. Took me a little while to figure out that it was not implemented, and I didn't understand why it is not implemented.
The reason of using steps is to reduce the variety of possible requests. Different/new transformation requests result in a transformation on cloudinarys side, which is billed. Moreover, the possible CDN cache hit decrease, resulting in longer loading for customers. This is a result of people using different browser sizes. I really hope this will get implemented soon, if not it will be necessary to look for other solutions as you stated. Could you please keep us up to date regarding this topic and any final decision? |
Thanks @KevinKreps - it's much clearer now! I get where you're coming from regarding transformation costs - something to keep in mind moving forward. I'll provide an update when I have more information |
Hi, I'm using the React SDK and the
responsive()
plugin doesn't seem to work properly for me.Basically, regardless of the value I input in the plugin (ex:
400
,[400, 800, 1200]
), the scale that is fetched always matches the parent element.What I would expect
object-fit: cover
, should still look good. (The aspect ratio of the image should also be taken into account when comparing to the container)The SDK V1 was more complete regarding the responsive behaviors.
Alternatives
sizes
prop (setting it would opt-out of the container width; based responsive)The text was updated successfully, but these errors were encountered: