Skip to content

send image rendering blured, but will be ok when reload web page #3603

Open
@fallenleavesguy

Description

@fallenleavesguy

Is there an existing issue for this?

  • I have searched the existing issues.

Is this a problem caused by your code, or is it specifically because of the library?

  • I have double-checked my code carefully.

Describe the bug.

send image rendering blured, but will be ok when reload web page

Image

Expected Behavior

should rendering image fine after send image.

Image

Steps to Reproduce the Bug or Issue

  1. add this js script to project root directory. just name it playground.js
const { Client, LocalAuth, MessageMedia } = require('./index');

const path = require('path');
const os = require('os');

const getChromeUserDataDir = () => {
    const homePath = os.homedir();
    return path.join(homePath, 'AppData', 'Local', 'Google', 'Chrome', 'User Data');
};

console.log(getChromeUserDataDir());    

// Create a new client instance
const client = new Client({
    authStrategy: new LocalAuth(),
    puppeteer: {
        headless: false,
        executablePath: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
        // userDataDir: path.join(__dirname, 'whatsapp-session'),
        args: ['--no-sandbox', '--disable-setuid-sandbox'],
        // userDataDir: getChromeUserDataDir()
    }
});

// When the client is ready, run this code (only once)
client.once('ready', () => {
    console.log('Client is ready!');
    client.getContacts().then(contacts => {
        console.log(contacts);
    });
});

// When the client received QR-Code
client.on('qr', (qr) => {
    console.log('QR RECEIVED', qr);
});

client.on('message_create', (message) => {
    if (message.body === 'send') {
        const media = MessageMedia.fromFilePath(path.join(__dirname, 'testdata', 'myimage.png'));

        client.sendMessage('[email protected]', media, {
            caption: 'Hi!'
        });
    }
});

// Start your client
client.initialize();
  1. add a new image to {projectFolder}/testdata/myimage.png
  2. run node playground.js
  3. send a text send to any people.
  4. you should see the problem

WhatsApp Account Type

Standard

Browser Type

Chrome 137.0.7151.70

Operation System Type

windows 11 x64 24h2

Phone OS Type

other

WhatsApp-Web.js Version

1.30.1-alpha.3

WhatsApp Web Version

2.3000.1023918144

Node.js Version

v22.16.0

Authentication Strategy

LocalAuth

Additional Context

other similar issue(not fix) #2033

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions