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

Allow Returning Raw Data Instead of HTML #150

Open
amxmln opened this issue Jan 19, 2023 · 3 comments
Open

Allow Returning Raw Data Instead of HTML #150

amxmln opened this issue Jan 19, 2023 · 3 comments

Comments

@amxmln
Copy link

amxmln commented Jan 19, 2023

Hello there! I’m currently looking into using astro-imagetools to implement my own <Img /> and <Picture /> components in Vue.js.

This should be possible by using the API functions, but unfortunately the values are returned as HTML. I could parse those return values and get my data that way, but I think it would be nice to provide some additional API functions to just return the data itself, so a user can decide how they want to build the HTML from it.

Something like getRawPicture(props) that returns an array of sources, the placeholder image, image dimensions, etc.

@RafidMuhymin
Copy link
Owner

It's on my roadmap but I currently don't have time to work on this. If you are interested you can create a PR. getImage() sounds better to me. The initial thought was to export the internal getImage() utility after tweaking a little bit.

@amxmln
Copy link
Author

amxmln commented Jan 19, 2023

Yeah, that’s what I thought would be an option as well. What would you want to tweak about the function?

Totally get not having enough time to work on it—you‘ve done so much already!

I can’t commit to a PR right now, but I’ll look into it and update the issue accordingly.

@RafidMuhymin
Copy link
Owner

Happy to see your interest in the project.

What would you want to tweak about the function?

Can't tell currently. Will have to check. I just said because it might need tweaking.

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