gramjs icon indicating copy to clipboard operation
gramjs copied to clipboard

Trying to get channel image

Open WeroCode opened this issue 1 year ago • 3 comments

I got the dialog from client.getDialogs() and in dialog.entity.photo.strippedThumb I have Buffer, I tried to convert it to image via code But got only white square, though channel has image.

Thanks in advance.

WeroCode avatar Sep 11 '22 07:09 WeroCode

I don't necessarily need to get the photo via strippedThumb, the main thing is to not have a lot of requests to telegram.

WeroCode avatar Sep 11 '22 17:09 WeroCode

the stripped thumb property is like 1kb at best and won't have much info.

you can use strippedPhotoToJpg to convert it to an image.

import { strippedPhotoToJpg } from "telegram/Utils";

painor avatar Sep 11 '22 18:09 painor

Yes, you're right. What I got is just a blurry nothing. If I use downloadProfilePhoto, won't that make a lot of requests? If it does, what's the best way to do it?

WeroCode avatar Sep 12 '22 02:09 WeroCode