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

Store public_id in image object? #8

Open
mmccoy opened this issue Mar 16, 2016 · 5 comments
Open

Store public_id in image object? #8

mmccoy opened this issue Mar 16, 2016 · 5 comments

Comments

@mmccoy
Copy link

mmccoy commented Mar 16, 2016

Thanks for putting this package together.

I'm using it, uploading to Cloudinary is working, however when displaying them in a template -- the orion.attribute('image') object has no reference to the cloudinary 'public_id'.

So I can't do something like:
<img src="{{c.url public_id crop='fill'}}"/>

The returned image object looks like this:

{
  fileId: "mtzYCTKHZ4MozjTmp",
  info: {
    backgroundColor: "#f9f9f9",
    height: 300,
    primaryColor: "#080808",
    secondaryColor: "#5f5f5f",
    width: 200
  },
  url: "http://res.cloudinary.com/....../ufa3sj61yhgvmyatvi8m.jpg"
}

How is it possible to get a reference to the cloudinary provided public_id?

-mm

@mmccoy
Copy link
Author

mmccoy commented Mar 16, 2016

It looks like this line should be storing all the meta data as needed:
success(result.url, result);

But its not saved anywhere to the orion collection?

-mm

@rwatts3
Copy link
Owner

rwatts3 commented Mar 16, 2016

@mmccoy ,

So I have a few projects using this, and I had to implement a work around to take the url and split the "image.url" that the orionjs:image package generates. I found that although storing the additional meta data with this package. Orion's image attribute actually doesn't consume the extra meta data. I've got a branch where I'll be submitting a PR so that when cloudinary stores the result meta, the image attribute actually consumes it for later use.

For now, as stated above i'm having to take the url that's generated by the image attribute and actually pick off the cloudinary url. This is certainly not ideal, and is a lot of extra work that is un-needed for every image that is loaded.

@mmccoy
Copy link
Author

mmccoy commented Mar 16, 2016

Okay, fair enough, I'll do the same -- please let me know if you land a PR somewhere that actually populates the orion image object with the returned cloudinary meta data.

Thanks for your work!

@rwatts3
Copy link
Owner

rwatts3 commented Mar 16, 2016

Will do and no problem thank you for using the package
On Wed, Mar 16, 2016 at 3:46 PM Michael McCoy [email protected]
wrote:

Okay, fair enough, I'll do the same -- please let me know if you land a PR
somewhere that actually populates the orion image object with the returned
cloudinary meta data.

Thanks for your work!


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#8 (comment)

@rwatts3
Copy link
Owner

rwatts3 commented Jul 2, 2016

Now that I maintain the Orion project I will consider merging in this option with the image attributes that so we can store the ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants