KIVYMD ThreeLineAvatarListItem - kivy

i use ThreeLineAvatarListItem in kivymd and i'm wondering how you can use an image from an url,
when i use a local image it's working but when it's an url, i receive this message:
[ERROR ] [Image ] Not found
https://c1.scryfall.com/file/scryfall-cards/art_crop/front/0/1/01cb2a12-4c1c-413d-91b1-574e4a00e251.jpg?1581630415
the code i use is this one :
for row in result:
image = ImageLeftWidget(source=row[3])
items = ThreeLineAvatarListItem(text=row[0], secondary_text=row[1],tertiary_text=row[2])
items.add_widget(image)
lv.add_widget(items)
row[3] contains "https://c1.scryfall.com/file/scryfall-cards/art_crop/front/0/1/01cb2a12-4c1c-413d-91b1-574e4a00e251.jpg?1581630415"
is there a way to do that ?
thank you

Try defining your own version of ImageLeftWidget that uses AsyncImage instead of Image, like this:
class AsyncImageLeftWidget(ILeftBody, AsyncImage):
pass
Then use this class in your code in place of ImageLeftWidget.

Related

ES_Extended locale.lua attempted to call string value

enter image description here
enter image description here
enter image description here
i get this error everytime it tries to call the funtion _U and add the translated string to the esx:notification. pls help i am not that good att lua. locale.lua es_extended
A easier way to do it is to change your locales-system.
-> first create a locales folder an write the path in your fxmanifest.lua or __ressource.lua
-> create a en.lua in your locales folder and build it like this:
Locales['en'] = {
['NAME'] = 'WORD',
}
-> now you can use it like this ESX.ShowNotification(_U('NAME')) in your client and like this TriggerClientEvent('esx:showNotification', source, _U('NAME') in your server

How can I set the name for a file that is to be downloaded in a Koa response?

I make a image proxy (to download a image not open) use node and koa.
the url /proxy/image code is :
...
const PassThrough = require('stream').PassThrough
let query = qs.parse(url.parse(ctx.request.url).query)
let passThroughStream = new PassThrough()
ctx.body = request(query.src).pipe(PassThrough())
...
The image downloaded name is image, but I want to rename the image, how could I do?
If I understand your question correctly, you should be able to do this by using ctx.attachment() which is an alias for ctx.response.attachment(). So you can do something like:
ctx.attachment('my-image.png')
This attachment method is basically a shorthand of the following header:
ctx.set('Content-disposition', 'attachment; filename=my-image.png');

How to perform on the fly image transformations in iOS using Cloudinary

I am looking to perform image transformations using cloudinary on a web image url using the "fetch" type. I am looking to do something similar to the JAVA example for android here, but using Swift.
How can I achieve this in Swift?
Thanks!
There are many ways to tackle this, for example you can use something like that:
let options:NSDictionary = [
"transformation": CLTransformation(dictionaries: [["width":300,"height":300,"crop":"fill","gravity":"face","radius":"max","fetch_format":"auto",]]),
"type": "fetch"
]
let url:String = Cloudinary!.url("http://upload.wikimedia.org/wikipedia/commons/0/0c/Scarlett_Johansson_Césars_2014.jpg", options:options1 as! [AnyHashable: Any])
The result url in this case will be: http://res.cloudinary.com/demo/image/fetch/c_fill,f_auto,g_face,h_300,r_max,w_300/http://upload.wikimedia.org/wikipedia/commons/0/0c/Scarlett_Johansson_C%C3%A9sars_2014.jpg

Vaadin: Images in Grid with IndexedContainer

So I'm trying to add Images to my Grid using an IndexedContainer with the following code:
//picture
String imgURL = (String)ds.child(PHOTO).getValue();//gets the image URL from the DB
System.out.println(imgURL);
ExternalResource picture = new ExternalResource(imgURL);
System.out.println(picture.getURL());
Image image = new Image(PICTURE, picture);
image.setHeight("5px");
item.getItemProperty(PICTURE).setValue(image);
Instead of getting the picture, I'm getting the toString() of the Image object. Both println print the correct URL. Also note that this works with Table but not with Grid. Any idea why?
If you want to display an image in a Vaadin Grid column, you need to set the ImageRenderer, see here paragraph ImageRenderer.
Example: Define your column like
grid.addColumn("picture", Resource.class).setRenderer(new ImageRenderer());
then add a resource as column value
grid.addRow(new ThemeResource("img/copernicus-128px.jpg"), "Nicolaus Copernicus", 1543);
In your case it is the ExternalResource. No need for the Image component.

imagej get current image from imagestack

i need to get the current image opened after importing an image sequence to ImageJ.
As i need to save the overlay information to a text file bearing the name of the image
int number = imp.getImageStackSize();
if(number > 1)
{
ImagePlus check = imp.duplicate();
gd.removeAll();
gd.addMessage(check.getTitle());
gd.showDialog();
}
imp.gettitle returns the folder name the images were loaded from.
couldn't find any solution so far :(
Any way to find the text in the status bar would be appreciated..
it was a simple issue..
the name of the current image can be retrieved by the following piece of code..
fileName = imp.getImageStack().getShortSliceLabel(imp.getCurrentSlice());
Thanks everyone..

Resources