Skip to content
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

✨New amp-cld-img extension to display assets from Cloudinary. #22149

Closed
wants to merge 18 commits into from

Conversation

nitzanj
Copy link

@nitzanj nitzanj commented May 6, 2019

Add a new extension named amp-cld-img, used to display images from Cloudinary.
This is a completely new extension based on <img>, useful for Cloudinary customers authoring amp pages.

The extension allows developers to declare transformations and effects using attributes, and then sets the underlying src attribute automatically.

More info:
Intent to implement
Cloudinary home page

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@ghost
Copy link

ghost commented May 6, 2019

This pull request introduces 2 alerts when merging d5c6c2a into b814e5d - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable
  • 1 for Unneeded defensive code

Comment posted by LGTM.com

@aghassemi aghassemi requested review from sparhami and cathyxz May 6, 2019 18:27
@aghassemi
Copy link
Contributor

adding @sparhami as well to help out with the review. Thanks!

Copy link

@sparhami sparhami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments, will take another look once those are addressed.

const fetchFormat = optionConsume(options, 'fetchFormat', null);
const quality = optionConsume(options, 'quality', null);

const transformation = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these keys are combined with those of responsive, it is a bit misleading to have them as separate objects. For example, just reading the code at a quick glance, there doesn't seem to be any problem if there are keys that are repeated between the two, when in fact, this is a problem.

It could make things more clear to have comments to separate out the sections:

const fields = {
  // transformations
  b: background,

  // responsive
  dpr: dprValue,
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's a bit confusing, however the separation is there because each segment of the is processed separately - [raw_transformation/transformations fields/responsive fields].
It ends up looking like so (assuming no raw transformation, for simplicity):
b_red,e_sepia/w_100,c_crop
If all the fields are in the same object I can't really separate which fields come before the slash and which ones after, it can change the meaning completely.

@ghost
Copy link

ghost commented May 12, 2019

This pull request introduces 2 alerts when merging 1b6e0cc into e38e621 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable
  • 1 for Unneeded defensive code

Comment posted by LGTM.com

@mrjoro
Copy link
Member

mrjoro commented Aug 8, 2019

Is this PR still active?

@mrjoro
Copy link
Member

mrjoro commented Jun 11, 2020

I'm closing this PR since it no longer seems active. Please reopen if needed.

@mrjoro mrjoro closed this Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants