-
Notifications
You must be signed in to change notification settings - Fork 21
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
UDA Attachment Improvements #404
Comments
Ok, sure. Some questions
Let's add thumbnail to the preview, the media's sha2 to the media and HD blake3 to the attachments? pub struct TokenData {
(...)
pub preview: Option<EmbeddedMedia>,
pub media: Option<Attachment>,
pub attachments: Confined<BTreeMap<u8, Attachment>, 0, 20>,
(...)
}
|
|
One thing to keep in mind, Preview should have constrained dimensions, and be encoded in a lossy format, like JPEG. I believe you can use this A good dimension would be 630px, because it's the dimension used by Facebook and Instagram. |
Does it make sense, instead of doing this within the contract issuance method, to expose a method for BME to perform image adjustments and then send it for contract issuance? |
It's easier to do it in Rust in my experience. |
Also, let's use this method instead |
I think I didn't explain it right. I'm saying we have a method in rust, just for that. This way, before sending to the contract issuance method, the media are already "in the correct format". This way, we could create a UX where while this method is running "adjusting image" appears, for example, like when you upload a photo. Then, when this is finished, we only send the data to issue the contract. Does make sense to you? |
The only problem with that approach, as nice as it sounds, is that we would have to return bytes back to JavaScript and then immediately return them to Rust WASM, like the type signatures in these methods: bitmask-core/lib/web/carbonado.ts Lines 6 to 17 in d62161c
That's a lot of memory allocation that could be avoided by providing the media to Rust WASM just once. |
What if instead of returning the bytes, we just return the hash and name of each file, because this method, in addition to processing images, is already hosted on the rgb-proxy, because our images are not on carbonado, they are on rgb-proxy and today we use it on the bitmaskd server. |
Where does the thumbnailing occur? |
I was thinking that resolving the images could be a request to our bitmaskd server and it wouldn't return the thumbnail, just the ids, names and hashes. Then when we issue it, I would retrieve the information directly (if necessary) from rgb-proxy and then issue it. |
You haven't answered my question, how do we get a thumbnail to embed in the consignment preview? |
I need to think a little, but in the consignment file, I believe we can use the contract ID, or the contract property itself called TokenData to be able to fetch this data from the rgb-proxy. |
No, we need to embed the preview within the consignment. That's what EmbeddedMedia is, right? |
EmbeddedMedia is the type only of the preview field, of the RGB21 contract. In Transfer type Consignment, it does not have this type of data. What I was proposing is that in this consignment preview (I think you are referring to this issue), I could return the thumbnail in the response. Does it make sense to you? |
That works. But we agree that the media needs to be thumbnailed and embedded within the Contract Consignment preview? |
I agree if we are talking about the return of the issue. Can I do it in release 0.7.0? |
Sure, so long as we can get that and our new swaps done over the weekend. We need to have a beta 0.7.0 wallet ready by Monday. |
We'll need to support three separate media attachment formats for our UDAs:
The text was updated successfully, but these errors were encountered: