open-wa/wa-automate-nodejs

FEATURE: SetProfilePic didnt work?? #1105

Terror-Machine posted onGitHub

<!-- READ THIS FIRST: - Make sure you are running the latest version of @open-wa/wa-automate before reporting an issue. - Provide as many details as possible. Paste logs, configuration samples and code into the backticks. DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed without comment. -->

Describe the bug i try to reproduce to update profile pictures with commands bot, but didnt work. its still insider or how to use that?

create() code

                        } else if (getComs(txt, 'setprofilepic')) {
                            if (isMedia) {
                                const mediaData = await decryptMedia(message)
                                const imageBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}`
                                await fn.setProfilePic(imageBase64)
                            } else if (quotedMsg && quotedMsg.type == 'image') {
                                const mediaData = await decryptMedia(quotedMsg)
                                const imageBase64 = `data:${quotedMsg.mimetype};base64,${mediaData.toString('base64')}`
                                await fn.setProfilePic(imageBase64)
                            }
                        }

DEBUG INFO This is the info printed to the console when you start your app. It should look like this

Debug Info {
  WA_VERSION: 2.2047.11,
  PAGE_UA: WhatsApp/2.2037.6 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36,
  WA_AUTOMATE_VERSION: 3.1.0,
  BROWSER_VERSION: HeadlessChrome/87.0.4280.66
}

Host (please complete the following information):

  • OS: Android

@Terror-Machine can you share the profile picture that you're trying to set, please

posted by smashah about 4 years ago

@Terror-Machine im sure it has something to do with the size of your photo:

works:

https://dummyimage.com/600x600/000/fff.jpg
https://dummyimage.com/600x700/000/fff.jpg
https://dummyimage.com/700x700/000/fff.jpg

doesn't work:

https://dummyimage.com/6900x700/000/fff.jpg
https://dummyimage.com/1000x1000/000/fff.jpg
https://dummyimage.com/900x900/000/fff.jpg
https://dummyimage.com/800x800/000/fff.jpg
posted by smashah about 4 years ago

@Terror-Machine I've issued a patch that will automatically downscale the image to a size that will most likely work (it may still be out of bounds due to edge cased aspect ratios). Please restart your sessions and try again. Report back if working for you. Thanks

posted by smashah about 4 years ago

still same, not work.

posted by Terror-Machine about 4 years ago

IMG-20201123-WA0369 i try with this pict, but doesnt work

posted by Terror-Machine about 4 years ago

IMG-20201105-WA0232 but i try whit this pict, its work.

posted by Terror-Machine about 4 years ago

need some parameter to downscale by manual?

posted by Terror-Machine about 4 years ago

@Terror-Machine I suspect it's due the the vertical aspect ratio. Try to crop it manually into a square and try again pls

posted by smashah about 4 years ago

its work

posted by Terror-Machine about 4 years ago

but if the case just about aspect ratio, is meaning i need to rescale by manual.. good work dude, just on document need information to new parameter

posted by Terror-Machine about 4 years ago

@Terror-Machine it should work with any aspect ratio now. I'll close this for now let me know if you're still having issues and I'll reopen. Thanks

posted by smashah about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests