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

feat: add r/docs/img_embed #3241

Merged
merged 4 commits into from
Dec 7, 2024
Merged

feat: add r/docs/img_embed #3241

merged 4 commits into from
Dec 7, 2024

Conversation

moul
Copy link
Member

@moul moul commented Nov 28, 2024

Embedding an image.

@moul moul self-assigned this Nov 28, 2024
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Nov 28, 2024
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Nov 28, 2024

I'm a bot that assists the Gno Core team in maintaining this repository. My role is to ensure that contributors understand and follow our guidelines, helping to streamline the development process.

The following requirements must be fulfilled before a pull request can be merged.
Some requirement checks are automated and can be verified by the CI, while others need manual verification by a staff member.

These requirements are defined in this configuration file.

Automated Checks

🟢 Maintainers must be able to edit this pull request (more info)
🟢 The pull request head branch must be up-to-date with its base (more info)

Manual Checks

No manual checks match this pull request.

Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 On every pull request

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

The pull request head branch must be up-to-date with its base (more info)

If

🟢 Condition met
└── 🟢 On every pull request

Then

🟢 Requirement satisfied
└── 🟢 Head branch (moul:dev/moul/img-embed) is up to date with base (master): behind by 0 / ahead by 4

@moul moul marked this pull request as ready for review November 28, 2024 20:44
Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!


Here’s an example of embedding an image in a Gno realm:

![Example Image](https://i.imgur.com/So4rBPB.jpeg)`
Copy link
Contributor

Choose a reason for hiding this comment

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

On a dev call, I thought we said that embedding an image from a random web site is a security risk.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jefft0, I don't remember this.

Our goal is to create a list of whitelisted domains for auto-preview. Imgur is, if I recall correctly, moderated. Therefore, Gnoweb can be updated to disable automatic previews for non-whitelisted domains while still allowing links to any URL, whether for images or other content.

Note: This example aims to discourage users from uploading all their files in base64 on the chain. Such cases should be very advanced and only relevant in rare situations. By default, image embedding or linking should be the preferred method for sharing assets.

Copy link
Contributor

Choose a reason for hiding this comment

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

can't wait for gnoweb refacto so we can add ipfs:// embed support :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I will likely address all the bad practices I see everywhere by providing examples here. Here’s my shortlist:

  • Base64 meme images (inefficiency)
  • Writing JSON encoders (makes code hard to read, mixes concepts and targets)
  • Creating top-level functions for everything instead of promoting maketx run

I will write new examples soon and open issues so we can update the tools (e.g., gnoweb).

@moul moul requested a review from leohhhn December 6, 2024 21:41
@moul moul merged commit 0a2c447 into gnolang:master Dec 7, 2024
104 checks passed
@moul moul deleted the dev/moul/img-embed branch December 7, 2024 13:13
omarsy pushed a commit to TERITORI/gno that referenced this pull request Dec 7, 2024
Embedding an image.

---------

Signed-off-by: moul <[email protected]>
Villaquiranm pushed a commit to Villaquiranm/gno that referenced this pull request Dec 9, 2024
Embedding an image.

---------

Signed-off-by: moul <[email protected]>
r3v4s pushed a commit to gnoswap-labs/gno that referenced this pull request Dec 10, 2024
Embedding an image.

---------

Signed-off-by: moul <[email protected]>
@Kouteki Kouteki removed the in focus label Dec 16, 2024
albttx pushed a commit that referenced this pull request Jan 10, 2025
Embedding an image.

---------

Signed-off-by: moul <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

6 participants